From patchwork Mon Nov 16 10:16:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11907955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45929C5519F for ; Mon, 16 Nov 2020 10:18:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BFA0720888 for ; Mon, 16 Nov 2020 10:18:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b0IT8+M8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="SG2Ndhe6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BFA0720888 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fI4sJXIWYJimDxYp5asNDKLhjg/4tto9bHwcqrOdBvY=; b=b0IT8+M8o20i0Z5ZNnv4e83P4 89ibpfdl/c8eqOc7+XiaUUlsgSEJPFEq3hQcu4/AW7bIBgoIctvNkN9TNi+L7F2sRHHIIGCArSdTg +qMzkHw0vF3iGd3IMukIyQfHGaeY1vFYCrpyl4lQke/FDLc8zMXKkrSNfrbW7j4KJJLD9BKO5sABq P2NBzHn2yl0lQs4Up6zw4Pm5/5QuRMyPpKyG/01RYRk8YdRVYSciCyDygEv+cCEA0wV5nzGNA/OOC 7EShbL2CnuX/DL35PCH40Z5ZMykflJtbP8lZA07aNIgRRJ1DJ7wsd9SzM26G2C8/finP69xGFWHOz b9vo/vHuw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kebZb-0000p7-2w; Mon, 16 Nov 2020 10:17:23 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kebZB-0000h7-SB for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 10:17:01 +0000 Received: by mail-wr1-x441.google.com with SMTP id b6so18050077wrt.4 for ; Mon, 16 Nov 2020 02:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ceCydoW0taXspmLSuwqkIqJ7k7CBWNdOO4aazBAUNz0=; b=SG2Ndhe6APWjlDn6wFEvBZ3ehJOUWLlIgfiAYzAPABdH4U5rx/TjUyvoLtMsvnGE5T qMjURWhDpgFHkUkTBxhkQE9JtPrwJ+btN6BDoOVcNzqeaPGq3Am1WfKnVjT8ZUQZofZ3 /C2l8KmcE+5vQ3kL4ls01KicfLYWdQD1v8brhkdP50/OEjppXABLw95IHG5oDr2AcNDW JAhh0dCaGfmVGNOcoKS1AW+q5DlGgv3XIIy2wHQ/j2AJjA6YuNjU4PN2U7vItiShRmsX kBoSI4+bSJZ1Sy/2zBXWdcXqe0kRgMaBQK4khGLgB18ZzXVVzp8xOiwGw0d8cQCogixs AXsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ceCydoW0taXspmLSuwqkIqJ7k7CBWNdOO4aazBAUNz0=; b=Y/0raxnw+96N7+QxTnA6WWEzcMbomD2hQNtuCstsdiFw/cWgJxEWq5y2G08lPcU25C 0Ek7DoXt26ICkdW/jFrdfHRQzQ6u5srscp6gfImgvqava0iIjK8K+hOMa1cgSO8+MCmL rJNBdLg9kzNgnBvAEzvX+hCid7Ts5XMklSta84Q/MXkEhxa6mr4PDsuoisnTSPhjqXnE PklcZU5vVA2ukSl2MhL2NR3Ez16NPhu307yw33TFjBm3pNAFA9byrHBg5PDuIJNBtRhd DyF/JeqyUPHKhWI3oGKFeXAQi4ItBEylydAaTWYN1h2ob/LxZIZ698Y9j4+2JC9XbrsE I43A== X-Gm-Message-State: AOAM533EPl7QR2g/r2ZU/ttUGJc5+c99LChGzCq/ceXJyB2J5D9Ef9HO fM7ELzXu+WipyjbBSa2SDfUkKQ== X-Google-Smtp-Source: ABdhPJy7bRH4MB0eF2todERkHKwsqav6ZT/Sr2okUSKCVRiGHZhZZuaJo0eIDZb+4P8SU1UrHOLHhQ== X-Received: by 2002:adf:8382:: with SMTP id 2mr18405195wre.227.1605521812097; Mon, 16 Nov 2020 02:16:52 -0800 (PST) Received: from localhost.localdomain ([2a01:e35:2ec0:82b0:edb9:72a:9e35:6eb]) by smtp.gmail.com with ESMTPSA id c17sm22265131wro.19.2020.11.16.02.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 02:16:51 -0800 (PST) From: Neil Armstrong To: kishon@ti.com, repk@triplefau.lt, devicetree@vger.kernel.org, vkoul@kernel.org Subject: [RESEND PATCH v3 1/3] dt-bindings: phy: amlogic, meson-axg-mipi-pcie-analog: remove reg attribute Date: Mon, 16 Nov 2020 11:16:45 +0100 Message-Id: <20201116101647.73448-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201116101647.73448-1-narmstrong@baylibre.com> References: <20201116101647.73448-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_051658_003149_8AAB1508 X-CRM114-Status: GOOD ( 14.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The PHY registers happens to be at the beginning of a large zone containing interleaved system registers (mainly clocks, power management, PHY control..), found in all Amlogic SoC so far. The goal is to model it the same way as the other "features" of this zone, like Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt and Documentation/devicetree/bindings/power/amlogic,meson-ee-pwrc.yaml and have a coherent bindings scheme over the Amlogic SoCs. This update the description, removed the reg attribute then updates the example accordingly. Signed-off-by: Neil Armstrong Acked-by: Rob Herring --- .../phy/amlogic,meson-axg-mipi-pcie-analog.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml b/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml index 18c1ec5e19ad..702763a84dac 100644 --- a/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml +++ b/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml @@ -9,27 +9,32 @@ title: Amlogic AXG shared MIPI/PCIE analog PHY maintainers: - Remi Pommarel +description: |+ + The Everything-Else Power Domains node should be the child of a syscon + node with the required property: + + - compatible: Should be the following: + "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon" + + Refer to the the bindings described in + Documentation/devicetree/bindings/mfd/syscon.yaml + properties: compatible: const: amlogic,axg-mipi-pcie-analog-phy - reg: - maxItems: 1 - "#phy-cells": const: 1 required: - compatible - - reg - "#phy-cells" additionalProperties: false examples: - | - mpphy: phy@0 { + mpphy: phy { compatible = "amlogic,axg-mipi-pcie-analog-phy"; - reg = <0x0 0xc>; #phy-cells = <1>; }; From patchwork Mon Nov 16 10:16:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11907939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A844C4742C for ; Mon, 16 Nov 2020 10:17:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15C0B20888 for ; Mon, 16 Nov 2020 10:17:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ol/fUwG/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="UjfmdbEm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15C0B20888 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n81Jlt9G9mUmEtT1pTc4MZkmvtqiVtNEJCSOtX2QNvU=; b=ol/fUwG/0S9ZpRLTSSd1093wz heUwWtqjZ0qod6eGN9b7qnwWskp9LAlPzXWnQrxoSq/A8zMDCL/jUm9h8Dm68hI247iNo+zJIcrLX KyitqOXR+NsJaAFge7AxEd44DMBaVqsQRcUgxfj5KS87M/vna0r0412afzwDpsCiIgY66vJY/ejxp aSwdFKJ9kzKi8HlbDJ/M3B++GnLoUr9embzRXd96ZXgJxUBz8DdZb21IHPzIhVkZiVUhjEsp/H7cm RAVkFiR7bJvvXnrtLbQZwsOrDlywYYNCJIvsqPigvB6FikPs4BOD59uKL7lWaaYDFDjDcOTjbruSu HOa4jh2Mw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kebZL-0000jw-A4; Mon, 16 Nov 2020 10:17:07 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kebZ8-0000fC-L0 for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 10:16:56 +0000 Received: by mail-wr1-x444.google.com with SMTP id u12so10828279wrt.0 for ; Mon, 16 Nov 2020 02:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3dYJtPTYT6zqSviFEoyuJVLQepwx0AVqn3LnihaWjaQ=; b=UjfmdbEmpKOGnekOBK+J4IyAP5SU0GKIh56iaq5I7d8+xqH8/n/xdP2pWWQctUzZAv KqSFRsa7izEvgDeYvHyUZKPmGVRvSGVMiBKkJvFtudnKQA9T2W45KyCEgSW6OsDtjQ/6 RP9/Vc+ddEetdn6LT0JpdG6xzlcSdY3P6mzIXTQAEiklRRDK/BEeazudt016zL7F9Wpm bVCaA80+/VVP5CA9Y6h33zoIpDWNwyXu8fMw/eTrzKFilFTwyIibmLk/zrAKip3fXAm0 QqmuF61H0jRFF14ALdsb2wOjjsgOYzhMLNBbhWEVWc5GemC61ioM3dDWi6TZkoer8l0J ZTiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3dYJtPTYT6zqSviFEoyuJVLQepwx0AVqn3LnihaWjaQ=; b=opBvMcQVBxJBYso9RJHl6lUewaR4f9M+TY6BMHqjTIBVOgerPGVXf3KOmt4x6UYzJZ WS8JvIpnSAa7luMklovTj5fJ5YJsZtIqaQc0SvV8TDqq3BdpFq6FbrOpz8Jsltc21kCd at0SlFIyjDlqJijFIaapFUQJHFjup7qQB/ElHozxofcvTmRGnflbihGqFs2RrXcmlq97 qbIxV7T7quUkB4Pyu7e3a8JKAIl9sm4EJB4QY2di/TKWqhmi2agtuO/kF6oynmDfL1tW AhXy9ydMMHEI47zlzZXQa2z6xEVAx2oMw5haNOjnubkZwXI7XHWoZOQpZVBvI8uZe2uj hqGQ== X-Gm-Message-State: AOAM531Ta51dCi6k+YUQGlJxEUvNMkj6DXSQGxJijUff0bxaoiu/wvig PDIbvLY92669QkFBcd8MN+8U1w== X-Google-Smtp-Source: ABdhPJyYONDEDIrJ1XvKWq53W8urXPyOX6Uj6h4HdNDHCqAdP91wFip1sBUTAHngykTJps8pKNkNmQ== X-Received: by 2002:a05:6000:10c9:: with SMTP id b9mr19540242wrx.251.1605521813480; Mon, 16 Nov 2020 02:16:53 -0800 (PST) Received: from localhost.localdomain ([2a01:e35:2ec0:82b0:edb9:72a:9e35:6eb]) by smtp.gmail.com with ESMTPSA id c17sm22265131wro.19.2020.11.16.02.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 02:16:52 -0800 (PST) From: Neil Armstrong To: kishon@ti.com, repk@triplefau.lt, devicetree@vger.kernel.org, vkoul@kernel.org Subject: [RESEND PATCH v3 2/3] dt-bindings: phy: amlogic, meson-axg-mipi-pcie-analog: remove phy cell parameter Date: Mon, 16 Nov 2020 11:16:46 +0100 Message-Id: <20201116101647.73448-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201116101647.73448-1-narmstrong@baylibre.com> References: <20201116101647.73448-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_051654_757509_D80AFB5A X-CRM114-Status: GOOD ( 14.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Amlogic AXG MIPI + PCIe Analog PHY provides function for both PCIe and MIPI DSI at the same time, and is not exclusive. Thus remove the invalid phy cell parameter. Signed-off-by: Neil Armstrong Acked-by: Rob Herring --- .../bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml b/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml index 702763a84dac..4d01f3124e1c 100644 --- a/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml +++ b/Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml @@ -24,7 +24,7 @@ properties: const: amlogic,axg-mipi-pcie-analog-phy "#phy-cells": - const: 1 + const: 0 required: - compatible @@ -36,5 +36,5 @@ examples: - | mpphy: phy { compatible = "amlogic,axg-mipi-pcie-analog-phy"; - #phy-cells = <1>; + #phy-cells = <0>; }; From patchwork Mon Nov 16 10:16:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11907947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58BAAC5519F for ; Mon, 16 Nov 2020 10:17:48 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCD6320B80 for ; Mon, 16 Nov 2020 10:17:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zTSsxzv1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="mBcrxZHq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCD6320B80 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KzKcjys3FUVQusiaxqUmqeyzh+uQz6tH3DO/WBR4hgA=; b=zTSsxzv181gE9zYyNjZRd3izG RnESfHsvx8C8Q26+8BqtsXg2kFp1UJjSBkLMTfSMnhQpya6FEmNmV2HQ8RouwTRLuLrobgO7S+zD4 ZNSmiTVkSEodhSFjtPjZ8yCW6cK8Ud5quL7TVSrQjH//O4qvgBqhgup+8wKEd/fzmwwbu80OTw3ih LLemusIu60eL7eszy5G+oKrfb57EffNvNroStYA/s4UllDPHKVce11GoOfx3+cVSJ6bW6jYNM2/9V ggmYTa40Q6lazoBBxuu5pFa3KjmJbSiE+dMSFvrqgiciEe1tpBJQ2gKISzAsqHKQorimrN7rrRqFs U90Dbg9TQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kebZS-0000mW-HI; Mon, 16 Nov 2020 10:17:14 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kebZA-0000gA-K8 for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 10:16:59 +0000 Received: by mail-wr1-x42d.google.com with SMTP id 23so18014478wrc.8 for ; Mon, 16 Nov 2020 02:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jqj+wd82SY1mEpUhzqHtNGeU29Us2O77ZilRz3fNJ3M=; b=mBcrxZHqzrVqiP8+Lkhkww3v1UytB3wXlBk1VdMRXuzXC/2SmgR9/bpvObG3xJRV9x lEUB7xQh0B3yOxPCCyHvxYbH0FJA4a/e/UBM4rNXlTXHXnOi4wwbGVuZlXqgI5azEKRB iVecSzVrlSD66rbcpBJEGDNSY/GV4XN+1ypYhI5JqaEyjeUwGkyqt0QXV/XJZdmuqr0N XnFPP/wD06fx77kquV9yqx5S6GMfS89SDrYW19WjY566VZ7QVulNg64Cncc/HGkaxA8E OdZUeVCTS/jLhOLz+tuflv+8uYrMnMY/nPvgFy1KljXrCVQZpJLJC7EjLlHebstGwQPp p00Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jqj+wd82SY1mEpUhzqHtNGeU29Us2O77ZilRz3fNJ3M=; b=TaQP8cH9aYFmkHrY8Cl/3i/SXvw6tKBcewu/vx8ilxNE8ZtCypA6+3NYULGtFK/lpA 8A2FKFoxEiry5//wuStJrEoRKz2dSCfndVL6zDgsRbq3GqBc9gXfGa0nyeI7Q+IHab4U w24cumTOEPEELbgsqjh+IJGSyqIwy1kC23j7qCNhCsVyoKQWQT6+nIHXauuYbprvsSk3 tZHICmsL8CC9BKGWx1aG8uQLZIcSwPB25OYrR6Kcr3nza5F/cDsr9Qg/1wrnI9vs91gW 299uGl9P+qVTEacQRra/xbFi0UhZlokPvMHkRU1vhgj0MyZdLCiVQgCneep47v00LLSo sWQw== X-Gm-Message-State: AOAM532yet07UM6sCqCUDse+U306NY7hrYWn4v566GJ7rTTG4Ph/2E+h C7aQRlUg+6ljhHv28FMoFEsdXg== X-Google-Smtp-Source: ABdhPJzzVYdy8A+ndHtt4ursjCxT4/wyXBcOB3iw2mPmXmx/6Abv7v3El+Hq0/2lY54xhByb+FlFVQ== X-Received: by 2002:adf:9163:: with SMTP id j90mr17650311wrj.323.1605521814940; Mon, 16 Nov 2020 02:16:54 -0800 (PST) Received: from localhost.localdomain ([2a01:e35:2ec0:82b0:edb9:72a:9e35:6eb]) by smtp.gmail.com with ESMTPSA id c17sm22265131wro.19.2020.11.16.02.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 02:16:54 -0800 (PST) From: Neil Armstrong To: devicetree@vger.kernel.org, vkoul@kernel.org Subject: [RESEND PATCH v3 3/3] phy: amlogic: phy-meson-axg-mipi-pcie-analog: add support for MIPI DSI analog Date: Mon, 16 Nov 2020 11:16:47 +0100 Message-Id: <20201116101647.73448-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201116101647.73448-1-narmstrong@baylibre.com> References: <20201116101647.73448-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_051656_776966_28EF4C56 X-CRM114-Status: GOOD ( 25.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Remi Pommarel , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The AXG Analog MIPI-DSI PHY also provides functions to the PCIe PHY, thus we need to have inclusive support for both interfaces at runtime. This fixes the regmap get from parent node, removes cell param to select a mode and implement runtime configuration & power on/off for both functions since they are not exclusive. Signed-off-by: Neil Armstrong Reviewed-by: Remi Pommarel --- drivers/phy/amlogic/Kconfig | 1 + .../amlogic/phy-meson-axg-mipi-pcie-analog.c | 204 ++++++++++++------ 2 files changed, 136 insertions(+), 69 deletions(-) diff --git a/drivers/phy/amlogic/Kconfig b/drivers/phy/amlogic/Kconfig index 99e8a4c7f1f3..db5d0cd757e3 100644 --- a/drivers/phy/amlogic/Kconfig +++ b/drivers/phy/amlogic/Kconfig @@ -66,6 +66,7 @@ config PHY_MESON_AXG_MIPI_PCIE_ANALOG depends on OF && (ARCH_MESON || COMPILE_TEST) select GENERIC_PHY select REGMAP_MMIO + select GENERIC_PHY_MIPI_DPHY help Enable this to support the Meson MIPI + PCIE analog PHY found in Meson AXG SoCs. diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c index 1431cbf885e1..6eb21551bdd9 100644 --- a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c +++ b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c @@ -4,9 +4,13 @@ * * Copyright (C) 2019 Remi Pommarel */ +#include +#include #include #include #include +#include +#include #include #include @@ -14,10 +18,10 @@ #define HHI_MIPI_CNTL0_COMMON_BLOCK GENMASK(31, 28) #define HHI_MIPI_CNTL0_ENABLE BIT(29) #define HHI_MIPI_CNTL0_BANDGAP BIT(26) -#define HHI_MIPI_CNTL0_DECODE_TO_RTERM GENMASK(15, 12) -#define HHI_MIPI_CNTL0_OUTPUT_EN BIT(3) +#define HHI_MIPI_CNTL0_DIF_REF_CTL1 GENMASK(25, 16) +#define HHI_MIPI_CNTL0_DIF_REF_CTL0 GENMASK(15, 0) -#define HHI_MIPI_CNTL1 0x01 +#define HHI_MIPI_CNTL1 0x04 #define HHI_MIPI_CNTL1_CH0_CML_PDR_EN BIT(12) #define HHI_MIPI_CNTL1_LP_ABILITY GENMASK(5, 4) #define HHI_MIPI_CNTL1_LP_RESISTER BIT(3) @@ -25,100 +29,170 @@ #define HHI_MIPI_CNTL1_INPUT_SEL BIT(1) #define HHI_MIPI_CNTL1_PRBS7_EN BIT(0) -#define HHI_MIPI_CNTL2 0x02 +#define HHI_MIPI_CNTL2 0x08 #define HHI_MIPI_CNTL2_CH_PU GENMASK(31, 25) #define HHI_MIPI_CNTL2_CH_CTL GENMASK(24, 19) #define HHI_MIPI_CNTL2_CH0_DIGDR_EN BIT(18) #define HHI_MIPI_CNTL2_CH_DIGDR_EN BIT(17) #define HHI_MIPI_CNTL2_LPULPS_EN BIT(16) -#define HHI_MIPI_CNTL2_CH_EN(n) BIT(15 - (n)) +#define HHI_MIPI_CNTL2_CH_EN GENMASK(15, 11) #define HHI_MIPI_CNTL2_CH0_LP_CTL GENMASK(10, 1) +#define DSI_LANE_0 (1 << 4) +#define DSI_LANE_1 (1 << 3) +#define DSI_LANE_CLK (1 << 2) +#define DSI_LANE_2 (1 << 1) +#define DSI_LANE_3 (1 << 0) +#define DSI_LANE_MASK (0x1F) + struct phy_axg_mipi_pcie_analog_priv { struct phy *phy; - unsigned int mode; struct regmap *regmap; + bool dsi_configured; + bool dsi_enabled; + bool powered; + struct phy_configure_opts_mipi_dphy config; }; -static const struct regmap_config phy_axg_mipi_pcie_analog_regmap_conf = { - .reg_bits = 8, - .val_bits = 32, - .reg_stride = 4, - .max_register = HHI_MIPI_CNTL2, -}; +static void phy_bandgap_enable(struct phy_axg_mipi_pcie_analog_priv *priv) +{ + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, + HHI_MIPI_CNTL0_BANDGAP, HHI_MIPI_CNTL0_BANDGAP); -static int phy_axg_mipi_pcie_analog_power_on(struct phy *phy) + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, + HHI_MIPI_CNTL0_ENABLE, HHI_MIPI_CNTL0_ENABLE); +} + +static void phy_bandgap_disable(struct phy_axg_mipi_pcie_analog_priv *priv) { - struct phy_axg_mipi_pcie_analog_priv *priv = phy_get_drvdata(phy); + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, + HHI_MIPI_CNTL0_BANDGAP, 0); + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, + HHI_MIPI_CNTL0_ENABLE, 0); +} - /* MIPI not supported yet */ - if (priv->mode != PHY_TYPE_PCIE) - return -EINVAL; +static void phy_dsi_analog_enable(struct phy_axg_mipi_pcie_analog_priv *priv) +{ + u32 reg; regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, - HHI_MIPI_CNTL0_BANDGAP, HHI_MIPI_CNTL0_BANDGAP); + HHI_MIPI_CNTL0_DIF_REF_CTL1, + FIELD_PREP(HHI_MIPI_CNTL0_DIF_REF_CTL1, 0x1b8)); + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, + BIT(31), BIT(31)); + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, + HHI_MIPI_CNTL0_DIF_REF_CTL0, + FIELD_PREP(HHI_MIPI_CNTL0_DIF_REF_CTL0, 0x8)); + + regmap_write(priv->regmap, HHI_MIPI_CNTL1, 0x001e); + + regmap_write(priv->regmap, HHI_MIPI_CNTL2, + (0x26e0 << 16) | (0x459 << 0)); + + reg = DSI_LANE_CLK; + switch (priv->config.lanes) { + case 4: + reg |= DSI_LANE_3; + fallthrough; + case 3: + reg |= DSI_LANE_2; + fallthrough; + case 2: + reg |= DSI_LANE_1; + fallthrough; + case 1: + reg |= DSI_LANE_0; + break; + default: + reg = 0; + } + + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL2, + HHI_MIPI_CNTL2_CH_EN, + FIELD_PREP(HHI_MIPI_CNTL2_CH_EN, reg)); + + priv->dsi_enabled = true; +} +static void phy_dsi_analog_disable(struct phy_axg_mipi_pcie_analog_priv *priv) +{ regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, - HHI_MIPI_CNTL0_ENABLE, HHI_MIPI_CNTL0_ENABLE); - return 0; + HHI_MIPI_CNTL0_DIF_REF_CTL1, + FIELD_PREP(HHI_MIPI_CNTL0_DIF_REF_CTL1, 0)); + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, BIT(31), 0); + regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, + HHI_MIPI_CNTL0_DIF_REF_CTL1, 0); + + regmap_write(priv->regmap, HHI_MIPI_CNTL1, 0x6); + + regmap_write(priv->regmap, HHI_MIPI_CNTL2, 0x00200000); + + priv->dsi_enabled = false; } -static int phy_axg_mipi_pcie_analog_power_off(struct phy *phy) +static int phy_axg_mipi_pcie_analog_configure(struct phy *phy, + union phy_configure_opts *opts) { struct phy_axg_mipi_pcie_analog_priv *priv = phy_get_drvdata(phy); + int ret; - /* MIPI not supported yet */ - if (priv->mode != PHY_TYPE_PCIE) - return -EINVAL; + ret = phy_mipi_dphy_config_validate(&opts->mipi_dphy); + if (ret) + return ret; + + memcpy(&priv->config, opts, sizeof(priv->config)); + + priv->dsi_configured = true; + + /* If PHY was already powered on, setup the DSI analog part */ + if (priv->powered) { + /* If reconfiguring, disable & reconfigure */ + if (priv->dsi_enabled) + phy_dsi_analog_disable(priv); + + usleep_range(100, 200); + + phy_dsi_analog_enable(priv); + } - regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, - HHI_MIPI_CNTL0_BANDGAP, 0); - regmap_update_bits(priv->regmap, HHI_MIPI_CNTL0, - HHI_MIPI_CNTL0_ENABLE, 0); return 0; } -static int phy_axg_mipi_pcie_analog_init(struct phy *phy) +static int phy_axg_mipi_pcie_analog_power_on(struct phy *phy) { + struct phy_axg_mipi_pcie_analog_priv *priv = phy_get_drvdata(phy); + + phy_bandgap_enable(priv); + + if (priv->dsi_configured) + phy_dsi_analog_enable(priv); + + priv->powered = true; + return 0; } -static int phy_axg_mipi_pcie_analog_exit(struct phy *phy) +static int phy_axg_mipi_pcie_analog_power_off(struct phy *phy) { + struct phy_axg_mipi_pcie_analog_priv *priv = phy_get_drvdata(phy); + + phy_bandgap_disable(priv); + + if (priv->dsi_enabled) + phy_dsi_analog_disable(priv); + + priv->powered = false; + return 0; } static const struct phy_ops phy_axg_mipi_pcie_analog_ops = { - .init = phy_axg_mipi_pcie_analog_init, - .exit = phy_axg_mipi_pcie_analog_exit, + .configure = phy_axg_mipi_pcie_analog_configure, .power_on = phy_axg_mipi_pcie_analog_power_on, .power_off = phy_axg_mipi_pcie_analog_power_off, .owner = THIS_MODULE, }; -static struct phy *phy_axg_mipi_pcie_analog_xlate(struct device *dev, - struct of_phandle_args *args) -{ - struct phy_axg_mipi_pcie_analog_priv *priv = dev_get_drvdata(dev); - unsigned int mode; - - if (args->args_count != 1) { - dev_err(dev, "invalid number of arguments\n"); - return ERR_PTR(-EINVAL); - } - - mode = args->args[0]; - - /* MIPI mode is not supported yet */ - if (mode != PHY_TYPE_PCIE) { - dev_err(dev, "invalid phy mode select argument\n"); - return ERR_PTR(-EINVAL); - } - - priv->mode = mode; - return priv->phy; -} - static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) { struct phy_provider *phy; @@ -126,27 +200,20 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) struct phy_axg_mipi_pcie_analog_priv *priv; struct device_node *np = dev->of_node; struct regmap *map; - struct resource *res; - void __iomem *base; int ret; priv = devm_kmalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(dev, res); - if (IS_ERR(base)) { - dev_err(dev, "failed to get regmap base\n"); - return PTR_ERR(base); - } - - map = devm_regmap_init_mmio(dev, base, - &phy_axg_mipi_pcie_analog_regmap_conf); + /* Get the hhi system controller node */ + map = syscon_node_to_regmap(of_get_parent(dev->of_node)); if (IS_ERR(map)) { - dev_err(dev, "failed to get HHI regmap\n"); + dev_err(dev, + "failed to get HHI regmap\n"); return PTR_ERR(map); } + priv->regmap = map; priv->phy = devm_phy_create(dev, np, &phy_axg_mipi_pcie_analog_ops); @@ -160,8 +227,7 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) phy_set_drvdata(priv->phy, priv); dev_set_drvdata(dev, priv); - phy = devm_of_phy_provider_register(dev, - phy_axg_mipi_pcie_analog_xlate); + phy = devm_of_phy_provider_register(dev, of_phy_simple_xlate); return PTR_ERR_OR_ZERO(phy); }