From patchwork Tue Nov 28 06:11:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 170557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3710698vqx; Mon, 27 Nov 2023 22:11:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOWLfroy28PDfimGjqoL0cGJbvlnqHkKb4dYAEL6UwkTJdCZhO9PSFtA85rYR7COjOqQTK X-Received: by 2002:a05:6a20:258c:b0:187:9521:92b9 with SMTP id k12-20020a056a20258c00b00187952192b9mr12174453pzd.53.1701151912077; Mon, 27 Nov 2023 22:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701151912; cv=none; d=google.com; s=arc-20160816; b=d5Us5oMU42Q7Xum/K8HYnm05wurmOt8NV9EvwdiQr6ylK9RjnUdi/dLx+ku/7XwmDc pMSYype0u0CvCLl/V6CHaiPWyZTpAKDkD8ZNQek4Peg8m0bDEsyQJ52m6fvMQuhmAdwQ hXLZyaR5rbXudf1vJ+iFY9vJK4LQuyrDpoUy/VC/MOMf6kQynn0yc5STJ6WRn2Lfv2LI caxWg38DT6s5Fce5WQfNkPYnCA0f0LZZUq0XqLDEmB/bZN6ql5KpnwxyzSw5wiimMxpM wnHrF6lfNy6eag2mlJ8ZX+FmsCe3xOdisGgjyxOmPK3/eP7T8tMkjfVZ3o/KKJOpsXpd zf+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pRa17WZLUC24HKUHdpci3trSEQpdoaDeITWDqryGqws=; fh=tgUrbkNhf6DIZqZzkpsgQ15JawBXa6kDAtx2UnddeWA=; b=Qoi/f0jYMkiYfKB2aBNKvntPtnXwu520ttq1dqnxUsEq8L89DlebCRWdwhdXTQsSi8 GNfwcE8+h32oCSS0RsCYMYlOyWXsEmFZsyCLkvP4j42spxe3nTZm3ENCwZ1Di6MsREpF BROpCeSUXHN+b+N2h6ZW/ouBYwbQhSSIv69wLIALeOFv8RGcCajaPHXr4lfJC8YecSE9 9E/Huc0zXn8qbsQHjyyeBvmxKOHehy2ajeBWwrO0J1/wN7NBo8aUEFFS30MT8aajERg5 tgnobB/fFclID+4TW8fgQxspx/z6PajbKGdmg6iif6c9RNxegKdREYBtF3+6W2aB0YtG G/YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=l7ZhPC+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id iz13-20020a170902ef8d00b001ca96a6eefesi11145347plb.577.2023.11.27.22.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 22:11:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=l7ZhPC+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 716CB805FD7D; Mon, 27 Nov 2023 22:11:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343659AbjK1GLi (ORCPT + 99 others); Tue, 28 Nov 2023 01:11:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343645AbjK1GLa (ORCPT ); Tue, 28 Nov 2023 01:11:30 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32FDD6D; Mon, 27 Nov 2023 22:11:34 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1cfc985c92dso16924065ad.0; Mon, 27 Nov 2023 22:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701151894; x=1701756694; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pRa17WZLUC24HKUHdpci3trSEQpdoaDeITWDqryGqws=; b=l7ZhPC+xFQVqGlJNJGgpQfLz+IliTfFEF0h+aBdAT1RAzfCz5/O6buoMhyONx//UZF HmYYM83iP8ORzfmXheYumb6N5aZFMxPF0lM7n5o8PT1AGSPWjsZx4cziDu1WmUDZz852 nwIqnR0WRcDyfeRkyYapgvWBf29qLUEncKsD4p3cM1F4d48ZoDPVia8xZVYSiw+guqjv 78PWdMrdRNXbHvTccB4UbJ14cWqoHPCXGQ3KOvqlaacpkxMT2UvmShvKitMPCuE4qaF6 HLx9z753iIEnHBZGI5g6A8S1spP5yctaTLgCB9NX8bnMTOU3WuBtoqo2v0VIPffHgunu RkkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701151894; x=1701756694; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRa17WZLUC24HKUHdpci3trSEQpdoaDeITWDqryGqws=; b=uEoCHBgg/UZyyr7oWeHLF9QXsHZqZdQHwlsAlXsFPLgSIU+YGrZo/9jtUihUkSYtMz yjbxtP20Ws9Qs4yx+Xmqex76dQd63Ws7INBI+S0oRJo3klfKPd50O5uk0QYOSEDEWq05 PJjgOlMDFKaiZpj9pf1y9J4EHcp/rUsiZh+ml4u3eViFTL0pF8I5cwghTKwJmCNxdnjK Uk0RhwYMknSuzsdzxjyJkR+lkJduIueqpITpbZoPm9II7+D+wRy4fRCPbZeHnYL0GYMg wm1nfM8oiETqZcZKxlbArN5x5KuwRvoEdHbqhFSJNtqq8VT3pNMKdFj1g7l35wczX2Su hIYg== X-Gm-Message-State: AOJu0YwT0iVaeGtSFQXF43u2PdPa2bdD3tK0d8w+WL0JewKruXNeuMF2 ML5Uq/EUJMfRr8qfKAL+10REM14f67A= X-Received: by 2002:a17:902:d2c5:b0:1cf:cd73:557 with SMTP id n5-20020a170902d2c500b001cfcd730557mr6221600plc.14.1701151894222; Mon, 27 Nov 2023 22:11:34 -0800 (PST) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id jj14-20020a170903048e00b001c73f3a9b7fsm9402694plb.185.2023.11.27.22.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 22:11:33 -0800 (PST) From: Jacky Huang To: 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, ychuang3@nuvoton.com, schung@nuvoton.com Subject: [PATCH v2 3/4] arm64: dts: nuvoton: Add pinctrl support for ma35d1 Date: Tue, 28 Nov 2023 06:11:17 +0000 Message-Id: <20231128061118.575847-4-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231128061118.575847-1-ychuang570808@gmail.com> References: <20231128061118.575847-1-ychuang570808@gmail.com> MIME-Version: 1.0 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 27 Nov 2023 22:11:48 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783787067245752619 X-GMAIL-MSGID: 1783787067245752619 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 | 70 +++++++- .../boot/dts/nuvoton/ma35d1-som-256m.dts | 73 +++++++- arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 159 +++++++++++++++++- 3 files changed, 293 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..74a85c23c26b 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,65 @@ &clk { "integer", "integer"; }; + +&pinctrl { + uart-grp { + pinctrl_uart0: uart0-pins { + nuvoton,pins = <4 14 1 &pcfg_default>, + <4 15 1 &pcfg_default>; + }; + + pinctrl_uart10: uart10-pins { + nuvoton,pins = <7 4 2 &pcfg_default>, + <7 5 2 &pcfg_default>, + <7 6 2 &pcfg_default>, + <7 7 2 &pcfg_default>; + }; + + pinctrl_uart12: uart12-pins { + nuvoton,pins = <2 13 2 &pcfg_default>, + <2 14 2 &pcfg_default>, + <2 15 2 &pcfg_default>; + }; + + pinctrl_uart13: uart13-pins { + nuvoton,pins = <7 12 3 &pcfg_default>, + <7 13 3 &pcfg_default>; + }; + + pinctrl_uart14: uart14-pins { + nuvoton,pins = <7 14 2 &pcfg_default>, + <7 15 2 &pcfg_default>; + }; + }; +}; + +&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..2cd11e2b2067 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,68 @@ &clk { "integer", "integer"; }; + +&pinctrl { + uart-grp { + pinctrl_uart0: uart0-pins { + nuvoton,pins = <4 14 1 &pcfg_default>, + <4 15 1 &pcfg_default>; + }; + + pinctrl_uart11: uart11-pins { + nuvoton,pins = <11 0 2 &pcfg_default>, + <11 1 2 &pcfg_default>, + <11 2 2 &pcfg_default>, + <11 3 2 &pcfg_default>; + }; + + pinctrl_uart12: uart12-pins { + nuvoton,pins = <8 1 2 &pcfg_default>, + <8 2 2 &pcfg_default>, + <8 3 2 &pcfg_default>; + }; + + pinctrl_uart14: uart14-pins { + nuvoton,pins = <8 5 2 &pcfg_default>, + <8 6 2 &pcfg_default>, + <8 7 2 &pcfg_default>; + }; + + pinctrl_uart16: uart16-pins { + nuvoton,pins = <10 0 2 &pcfg_default>, + <10 1 2 &pcfg_default>, + <10 2 2 &pcfg_default>, + <10 3 2 &pcfg_default>; + }; + }; +}; + +&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..a93bce545f5f 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,162 @@ 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: gpio@40040000 { + reg = <0x0 0x40>; + interrupts = ; + clocks = <&clk GPA_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpiob: gpio@40040040 { + reg = <0x40 0x40>; + interrupts = ; + clocks = <&clk GPB_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpioc: gpio@40040080 { + reg = <0x80 0x40>; + interrupts = ; + clocks = <&clk GPC_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpiod: gpio@400400c0 { + reg = <0xc0 0x40>; + interrupts = ; + clocks = <&clk GPD_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpioe: gpio@40040100 { + reg = <0x100 0x40>; + interrupts = ; + clocks = <&clk GPE_GATE>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpiof: gpio@40040140 { + reg = <0x140 0x40>; + interrupts = ; + clocks = <&clk GPF_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpiog: gpio@40040180 { + reg = <0x180 0x40>; + interrupts = ; + clocks = <&clk GPG_GATE>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpioh: gpio@400401c0 { + reg = <0x1c0 0x40>; + interrupts = ; + clocks = <&clk GPH_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpioi: gpio@40040200 { + reg = <0x200 0x40>; + interrupts = ; + clocks = <&clk GPI_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpioj: gpio@40040240 { + reg = <0x240 0x40>; + interrupts = ; + clocks = <&clk GPJ_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpiok: gpio@40040280 { + reg = <0x280 0x40>; + interrupts = ; + clocks = <&clk GPK_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpiol: gpio@400402c0 { + reg = <0x2c0 0x40>; + interrupts = ; + clocks = <&clk GPL_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpiom: gpio@40040300 { + reg = <0x300 0x40>; + interrupts = ; + clocks = <&clk GPM_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpion: gpio@40040340 { + reg = <0x340 0x40>; + interrupts = ; + clocks = <&clk GPN_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + pcfg_default: pin-default { + slew-rate = <0>; + input-schmitt-disable; + bias-disable; + power-source = <1>; + drive-strength = <17100>; + }; + }; + uart0: serial@40700000 { compatible = "nuvoton,ma35d1-uart"; reg = <0x0 0x40700000 0x0 0x100>;