Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp771689rdg; Thu, 12 Oct 2023 23:52:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlBhNT7smyeIDAmdSi/cSCytt8VIY/+1CjYQLE4y6ZYqzqyFN9LDAwG9tgIqpr0LyYwCsG X-Received: by 2002:a17:902:c40d:b0:1c5:de06:9e5a with SMTP id k13-20020a170902c40d00b001c5de069e5amr26457305plk.21.1697179956321; Thu, 12 Oct 2023 23:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697179956; cv=none; d=google.com; s=arc-20160816; b=Pm6MVM0rBH8XVGguWnYqxyujo5jgQB2HVM6nYPDuB3ji3AQXYc8mjcNYUX3ItotZ0p eqnnjjb8M6/J//pQwuamiqhtDRuA3kyI2Q+b+Bur8QC/LS9fAh22QqJ7o18zPNScnLzz vr6adWt7UTZjJhEJRwJhxZQX+ueSwqiNgNhGqIA+Kb01xo8UXn82ts3E1yv6xlLVNG08 D22dDST0w8BoBOgDdztbaHPv/c1pVLkYN/rOKuLzj2z77RXK6psOqDXJokSw9FZKWz5t lCY7LpiEjbRou2zg2nw+74pcKTFHA4J6czNBIkSKhbAnSO3Hke8NwQpSmjNE1P9YZPXf hQkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=khoBcCaNwITaZpOQpB7D85N+chp7AHYJYcUZPAYhZ1I=; fh=splLyuXRargpeSW6ln3J792o7l1cicMOcXxUF5TSJ4U=; b=dYiRC/3F2nH03TKc/bfJElryIVhk93sKJcaOZ4RaTIVdCbewinV3bJkBn0XOFJU5Tq KGpCHs3uvYFj0NVTEuDTZdjTUOnhKI5T1b2zOgV0gNqe2Lpdxcqqg43GohhQtKiRkMOT EmKqZkiXQrhoajvJinSy/wRytmW1Iub9tdv9Mj7YqBVuIu9tukp8bSaT1JWbvDwn2mnC tdRgkSWNMKedOdjC64KwuA84RE4lGMeXuKR12nl+p2dQmRX8Ovxm3lb0+ZleEZemzzaD Z/UYCNCuog1aepCda3NaGn0i4wcEZpMumBQnV/B1fJBn4va6N+OeF4og5YRs2RkDjfzX X1QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="FzbFC/mn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id r11-20020a170902be0b00b001c73626a1ffsi3665694pls.412.2023.10.12.23.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 23:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="FzbFC/mn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 44FF581ADD7E; Thu, 12 Oct 2023 23:52:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229804AbjJMGwW (ORCPT + 99 others); Fri, 13 Oct 2023 02:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjJMGwU (ORCPT ); Fri, 13 Oct 2023 02:52:20 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044E091; Thu, 12 Oct 2023 23:52:18 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1c5c91bec75so13851285ad.3; Thu, 12 Oct 2023 23:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697179937; x=1697784737; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=khoBcCaNwITaZpOQpB7D85N+chp7AHYJYcUZPAYhZ1I=; b=FzbFC/mnUdiykOJhpBrw3HQLKLvPSW1yXVGMVo+t8TeF9Iom0Bn3b0a+RDs+80Bmcb BaGS2qY5HH5PPTaOV+EHDvlv6fxM8d1XC/iAhn/+zAlbd2mYzqgxZI8mj/vWU1H+S5i9 zIo0x1Z8sA3PTmoEJzQMhZrFLAgx7FrYwII27ThnNIqWvLWzhb5G9WPZjgrETNTBHUWL R8t4WdqI4sn9sESGQTCfHN4nVV/FPKUc77TcU09WE2gtucGzt0TmSr4qPAElW/4JxY/f pNs63Pm5inWkbVCOting0GBnwLCzd+A4FZbcr7H7JZzlwUp/Psa5fsaslMIlExNqCKOx zh/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697179937; x=1697784737; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=khoBcCaNwITaZpOQpB7D85N+chp7AHYJYcUZPAYhZ1I=; b=dbq33dEbCMbboY4FqxDVN42BP5F+lch/aj0PMY0OOegD2vPl9UnFU2jle/j2F+x+lV vlq44BPWThdHfx0mjXG9ubSHJf4H129QhlfcEdorBOghvwyyN/3piCmFoS3NJ0wkR78C Qh3W1yAhW1CVVORVN5Oz0gsdvQ/vwWuNUKBTarCc4joMCBBzxw+7QkdRmMY41IHdt+18 ww1u4GSRANoiOJ7Sw7k51bgeUZPXYudnlrkYPpMhIzYsDV9ud6N3u8ZmkcdbZt7jM+KF zbrC05dODGKOL8FJNKimfKrvBr1WD6ax35PxXqFyeoDeeVVh3WYbTU8k3yVtQaTjS5bv 1mEA== X-Gm-Message-State: AOJu0YzmAkfhLtSnVVlp/iy60wk3/EZdBEfpxi8NmUF/tYWeiSo+Dl+G IUodXVWV0S46Z+hT+58nfC4= X-Received: by 2002:a17:902:fa8f:b0:1c9:d948:33d5 with SMTP id lc15-20020a170902fa8f00b001c9d94833d5mr4406141plb.64.1697179937299; Thu, 12 Oct 2023 23:52:17 -0700 (PDT) Received: from [172.19.1.47] (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id f9-20020a170902ce8900b001c76fcccee8sm3070210plg.156.2023.10.12.23.52.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Oct 2023 23:52:16 -0700 (PDT) Message-ID: <507e491a-e40f-47e2-8e11-5a7886a8c2ab@gmail.com> Date: Fri, 13 Oct 2023 14:52:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/4] arm64: dts: nuvoton: Add pinctrl support for ma35d1 Content-Language: en-US To: Krzysztof Kozlowski , linus.walleij@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, j.neuschaefer@gmx.net Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, schung@nuvoton.com, Jacky Huang References: <20231011090510.114476-1-ychuang570808@gmail.com> <20231011090510.114476-4-ychuang570808@gmail.com> <9a831a6e-ab5e-4911-8011-f6eb82dd3d6a@linaro.org> From: Jacky Huang In-Reply-To: <9a831a6e-ab5e-4911-8011-f6eb82dd3d6a@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 12 Oct 2023 23:52:32 -0700 (PDT) Dear Krzysztof, Thank you for the review. On 2023/10/13 上午 03:46, Krzysztof Kozlowski wrote: > On 11/10/2023 11:05, Jacky Huang wrote: >> From: Jacky Huang >> >> Add 'pinctrl' node and 'gpioa' ~ 'gpion' nodes to the dtsi of ma35d1 >> SoC and describe default pin configurations. >> >> Enable all UART nodes presented on som and iot boards, and add pinctrl >> function settings to these nodes. >> >> Signed-off-by: Jacky Huang >> --- >> .../boot/dts/nuvoton/ma35d1-iot-512m.dts | 83 ++++++++- >> .../boot/dts/nuvoton/ma35d1-som-256m.dts | 86 ++++++++- >> arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 175 +++++++++++++++++- >> 3 files changed, 335 insertions(+), 9 deletions(-) >> >> diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts b/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts >> index b89e2be6abae..ff0d2bf8f5bf 100644 >> --- a/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts >> +++ b/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts >> @@ -14,6 +14,10 @@ / { >> >> aliases { >> serial0 = &uart0; >> + serial10 = &uart10; >> + serial12 = &uart12; >> + serial13 = &uart13; >> + serial14 = &uart14; >> }; >> >> chosen { >> @@ -33,10 +37,6 @@ clk_hxt: clock-hxt { >> }; >> }; >> >> -&uart0 { >> - status = "okay"; >> -}; >> - >> &clk { >> assigned-clocks = <&clk CAPLL>, >> <&clk DDRPLL>, >> @@ -54,3 +54,78 @@ &clk { >> "integer", >> "integer"; >> }; >> + >> +&pinctrl { >> + uart0 { >> + pinctrl_uart0: uart0grp { >> + nuvoton,pins = >> + , >> + ; >> + }; >> + }; >> + >> + uart10 { >> + pinctrl_uart10: uart10grp { >> + nuvoton,pins = >> + , >> + , >> + , >> + ; >> + }; >> + }; >> + >> + uart12 { >> + pinctrl_uart12: uart12grp { >> + nuvoton,pins = >> + , >> + , >> + ; >> + }; >> + }; >> + >> + uart13 { >> + pinctrl_uart13: uart13grp { >> + nuvoton,pins = >> + , >> + ; >> + }; >> + }; >> + >> + uart14 { >> + pinctrl_uart14: uart14grp { >> + nuvoton,pins = >> + , >> + ; >> + }; >> + }; >> +}; >> + >> +&uart0 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart0>; >> + status = "okay"; >> +}; >> + >> +&uart10 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart10>; >> + status = "okay"; >> +}; >> + >> +&uart12 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart12>; >> + status = "okay"; >> +}; >> + >> +&uart13 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart13>; >> + status = "okay"; >> +}; >> + >> +&uart14 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart14>; >> + status = "okay"; >> +}; >> diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts b/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts >> index a1ebddecb7f8..c8c26f37116b 100644 >> --- a/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts >> +++ b/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts >> @@ -14,6 +14,10 @@ / { >> >> aliases { >> serial0 = &uart0; >> + serial11 = &uart11; >> + serial12 = &uart12; >> + serial14 = &uart14; >> + serial16 = &uart16; >> }; >> >> chosen { >> @@ -33,10 +37,6 @@ clk_hxt: clock-hxt { >> }; >> }; >> >> -&uart0 { >> - status = "okay"; >> -}; >> - >> &clk { >> assigned-clocks = <&clk CAPLL>, >> <&clk DDRPLL>, >> @@ -54,3 +54,81 @@ &clk { >> "integer", >> "integer"; >> }; >> + >> +&pinctrl { >> + uart0 { >> + pinctrl_uart0: uart0grp { >> + nuvoton,pins = >> + , >> + ; > This does not look like generic pinctrl bindings. Looks > over-complicated. From where did you get it? Which recent bindings and > drivers where used as an example? Register addresses should be in the > driver. Bit offsets as well. "multi-pin-function-value" confuses me. All > this is not really suitable for DTS. Okay, I will update the first and second items to 'pin bank' and 'pin bank index, just as others have done, and leave the driver to handle the conversion into registers and offsets. The term "multi-pin-function-value" is used to specify the device function. I will use the name "device function" instead of "multi-pin-function-value. >> + }; >> + }; >> + >> + uart11 { >> + pinctrl_uart11: uart11grp { >> + nuvoton,pins = >> + , >> + , >> + , >> + ; >> + }; >> + }; >> + >> + uart12 { >> + pinctrl_uart12: uart12grp { >> + nuvoton,pins = >> + , >> + , >> + ; >> + }; >> + }; >> + >> + uart14 { >> + pinctrl_uart14: uart14grp { >> + nuvoton,pins = >> + , >> + , >> + ; >> + }; >> + }; >> + >> + uart16 { >> + pinctrl_uart16: uart16grp { >> + nuvoton,pins = >> + , >> + , >> + , >> + ; >> + }; >> + }; >> +}; >> + >> +&uart0 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart0>; >> + status = "okay"; >> +}; >> + >> +&uart11 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart11>; >> + status = "okay"; >> +}; >> + >> +&uart12 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart12>; >> + status = "okay"; >> +}; >> + >> +&uart14 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart14>; >> + status = "okay"; >> +}; >> + >> +&uart16 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_uart16>; >> + status = "okay"; >> +}; >> diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi b/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi >> index 781cdae566a0..85431a074ab2 100644 >> --- a/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi >> +++ b/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi >> @@ -10,6 +10,7 @@ >> #include >> #include >> #include >> +#include >> >> / { >> compatible = "nuvoton,ma35d1"; >> @@ -83,7 +84,7 @@ soc { >> ranges; >> >> sys: system-management@40460000 { >> - compatible = "nuvoton,ma35d1-reset"; >> + compatible = "nuvoton,ma35d1-reset", "syscon"; >> reg = <0x0 0x40460000 0x0 0x200>; >> #reset-cells = <1>; >> }; >> @@ -95,6 +96,178 @@ clk: clock-controller@40460200 { >> clocks = <&clk_hxt>; >> }; >> >> + pinctrl: pinctrl@40040000 { >> + compatible = "nuvoton,ma35d1-pinctrl"; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + nuvoton,sys = <&sys>; >> + ranges = <0x0 0x0 0x40040000 0xc00>; >> + >> + gpioa: gpioa@40040000 { >> + reg = <0x0 0x40>; >> + interrupts = ; >> + clocks = <&clk GPA_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpiob: gpiob@40040040 { >> + reg = <0x40 0x40>; >> + interrupts = ; >> + clocks = <&clk GPB_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpioc: gpioc@40040080 { >> + reg = <0x80 0x40>; >> + interrupts = ; >> + clocks = <&clk GPC_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpiod: gpiod@400400c0 { >> + reg = <0xc0 0x40>; >> + interrupts = ; >> + clocks = <&clk GPD_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpioe: gpioe@40040100 { >> + reg = <0x100 0x40>; >> + interrupts = ; >> + clocks = <&clk GPE_GATE>; >> + #gpio-cells = <2>; >> + gpio-controller; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpiof: gpiof@40040140 { >> + reg = <0x140 0x40>; >> + interrupts = ; >> + clocks = <&clk GPF_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpiog: gpiog@40040180 { >> + reg = <0x180 0x40>; >> + interrupts = ; >> + clocks = <&clk GPG_GATE>; >> + #gpio-cells = <2>; >> + gpio-controller; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpioh: gpioh@400401c0 { >> + reg = <0x1c0 0x40>; >> + interrupts = ; >> + clocks = <&clk GPH_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpioi: gpioi@40040200 { >> + reg = <0x200 0x40>; >> + interrupts = ; >> + clocks = <&clk GPI_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpioj: gpioj@40040240 { >> + reg = <0x240 0x40>; >> + interrupts = ; >> + clocks = <&clk GPJ_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpiok: gpiok@40040280 { >> + reg = <0x280 0x40>; >> + interrupts = ; >> + clocks = <&clk GPK_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpiol: gpiol@400402c0 { >> + reg = <0x2c0 0x40>; >> + interrupts = ; >> + clocks = <&clk GPL_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpiom: gpiom@40040300 { >> + reg = <0x300 0x40>; >> + interrupts = ; >> + clocks = <&clk GPM_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + gpion: gpion@40040340 { >> + reg = <0x340 0x40>; >> + interrupts = ; >> + clocks = <&clk GPN_GATE>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + interrupt-controller; >> + #interrupt-cells = <2>; >> + }; >> + >> + pcfg_default: pcfg-default { >> + slew-rate = <0>; >> + input-schmitt-disable; >> + bias-disable; >> + power-source = <3300>; >> + drive-strength = <0>; >> + }; >> + >> + pcfg_emac_3_3v: pcfg-emac-3.3v { > Drop, unused. > >> + slew-rate = <0>; >> + input-schmitt-enable; >> + bias-disable; >> + power-source = <3300>; >> + drive-strength = <1>; >> + }; >> + >> + pcfg_emac_1_8v: pcfg-emac-1.8v { > Drop, unused. Sure, I will drop these two nodes. >> + slew-rate = <0>; >> + input-schmitt-enable; >> + bias-disable; >> + power-source = <1800>; >> + drive-strength = <1>; >> + }; >> + }; >> + >> uart0: serial@40700000 { >> compatible = "nuvoton,ma35d1-uart"; >> reg = <0x0 0x40700000 0x0 0x100>; > Best regards, > Krzysztof > Best Regards, Jacky Huang