From patchwork Thu Sep 21 13:51:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 724967 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBF904D8E4 for ; Thu, 21 Sep 2023 18:11:31 +0000 (UTC) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D88CE663E3 for ; Thu, 21 Sep 2023 11:10:52 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-68c576d35feso1134208b3a.2 for ; Thu, 21 Sep 2023 11:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695319852; x=1695924652; 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=y1utggLI0BiGHlTHHR5/pvUEGIO1xYD0ZyabcazoGu4=; b=QBUH+XOO9TXMUZZituLd4ZPekUmLhJQKCeuCxqwXdMHZ2EdZW5ZY/hS+3jm73cYM2m qXB+wCvy5qUn7KOTQOUnIBd09UXn8DVBhEhBUQ7gfMfFXxgYQi6PZB4sf1A+fLVd2OLJ YSicNz597jH20rTmlRWVUlQ2EQ06sXJGC2zYPDPQdil2KJKPu9QA18gJekTOd0eg9LxO hVKz6cKSIFpDhgh74msPXPGqFC+yQwsdhuEAsyMumPPDuqCGeVAp4d/AGtRGd9dxWOdM tS8hagTal1k/rqSh49u0sv4uEBjX9Gcg+vOgMGREGmn5VxiS+664Qlk/9/n/QLh0GBNS PlBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695319852; x=1695924652; 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=y1utggLI0BiGHlTHHR5/pvUEGIO1xYD0ZyabcazoGu4=; b=gAii21spo1q2Xa9TRHMiUxTwgy6rZRUCHeAMmYwcvPbQfzlHjaTpi/paBFDS51Dzf/ kqsHfSwHtmcO4UnyKO7RKbhP/AaLhdijSAz2erN3jzEzdSKFiP1MQBh0GNi9HdI586yd Gg0o+V08Eub/97Z7Nmlv2e3cl8k5bawlbFR7em1jd1WY+W8zvq2fF3+YeSpXUXpqGX/I 5cbG/atNxEX4VJNnoTr9Oz66vO4Oqk96yoES4AnR4T0N++PAYWJY6NYOBfHrf441i2qY dA7AYiBDOLvyC9qjV0bz04IhfaSow5L5sKKuyfkECg7JK78val35S4g72T38XZQxIwdW +1lw== X-Gm-Message-State: AOJu0YzruqUQI1azyeMDhB00ia4WDwzUz8DfnSfKrK077BiN/AnwePFl WatgE8ne2Z6Gg20Ir/VzxFA4QxsoQT0= X-Google-Smtp-Source: AGHT+IEErlN0UsLsx7gN9nGZwWXOOBiY2PgXFRk34l0suHipPoBbKDD5ZjskrrWrghU3r2jMh6AqRg== X-Received: by 2002:a05:6871:687:b0:1d6:4b84:c7ed with SMTP id l7-20020a056871068700b001d64b84c7edmr4805468oao.23.1695304302615; Thu, 21 Sep 2023 06:51:42 -0700 (PDT) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id z19-20020a056870e15300b001d7034bc222sm547064oaa.15.2023.09.21.06.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 06:51:42 -0700 (PDT) From: Chris Morgan To: linux-sunxi@lists.linux.dev Cc: devicetree@vger.kernel.org, mripard@kernel.org, uwu@icenowy.me, samuel@sholland.org, jernej.skrabec@gmail.com, wens@csie.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, andre.przywara@arm.com, Chris Morgan Subject: [PATCH V5 1/4] arm: dts: sun8i: V3s: Add pinctrl for pwm Date: Thu, 21 Sep 2023 08:51:33 -0500 Message-Id: <20230921135136.97491-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230921135136.97491-1-macroalpha82@gmail.com> References: <20230921135136.97491-1-macroalpha82@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: Chris Morgan Add pinctrl nodes for pwm0 and pwm1. Signed-off-by: Chris Morgan Reviewed-by: Andre Przywara --- arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi index 3b9a282c2746..c87476ea31e2 100644 --- a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi @@ -414,6 +414,18 @@ mmc1_pins: mmc1-pins { bias-pull-up; }; + /omit-if-no-ref/ + pwm0_pin: pwm0-pin { + pins = "PB4"; + function = "pwm0"; + }; + + /omit-if-no-ref/ + pwm1_pin: pwm1-pin { + pins = "PB5"; + function = "pwm1"; + }; + spi0_pins: spi0-pins { pins = "PC0", "PC1", "PC2", "PC3"; function = "spi0"; From patchwork Thu Sep 21 13:51:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 724966 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B25C914F62 for ; Thu, 21 Sep 2023 18:16:35 +0000 (UTC) Received: from mail-ua1-x92f.google.com (mail-ua1-x92f.google.com [IPv6:2607:f8b0:4864:20::92f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7002DA545A for ; Thu, 21 Sep 2023 11:15:10 -0700 (PDT) Received: by mail-ua1-x92f.google.com with SMTP id a1e0cc1a2514c-7a52a1e2a59so531562241.0 for ; Thu, 21 Sep 2023 11:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695320109; x=1695924909; 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=YJN9aOtZgPglJqdvf2m10tLO0jbnaME/5vD8YEmqs0o=; b=B9dL+K86Xd7xIkqwDwr/ImzpB9UWSrmTpr7TEQDA5lPbRhGD/fMSNdDWnee/lvZLth LQcBM0QB1smE0XkvRY7yEDALpI1mxIYRAjSg5x68vaOefGm4aMJbj9jGTQXtramtwat/ vrdPR7SIQO2I00CB/762XYZUgm6OmtqFYfsNYfrQfUHVsXaHRj6eEJ0bgO+hSFUMwGZU NvoIKlRSqARx+g0oRDfPcc2YNd5r63O5xwbxO9rAvHd5Gw+d3M6CIlunWoMvBQ/pmViM 1fZXtHxFW/cKiWPJWp7XmC4hEaAvrSGxhFqnd015x8QYYhpEv5aSoGaBazHYQ1JQHcgA aC8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695320109; x=1695924909; 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=YJN9aOtZgPglJqdvf2m10tLO0jbnaME/5vD8YEmqs0o=; b=rngX4Nu319DeIzRp++oPiZ781/axFCFhRWKjB+cKoAWQ5Hm3YE8lVr68MmqCUdWxVb L/cHvB3p1JyZEi4zYqjjvSv5M46vtKVxReoj5hFV+XbuV2OQI0C7Sue83lUzO4XtQu7k fvN6C3nwiA9HY7txSYWdxjpUH/MmOwI1Vgq7zuI78EUp+3zgtQvnpFaU9uagkDy9Fefs yPDIgP0b1o3tV7CimvdKR1v2W50ncdtVJggHtd44f5Cm39mMK+8wrSENO2PTlUHTSsT5 DdIPZVZhCU5PaYH8bDAr61+bTvxK2Svujib/8CQ2BXNRYR2WYYTft0oq37H4RBn7oz7u M6+A== X-Gm-Message-State: AOJu0YztZOO10FnpQWmFmJvafcJ+ZI5gpZDpv/IERK+BAqgDfP5+Mcz6 lDRXOlbfhhgY81c+4ALO2p/TQO5jeD8= X-Google-Smtp-Source: AGHT+IGXu85ZU9tTQcrUtdBSTUKaV+TPhJ9ERgFrCb46+7owHSUzpuscGbIdB17UOEqsoBsaQgeLfQ== X-Received: by 2002:a05:6871:152:b0:1bf:50e0:95d9 with SMTP id z18-20020a056871015200b001bf50e095d9mr6369297oab.26.1695304303377; Thu, 21 Sep 2023 06:51:43 -0700 (PDT) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id z19-20020a056870e15300b001d7034bc222sm547064oaa.15.2023.09.21.06.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 06:51:43 -0700 (PDT) From: Chris Morgan To: linux-sunxi@lists.linux.dev Cc: devicetree@vger.kernel.org, mripard@kernel.org, uwu@icenowy.me, samuel@sholland.org, jernej.skrabec@gmail.com, wens@csie.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, andre.przywara@arm.com, Chris Morgan Subject: [PATCH V5 2/4] ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts Date: Thu, 21 Sep 2023 08:51:34 -0500 Message-Id: <20230921135136.97491-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230921135136.97491-1-macroalpha82@gmail.com> References: <20230921135136.97491-1-macroalpha82@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: Chris Morgan Add the EHCI and OHCI controller to the Allwinner v3s to support using USB in host mode. Signed-off-by: Chris Morgan Reviewed-by: Andre Przywara Acked-by: Jernej Skrabec --- arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi index c87476ea31e2..e8a04476b776 100644 --- a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi @@ -319,6 +319,29 @@ usbphy: phy@1c19400 { #phy-cells = <1>; }; + ehci: usb@1c1a000 { + compatible = "allwinner,sun8i-v3s-ehci", "generic-ehci"; + reg = <0x01c1a000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>; + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; + phys = <&usbphy 0>; + phy-names = "usb"; + status = "disabled"; + }; + + ohci: usb@1c1a400 { + compatible = "allwinner,sun8i-v3s-ohci", "generic-ohci"; + reg = <0x01c1a400 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>, + <&ccu CLK_USB_OHCI0>; + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; + phys = <&usbphy 0>; + phy-names = "usb"; + status = "disabled"; + }; + ccu: clock@1c20000 { compatible = "allwinner,sun8i-v3s-ccu"; reg = <0x01c20000 0x400>; From patchwork Thu Sep 21 13:51:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 724971 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4FFE4B208 for ; Thu, 21 Sep 2023 18:11:01 +0000 (UTC) Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23BFCA75E6 for ; Thu, 21 Sep 2023 11:01:12 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-d84d883c1b6so3517604276.0 for ; Thu, 21 Sep 2023 11:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695319272; x=1695924072; 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=gGhQthT64pdSxzZ5aTBXuH64J4biaW8ztdfRr2G2cDM=; b=T8IkynlTNS3kruKVDftrXKxmsJXWPFO46F7Sh/PlOOqZvdFDYEDGOipL6BgfHW1VUN /d1uW9yXitBmseBG/697D2smEp0V9VzNAp8nmU85bKtqtlxYQzf37ugCZajXKPqeba+g jz1PaEXzYF4GJRQer0hGcO+44+ZjTjLiUJIzTcTi8Lv14ZO4bTq7hL8xKl+3dk1EgEm4 iVP0glIYlq/AtJyLS5GvbNI7AOUet4vLNtaixZRAWW2YWokA5sm8kRkQUaBgir4E3gHC BU27vUq5PtP9vdZ8SMrvpos9+6ijYBdGiHnyK8Nhz1pSGv5C5fSZhEPEbFktpmK2FmSs StMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695319272; x=1695924072; 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=gGhQthT64pdSxzZ5aTBXuH64J4biaW8ztdfRr2G2cDM=; b=ATGAsAvkwoFTTstRs2j3VZhMo8/AYv5GlH2RQShzY7Shg12Ub71wGgJ+d3gD06Qgzi Oh2LztJQ/S2GzYU3R1UQO0pafzgCoEoBJTi2+EG5cMHhFTk/FUsHkqi2SccANlk2u9I0 xd4/Pg5jWGMcSOjR/mNpK9IcI8A9m843NoN+5uq0LCtaMSI5gLLjbzhQzuNSiS8Ap+b8 EJ9V8w7H0eogmhEJQCzddv8MJTrBWgm4efzBcaZtgrqitsUO4NFyMItVY+pdUiHfqu26 D3Mwelxpdi3wZx5ky1FpuY1ClmPp8SjGQMCx/o1WfR5WXcBDhNX6UgOXRGjQBiuOQ3NJ L5PA== X-Gm-Message-State: AOJu0YwNMgIPiOWiZMFbQgHrkeP2UNyCE3LPntQARsml5d4//wCNHIqP rlETqVQhe8VNeIy0Sy1buyNmgN68JtM= X-Google-Smtp-Source: AGHT+IFQVVG38WqZPkPmlbr3yI27dO0u1qCiqzelHFDwYcdOfrEBXKSAnbit25UR1O5vmrNYQEj09w== X-Received: by 2002:a05:6871:282:b0:1bf:42a8:2cd2 with SMTP id i2-20020a056871028200b001bf42a82cd2mr5550149oae.25.1695304303940; Thu, 21 Sep 2023 06:51:43 -0700 (PDT) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id z19-20020a056870e15300b001d7034bc222sm547064oaa.15.2023.09.21.06.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 06:51:43 -0700 (PDT) From: Chris Morgan To: linux-sunxi@lists.linux.dev Cc: devicetree@vger.kernel.org, mripard@kernel.org, uwu@icenowy.me, samuel@sholland.org, jernej.skrabec@gmail.com, wens@csie.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, andre.przywara@arm.com, Chris Morgan , Krzysztof Kozlowski Subject: [PATCH V5 3/4] dt-bindings: arm: sunxi: add Anbernic RG-Nano Date: Thu, 21 Sep 2023 08:51:35 -0500 Message-Id: <20230921135136.97491-4-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230921135136.97491-1-macroalpha82@gmail.com> References: <20230921135136.97491-1-macroalpha82@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: Chris Morgan The Anbernic RG-Nano is a portable handheld console from Anbernic which uses the Allwinner V3s SoC. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Reviewed-by: Andre Przywara --- Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml index e4dd678f4212..1929a0a475fd 100644 --- a/Documentation/devicetree/bindings/arm/sunxi.yaml +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml @@ -51,6 +51,11 @@ properties: - const: allwinner,parrot - const: allwinner,sun8i-a33 + - description: Anbernic RG-Nano + items: + - const: anbernic,rg-nano + - const: allwinner,sun8i-v3s + - description: Amarula A64 Relic items: - const: amarula,a64-relic From patchwork Thu Sep 21 13:51:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 724970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFFE44B20F for ; Thu, 21 Sep 2023 18:11:12 +0000 (UTC) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BDBDA5449 for ; Thu, 21 Sep 2023 10:58:44 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c465d59719so10388415ad.1 for ; Thu, 21 Sep 2023 10:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695319124; x=1695923924; 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=AWPDtqrSNlFWJNGtTdELDc+gCPScA6mkjwfRNyPaAXw=; b=FFyJwy28Msdtu418h0Qa9S+1SNoYBMqFC/gI/tPl89WrOC60jGQriL1k05/o7cJm8K jEKT6Pmo38ezFUqZgLYr8JxlufbF3ufcDhyqNZnw0sXcHQM+xFnfVU/14W0UvkrMuAND YpA62og3z10A/An7vbGFL9AwFqDERl4A6RG7wXXY2P2NsaRuGrAtFvqdx8POTZPU23Fz +aA+kBusRKhDvO9mR7CNTyRIOQoop1xsbyrZCWsJFGBfSyjAkaFQZOqXWzOVnTvVbSFm n45EPBR6RbiQLM0Rxsb/d3QFRlB4IG7N/q0RrK3en/dpplmxZy2tRtjJhV80Akk9zB7m Kokg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695319124; x=1695923924; 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=AWPDtqrSNlFWJNGtTdELDc+gCPScA6mkjwfRNyPaAXw=; b=JfYorTpLI8ks/VojIygKsTCQf6BotnboMGB3L/U1f1ID3PouVsGojQOxeHeoO5+p20 Khsp3SQVUt/dC5Ituju8vCSzhcZ1jOGxjaNuIiRp7mofXB4f1e32bMbwn2E9RPdm6B14 iJgrln6JeaPQ9VuBwZuOui/uSF6OJ8V2pmh8oAewQvGCrmiLU9Qgbmt/aJG0taVqWv+F EG7nEMq0TS1GKqgsvx8e2qY+eyBE1rzSoPoImAr0EJXgE1aU8FIDfNsFYj05KN7ZQs8+ pdLIqFvtryFj/p98Pi9RR672lqKVISvo09ED+6fDCUqnNgtW68axu5gpOEp0ul31XTg+ OzMA== X-Gm-Message-State: AOJu0YxQE1PuIlE5FdoAGSigDLB/i4VCg6rGKaGCB29jXW4XsQdo57Iv LGKBYNIuvDNlVDvC2we0u9paVLmPloE= X-Google-Smtp-Source: AGHT+IFIQ0cd+5ISzxChSAfPX7Xz+I3Et8iJ6Jt8P7r8laYWNgd04ihFnTZgHCWed29ar0gd5C/wkg== X-Received: by 2002:a05:6870:b490:b0:1d7:876:c825 with SMTP id y16-20020a056870b49000b001d70876c825mr5730136oap.48.1695304304581; Thu, 21 Sep 2023 06:51:44 -0700 (PDT) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id z19-20020a056870e15300b001d7034bc222sm547064oaa.15.2023.09.21.06.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 06:51:44 -0700 (PDT) From: Chris Morgan To: linux-sunxi@lists.linux.dev Cc: devicetree@vger.kernel.org, mripard@kernel.org, uwu@icenowy.me, samuel@sholland.org, jernej.skrabec@gmail.com, wens@csie.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, andre.przywara@arm.com, Chris Morgan Subject: [PATCH V5 4/4] ARM: dts: sunxi: add support for Anbernic RG-Nano Date: Thu, 21 Sep 2023 08:51:36 -0500 Message-Id: <20230921135136.97491-5-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230921135136.97491-1-macroalpha82@gmail.com> References: <20230921135136.97491-1-macroalpha82@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: Chris Morgan The Anbernic RG-Nano is a small portable game device based on the Allwinner V3s SoC. It has GPIO buttons on the face and side for input, a single mono speaker, a 240x240 SPI controlled display, a USB-C OTG port, an SD card slot for booting, and 64MB of RAM included in the SoC. There does not appear to be a crystal feeding the internal RTC so it does not keep proper time (for me it ran 8 hours slow in a 24 hour period). External RTC works just fine. Working/Tested: - SDMMC - UART (for debugging) - Buttons - Charging/battery/PMIC - Speaker - RTC (external RTC) - USB - Display Signed-off-by: Chris Morgan --- arch/arm/boot/dts/allwinner/Makefile | 1 + .../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++ 2 files changed, 285 insertions(+) create mode 100644 arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile index eebb5a0c873a..2d26c3397f14 100644 --- a/arch/arm/boot/dts/allwinner/Makefile +++ b/arch/arm/boot/dts/allwinner/Makefile @@ -256,6 +256,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ sun8i-t113s-mangopi-mq-r-t113.dtb \ sun8i-t3-cqa3t-bv3.dtb \ sun8i-v3-sl631-imx179.dtb \ + sun8i-v3s-anbernic-rg-nano.dtb \ sun8i-v3s-licheepi-zero.dtb \ sun8i-v3s-licheepi-zero-dock.dtb \ sun8i-v40-bananapi-m2-berry.dtb diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts new file mode 100644 index 000000000000..1a4429dc57b1 --- /dev/null +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; +#include +#include "sun8i-v3s.dtsi" +#include "sunxi-common-regulators.dtsi" + +/ { + model = "Anbernic RG Nano"; + compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s"; + + aliases { + rtc0 = &pcf8563; + rtc1 = &rtc; + serial0 = &uart0; + }; + + backlight: backlight { + compatible = "pwm-backlight"; + brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>; + default-brightness-level = <11>; + power-supply = <®_vcc5v0>; + pwms = <&pwm 0 40000 1>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio_keys: gpio-keys { + compatible = "gpio-keys"; + + button-a { + gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-A"; + linux,code = ; + }; + + button-b { + gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-B"; + linux,code = ; + }; + + button-down { + gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "DPAD-DOWN"; + linux,code = ; + }; + + button-left { + gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "DPAD-LEFT"; + linux,code = ; + }; + + button-right { + gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "DPAD-RIGHT"; + linux,code = ; + }; + + button-se { + gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-SELECT"; + linux,code = ; + }; + + button-st { + gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-START"; + linux,code = ; + }; + + button-tl { + gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-L"; + linux,code = ; + }; + + button-tr { + gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-R"; + linux,code = ; + }; + + button-up { + gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "DPAD-UP"; + linux,code = ; + }; + + button-x { + gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-X"; + linux,code = ; + }; + + button-y { + gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + label = "BTN-Y"; + linux,code = ; + }; + }; +}; + +&codec { + allwinner,audio-routing = "Speaker", "HP", + "MIC1", "Mic", + "Mic", "HBIAS"; + allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PF6 */ + status = "okay"; +}; + +&ehci { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + gpio_expander: gpio@20 { + compatible = "nxp,pcal6416"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + #interrupt-cells = <2>; + interrupt-controller; + interrupt-parent = <&pio>; + interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */ + vcc-supply = <®_vcc3v3>; + }; + + axp209: pmic@34 { + reg = <0x34>; + interrupt-parent = <&pio>; + interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5 */ + }; + + pcf8563: rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; +}; + +#include "axp209.dtsi" + +&battery_power_supply { + status = "okay"; +}; + +&mmc0 { + broken-cd; + bus-width = <4>; + disable-wp; + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc3v3>; + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&pio { + vcc-pb-supply = <®_vcc3v3>; + vcc-pc-supply = <®_vcc3v3>; + vcc-pf-supply = <®_vcc3v3>; + vcc-pg-supply = <®_vcc3v3>; + + spi0_no_miso_pins: spi0-no-miso-pins { + pins = "PC1", "PC2", "PC3"; + function = "spi0"; + }; +}; + +&pwm { + pinctrl-0 = <&pwm0_pin>; + pinctrl-names = "default"; + status = "okay"; +}; + +/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */ +®_dcdc2 { + regulator-always-on; + regulator-max-microvolt = <1250000>; + regulator-min-microvolt = <1250000>; + regulator-name = "vdd-cpu"; +}; + +/* DCDC3 wired into every 3.3v input that isn't the RTC. */ +®_dcdc3 { + regulator-always-on; + regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <3300000>; + regulator-name = "vcc-io"; +}; + +/* + * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be + * software modified. Note that setting voltage here to 3.3v for accuracy + * sake causes an issue with the driver that causes it to fail to probe + * because of a voltage constraint in the driver. + */ +®_ldo1 { + regulator-always-on; + regulator-name = "vcc-rtc"; +}; + +/* LDO2 wired into VCC-PLL and audio codec. */ +®_ldo2 { + regulator-always-on; + regulator-max-microvolt = <3000000>; + regulator-min-microvolt = <3000000>; + regulator-name = "vcc-pll"; +}; + +/* LDO3, LDO4, and LDO5 unused. */ +®_ldo3 { + status = "disabled"; +}; + +®_ldo4 { + status = "disabled"; +}; + +/* + * Force the driver to use internal oscillator by removing clocks + * property. + */ +&rtc { + /delete-property/ clocks; +}; + +&spi0 { + pinctrl-0 = <&spi0_no_miso_pins>; + pinctrl-names = "default"; + status = "okay"; + + display@0 { + compatible = "saef,sftc154b", "panel-mipi-dbi-spi"; + reg = <0>; + backlight = <&backlight>; + dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */ + reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */ + spi-max-frequency = <100000000>; + + height-mm = <39>; + width-mm = <39>; + + /* Set hb-porch to compensate for non-visible area */ + panel-timing { + hactive = <240>; + vactive = <240>; + hback-porch = <80>; + vback-porch = <0>; + clock-frequency = <0>; + hfront-porch = <0>; + hsync-len = <0>; + vfront-porch = <0>; + vsync-len = <0>; + }; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_pb_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usb_power_supply { + status = "okay"; +}; + +&usbphy { + usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG5 */ + status = "okay"; +};