Message ID | 20231221083622.3445726-1-yuklin.soo@starfivetech.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-7999-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp269388dyi; Thu, 21 Dec 2023 00:37:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IH00xuaDWFh3tdJOFX5hpQ9+HuZIZR0BI0ElzEnXXpAVfKmsrgA4yS9CpvWgyyz+cYgPHch X-Received: by 2002:aa7:8706:0:b0:6d5:a679:e8f4 with SMTP id b6-20020aa78706000000b006d5a679e8f4mr4489839pfo.57.1703147841914; Thu, 21 Dec 2023 00:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703147841; cv=none; d=google.com; s=arc-20160816; b=jFq4EFJ2wzMaRTzw5TgQ3PjwOUCAjRttnTcjgdss0t+uKjgniQhk/50sArEnI8vQ7x m+mA2pjxI8oBgXtvC8rXDEhz1Tkm98pLsw/8va0teKGnZLmGmDnxxJNmWcuYFZs8IwSK ldWh6ENB+V7+EwztJUNijV1PsvbLMHEACSgtZavOZuhV5WUMqqDiNkWVD6vuDl7KKIb4 aCtrs7g4Gg4rB6J7v2k9i8Kks50nqGJlJO2ya8Q9xbChWTRH/+hGgZE7T1rIDKq62FCR imO47tC5nPVbaGX1OQrRqNEXVAg8UC0ppGBdf6U/S4SBKIwQTF84/zP6JLL19zHaw+UP tYhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=o90ArGB7/5PYeV1zoRZ6SjVwJz9+xvjFuMV1pEZdB6E=; fh=JV7pkkbAlx7PpzhlP6nWBnR441vif1KSXVfCHcY5pkA=; b=xN+pHJ/bHEgnI3VL9QpO+cwbGFWvE3AY4hp9Q9exEA6UZAAd4WDxGbpgA6w91HUv/r pN2BQdmV0Ku+sW8tfbeYFs0BqLGQfSqLBz+eR3caMzqnkcyDG/thyUynfSnZMEcpnQuj 0t1XDJRxiji1vug4xyPq3GgNMRnK44aF9A4yOa39/3TQRlBoxGVgmO/ClTPOroz8OlZJ 7zL8aN7R2wyDEizUV0CzU1a3ikWHT9Ew082F7TwE+H/cJsbSDpVKWLBNVu42VM+JU1oR sjmdRbe3/i3PwlBEX9FpKwc9JdYHtbY1GgOrMHnQIrPkV16frJj1vswCjwZ+vM3XmuyM bX2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7999-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7999-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z10-20020a056a001d8a00b006ce7f143603si1212826pfw.184.2023.12.21.00.37.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 00:37:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7999-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7999-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7999-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AD1EF285738 for <ouuuleilei@gmail.com>; Thu, 21 Dec 2023 08:37:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 300CF182D8; Thu, 21 Dec 2023 08:36:51 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5DD3171C4; Thu, 21 Dec 2023 08:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 53DC07FFE; Thu, 21 Dec 2023 16:36:32 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 21 Dec 2023 16:36:32 +0800 Received: from localhost.localdomain (202.188.176.82) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 21 Dec 2023 16:36:25 +0800 From: Alex Soo <yuklin.soo@starfivetech.com> To: Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Hal Feng <hal.feng@starfivetech.com>, "Ley Foon Tan" <leyfoon.tan@starfivetech.com>, Jianlong Huang <jianlong.huang@starfivetech.com>, Emil Renner Berthing <kernel@esmil.dk>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, "Drew Fustini" <drew@beagleboard.org> CC: <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-riscv@lists.infradead.org>, "Paul Walmsley" <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Alex Soo <yuklin.soo@starfivetech.com> Subject: [RFC PATCH 0/6] Add Pinctrl driver for Starfive JH8100 SoC Date: Thu, 21 Dec 2023 16:36:16 +0800 Message-ID: <20231221083622.3445726-1-yuklin.soo@starfivetech.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785879951537625176 X-GMAIL-MSGID: 1785879951537625176 |
Series |
Add Pinctrl driver for Starfive JH8100 SoC
|
|
Message
Alex Soo
Dec. 21, 2023, 8:36 a.m. UTC
Starfive JH8100 SoC consists of 4 pinctrl domains - sys_east, sys_west, sys_gmac, and aon. This patch series adds pinctrl drivers for these 4 pinctrl domains and this patch series is depending on the JH8100 base patch series in [1] and [2]. The relevant dt-binding documentation for each pinctrl domain has been updated accordingly. [1] https://lore.kernel.org/lkml/20231201121410.95298-1-jeeheng.sia@starfivetech.com/ [2] https://lore.kernel.org/lkml/20231206115000.295825-1-jeeheng.sia@starfivetech.com/ Alex Soo (6): dt-bindings: pinctrl: starfive: add JH8100 pinctrl bindings pinctrl: starfive: jh8100: add pinctrl driver for sys_east domain pinctrl: starfive: jh8100: add pinctrl driver for sys_west domain pinctrl: starfive: jh8100: add pinctrl driver for sys_gmac domain pinctrl: starfive: jh8100: add pinctrl driver for AON domain riscv: dts: starfive: jh8100: add pinctrl device tree nodes .../pinctrl/starfive,jh8100-aon-pinctrl.yaml | 183 +++ .../starfive,jh8100-sys-east-pinctrl.yaml | 188 +++ .../starfive,jh8100-sys-gmac-pinctrl.yaml | 124 ++ .../starfive,jh8100-sys-west-pinctrl.yaml | 188 +++ MAINTAINERS | 7 + arch/riscv/boot/dts/starfive/jh8100-evb.dts | 5 + arch/riscv/boot/dts/starfive/jh8100-pinfunc.h | 418 +++++++ arch/riscv/boot/dts/starfive/jh8100.dtsi | 44 + drivers/pinctrl/starfive/Kconfig | 57 + drivers/pinctrl/starfive/Makefile | 6 + .../starfive/pinctrl-starfive-jh8100-aon.c | 241 ++++ .../pinctrl-starfive-jh8100-sys-east.c | 326 +++++ .../pinctrl-starfive-jh8100-sys-gmac.c | 164 +++ .../pinctrl-starfive-jh8100-sys-west.c | 264 ++++ .../starfive/pinctrl-starfive-jh8100.c | 1090 +++++++++++++++++ .../starfive/pinctrl-starfive-jh8100.h | 85 ++ .../pinctrl/starfive,jh8100-pinctrl.h | 303 +++++ 17 files changed, 3693 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-aon-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-east-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-gmac-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/starfive,jh8100-sys-west-pinctrl.yaml create mode 100644 arch/riscv/boot/dts/starfive/jh8100-pinfunc.h create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-aon.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-east.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-gmac.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100-sys-west.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.c create mode 100644 drivers/pinctrl/starfive/pinctrl-starfive-jh8100.h create mode 100644 include/dt-bindings/pinctrl/starfive,jh8100-pinctrl.h base-commit: ddb42e41c0991b443dd6cc97213b478a7324d72b
Comments
On 21/12/2023 09:36, Alex Soo wrote: > Starfive JH8100 SoC consists of 4 pinctrl domains - sys_east, > sys_west, sys_gmac, and aon. This patch series adds pinctrl > drivers for these 4 pinctrl domains and this patch series is > depending on the JH8100 base patch series in [1] and [2]. > The relevant dt-binding documentation for each pinctrl domain has > been updated accordingly. Please explain why this is RFC. Every patch is RFC, so what is special about here? Usually this means work is not finished and should not be merged, neither reviewed. If you spelled out here the reasons, it would be easier for us to understand whether we should complain about broken and non-building code or not. Best regards, Krzysztof
Hi Alex, thanks for your patch! On Thu, Dec 21, 2023 at 9:36 AM Alex Soo <yuklin.soo@starfivetech.com> wrote: > pinctrl: starfive: jh8100: add pinctrl driver for sys_east domain > pinctrl: starfive: jh8100: add pinctrl driver for sys_west domain > pinctrl: starfive: jh8100: add pinctrl driver for sys_gmac domain > pinctrl: starfive: jh8100: add pinctrl driver for AON domain To my eye it looks like a lot of code is duplicated between the four subdrivers. The pattern from other pin controllers is to create a file with all the common code and then subdrivers for each sub-pincontroller that have their own probe but calls into the library. C.f. drivers/pinctrl/qcom/pinctrl-apq8064.c: static int apq8064_pinctrl_probe(struct platform_device *pdev) { return msm_pinctrl_probe(pdev, &apq8064_pinctrl); } And that function is in drivers/pinctrl/qcom/pinctrl-msm.c and you find great inspiration in the qcom Kconfig and Makefile and drivers/pinctrl/qcom/pinctrl-msm.h that you can copypaste to pull this off. Maybe you should start with a patch that extract the common stuff from the existing jh7100/jh7110 drivers and then reuse that for jh8100? Yours, Linus Walleij
> -----Original Message----- > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > Sent: Friday, December 22, 2023 12:20 AM > To: Yuklin Soo <yuklin.soo@starfivetech.com>; Linus Walleij > <linus.walleij@linaro.org>; Bartosz Golaszewski > <bartosz.golaszewski@linaro.org>; Hal Feng <hal.feng@starfivetech.com>; > Leyfoon Tan <leyfoon.tan@starfivetech.com>; Jianlong Huang > <jianlong.huang@starfivetech.com>; Emil Renner Berthing > <kernel@esmil.dk>; Rob Herring <robh@kernel.org>; Krzysztof Kozlowski > <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley <conor+dt@kernel.org>; > Drew Fustini <drew@beagleboard.org> > Cc: linux-gpio@vger.kernel.org; linux-kernel@vger.kernel.org; > devicetree@vger.kernel.org; linux-riscv@lists.infradead.org; Paul Walmsley > <paul.walmsley@sifive.com>; Palmer Dabbelt <palmer@dabbelt.com>; > Albert Ou <aou@eecs.berkeley.edu> > Subject: Re: [RFC PATCH 0/6] Add Pinctrl driver for Starfive JH8100 SoC > > On 21/12/2023 09:36, Alex Soo wrote: > > Starfive JH8100 SoC consists of 4 pinctrl domains - sys_east, > > sys_west, sys_gmac, and aon. This patch series adds pinctrl drivers > > for these 4 pinctrl domains and this patch series is depending on the > > JH8100 base patch series in [1] and [2]. > > The relevant dt-binding documentation for each pinctrl domain has been > > updated accordingly. > > Please explain why this is RFC. Every patch is RFC, so what is special about > here? Usually this means work is not finished and should not be merged, > neither reviewed. If you spelled out here the reasons, it would be easier for > us to understand whether we should complain about broken and non- > building code or not. This JH8100 SoC pinctrl patch is dependent on the following: - Initial device tree support and dt-bindings for JH8100 SoC https://lore.kernel.org/lkml/20231214-platonic-unhearing-27e2ec3d8f75@spud/ - Clock & Reset Support for JH8100 SoC https://lore.kernel.org/lkml/20231206115000.295825-1-jeeheng.sia@starfivetech.com/ Refer to the first link, there is maintainer feedback that if our evaluation platform is FPGA-based (since actual silicon is still unavailable), they are not keen on merging the patches, and things like pinctrl or clock drivers should first be submitted as “not to be merged”, in other words, as RFC patches. > > Best regards, > Krzysztof
> -----Original Message----- > From: Linus Walleij <linus.walleij@linaro.org> > Sent: Saturday, December 23, 2023 1:59 AM > To: Yuklin Soo <yuklin.soo@starfivetech.com> > Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>; Hal Feng > <hal.feng@starfivetech.com>; Leyfoon Tan <leyfoon.tan@starfivetech.com>; > Jianlong Huang <jianlong.huang@starfivetech.com>; Emil Renner Berthing > <kernel@esmil.dk>; Rob Herring <robh@kernel.org>; Krzysztof Kozlowski > <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley <conor+dt@kernel.org>; > Drew Fustini <drew@beagleboard.org>; linux-gpio@vger.kernel.org; linux- > kernel@vger.kernel.org; devicetree@vger.kernel.org; linux- > riscv@lists.infradead.org; Paul Walmsley <paul.walmsley@sifive.com>; > Palmer Dabbelt <palmer@dabbelt.com>; Albert Ou > <aou@eecs.berkeley.edu> > Subject: Re: [RFC PATCH 0/6] Add Pinctrl driver for Starfive JH8100 SoC > > Hi Alex, > > thanks for your patch! > > On Thu, Dec 21, 2023 at 9:36 AM Alex Soo <yuklin.soo@starfivetech.com> > wrote: > > > pinctrl: starfive: jh8100: add pinctrl driver for sys_east domain > > pinctrl: starfive: jh8100: add pinctrl driver for sys_west domain > > pinctrl: starfive: jh8100: add pinctrl driver for sys_gmac domain > > pinctrl: starfive: jh8100: add pinctrl driver for AON domain > > To my eye it looks like a lot of code is duplicated between the four subdrivers. > > The pattern from other pin controllers is to create a file with all the common > code and then subdrivers for each sub-pincontroller that have their own > probe but calls into the library. > > C.f. > drivers/pinctrl/qcom/pinctrl-apq8064.c: > > static int apq8064_pinctrl_probe(struct platform_device *pdev) { > return msm_pinctrl_probe(pdev, &apq8064_pinctrl); } > > And that function is in drivers/pinctrl/qcom/pinctrl-msm.c > and you find great inspiration in the qcom Kconfig and Makefile and > drivers/pinctrl/qcom/pinctrl-msm.h > that you can copypaste to pull this off. > > Maybe you should start with a patch that extract the common stuff from the > existing jh7100/jh7110 drivers and then reuse that for jh8100? The duplicated codes in the subdrivers have been moved to the main driver. The subdrivers will call those functions from the main driver. The test results are successful and will submit in the next version for review. > > Yours, > Linus Walleij