From: Ivan Uvarov <i.uvarov@cognitivepilot.com>
To: Rob Herring <robh+dt@kernel.org>,
Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@siol.net>,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Cc: "André Przywara" <andre.przywara@arm.com>
Subject: [draft2 PATCH] ARM: dts: sun8i: r40: add devicetree for FETA40i-C/OKA40i-C
Date: Tue, 2 Mar 2021 13:54:15 +0300 [thread overview]
Message-ID: <c4c13d63-e319-48b5-17e6-26d9967aa66f@cognitivepilot.com> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 8463 bytes --]
From: Ivan Uvarov <i.uvarov@cognitivepilot.com>
This patch adds support for the Forlinx FETA40i-C SoM and OKA40i-C
devboard[1] that is based on it. The devicetree is split into a .dtsi
which (hopefully) corresponds to the functions of the SoM itself and
a .dts for the devboard.
[1]:https://linux-sunxi.org/Forlinx_OKA40i-C
Signed-off-by: Ivan Uvarov <i.uvarov@cognitivepilot.com>
---
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/sun8i-r40-feta40i.dtsi | 68 +++++++
arch/arm/boot/dts/sun8i-r40-oka40i-c.dts | 238 +++++++++++++++++++++++
3 files changed, 307 insertions(+)
create mode 100644 arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
create mode 100644 arch/arm/boot/dts/sun8i-r40-oka40i-c.dts
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 8e5d4ab4e7..88aae9de95 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1222,6 +1222,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
sun8i-r16-nintendo-super-nes-classic.dtb \
sun8i-r16-parrot.dtb \
sun8i-r40-bananapi-m2-ultra.dtb \
+ sun8i-r40-oka40i-c.dtb \
sun8i-s3-elimo-initium.dtb \
sun8i-s3-lichee-zero-plus.dtb \
sun8i-s3-pinecube.dtb \
diff --git a/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
new file mode 100644
index 0000000000..edfb846db1
--- /dev/null
+++ b/arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// Copyright (C) 2021 Ivan Uvarov <i.uvarov@cognitivepilot.com>
+// Based on the sun8i-r40-bananapi-m2-ultra.dts, which is:
+// Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
+// Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
+
+#include "sun8i-r40.dtsi"
+
+
+&i2c0 {
+ status =3D "okay";
+
+ axp22x: pmic@34 {
+ compatible =3D "x-powers,axp221";
+ reg =3D <0x34>;
+ interrupt-parent =3D <&nmi_intc>;
+ interrupts =3D <0 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+#include "axp22x.dtsi"
+
+&mmc2 {
+ vmmc-supply =3D <®_dcdc1>;
+ vqmmc-supply =3D <®_aldo2>;
+ bus-width =3D <8>;
+ non-removable;
+ status =3D "okay";
+};
+
+
+&pio {
+ pinctrl-names =3D "default";
+ pinctrl-0 =3D <&clk_out_a_pin>;
+ vcc-pa-supply =3D <®_dcdc1>;
+ vcc-pc-supply =3D <®_aldo2>;
+ vcc-pd-supply =3D <®_dcdc1>;
+ vcc-pf-supply =3D <®_dldo4>;
+ vcc-pg-supply =3D <®_dldo1>;
+};
+
+®_aldo2 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <1800000>;
+ regulator-max-microvolt =3D <2500000>;
+ regulator-name =3D "vcc-pa";
+};//2500000uV reported by kernel
+
+®_dcdc1 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <3300000>;
+ regulator-max-microvolt =3D <3300000>;
+ regulator-name =3D "vcc-3v3";
+};
+
+
+//I don't know whether these really belong here
+®_dldo1 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <3300000>;
+ regulator-max-microvolt =3D <3300000>;
+ regulator-name =3D "vcc-wifi-io";
+};
+
+®_dldo4 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <2500000>;
+ regulator-max-microvolt =3D <2500000>;
+ regulator-name =3D "vdd2v5-sata";
diff --git a/arch/arm/boot/dts/sun8i-r40-oka40i-c.dts b/arch/arm/boot/dts/sun8i-r40-oka40i-c.dts
new file mode 100644
index 0000000000..7e47cf633e
--- /dev/null
+++ b/arch/arm/boot/dts/sun8i-r40-oka40i-c.dts
@@ -0,0 +1,238 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// Copyright (C) 2021 Ivan Uvarov <i.uvarov@cognitivepilot.com>
+// Based on the sun8i-r40-bananapi-m2-ultra.dts, which is:
+// Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
+// Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
+
+/dts-v1/;
+#include "sun8i-r40-feta40i.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model =3D "Forlinx OKA40i-C";
+ compatible =3D "forlinx,oka40i-c", "allwinner,sun8i-r40";
+
+ aliases {
+ ethernet0 =3D &gmac;
+ serial0 =3D &uart0;
+ };
+
+ chosen {
+ stdout-path =3D "serial0:115200n8";
+ };
+
+ connector {
+ compatible =3D "hdmi-connector";
+ type =3D "a";
+
+ port {
+ hdmi_con_in: endpoint {
+ remote-endpoint =3D <&hdmi_out_con>;
+ };
+ };
+ };
+
+ leds {
+ compatible =3D "gpio-leds";
+
+ user-led-5 {
+ label =3D "oka40i:led5:user";
+ gpios =3D <&pio 7 26 GPIO_ACTIVE_LOW>;
+ };
+
+ user-led-6 {
+ label =3D "oka40i:led6:user";
+ gpios =3D <&pio 8 15 GPIO_ACTIVE_LOW>;
+ };
+
+ };
+
+ reg_vcc5v0: vcc5v0 {
+ compatible =3D "regulator-fixed";
+ regulator-name =3D "vcc5v0";
+ regulator-min-microvolt =3D <5000000>;
+ regulator-max-microvolt =3D <5000000>;
+ //gpio =3D <&pio 7 23 GPIO_ACTIVE_HIGH>; // PH23
+ //enable-active-high;
+ };
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible =3D "mmc-pwrseq-simple";
+ reset-gpios =3D <&pio 1 10 GPIO_ACTIVE_LOW>; // PB10 WIFI_EN
+ clocks =3D <&ccu CLK_OUTA>;
+ clock-names =3D "ext_clock";
+ };
+};
+
+&ahci {
+ ahci-supply =3D <®_dldo4>;
+ phy-supply =3D <®_eldo2>;
+ status =3D "okay";
+};
+
+&de {
+ status =3D "okay";
+};
+
+&ehci1 {
+ status =3D "okay";
+};
+
+&ehci2 {
+ status =3D "okay";
+};
+
+&gmac {
+ pinctrl-names =3D "default";
+ pinctrl-0 =3D <&gmac_rgmii_pins>;
+ phy-handle =3D <&phy1>;
+ phy-mode =3D "rgmii-id";
+ phy-supply =3D <®_dcdc1>;
+ status =3D "okay";
+};
+
+&gmac_mdio {
+ phy1: ethernet-phy@1 {
+ compatible =3D "ethernet-phy-ieee802.3-c22";
+ reg =3D <1>;
+ };
+};
+
+&hdmi {
+ status =3D "okay";
+};
+
+&hdmi_out {
+ hdmi_out_con: endpoint {
+ remote-endpoint =3D <&hdmi_con_in>;
+ };
+};
+
+
+&i2c2 {
+ status =3D "okay";
+};
+
+
+&mmc0 {
+ vmmc-supply =3D <®_dcdc1>;
+ vqmmc-supply =3D <®_dcdc1>;
+ bus-width =3D <4>;
+ cd-gpios =3D <&pio 8 11 GPIO_ACTIVE_LOW>; // PI11
+ status =3D "okay";
+};
+
+&mmc1 {
+ vmmc-supply =3D <®_dcdc1>;
+ vqmmc-supply =3D <®_dcdc1>;
+ mmc-pwrseq =3D <&wifi_pwrseq>;
+ bus-width =3D <4>;
+ status =3D "okay";
+};
+
+&ohci1 {
+ status =3D "okay";
+};
+
+&ohci2 {
+ status =3D "okay";
+};
+
+®_aldo3 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <3000000>;
+ regulator-max-microvolt =3D <3000000>;
+ regulator-name =3D "avcc";
+};
+
+®_dc1sw {
+ regulator-min-microvolt =3D <3300000>;
+ regulator-max-microvolt =3D <3300000>;
+ regulator-name =3D "vcc-lcd";
+};
+
+®_dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <1100000>;
+ regulator-max-microvolt =3D <1160000>;
+ regulator-name =3D "vdd-cpu";
+};//1100000uV reported by kernel
+
+®_dcdc3 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <1100000>;
+ regulator-max-microvolt =3D <1200000>;
+ regulator-name =3D "vdd-sys";
+};//1100000uV reported by kernel
+
+
+®_dcdc5 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <1500000>;
+ regulator-max-microvolt =3D <1500000>;
+ regulator-name =3D "vcc-dram";
+};
+
+®_dldo2 {
+ // regulator-always-on;
+ regulator-min-microvolt =3D <3300000>;
+ regulator-max-microvolt =3D <3300000>;
+ regulator-name =3D "vcc-wifi";
+};
+
+®_dldo3 { // possibly unneeded
+ // regulator-always-on;
+ regulator-min-microvolt =3D <3300000>;
+ regulator-max-microvolt =3D <3300000>;
+ regulator-name =3D "vcc-wifi-2";
+};
+
+®_eldo2 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <1200000>;
+ regulator-max-microvolt =3D <1200000>;
+ regulator-name =3D "vdd1v2-sata";
+};
+
+®_eldo3 {
+ regulator-always-on;
+ regulator-min-microvolt =3D <2800000>;
+ regulator-max-microvolt =3D <2800000>;
+ regulator-name =3D "vcc-pe";
+};
+
+&tcon_tv0 {
+ status =3D "okay";
+};
+
+&uart0 {
+ pinctrl-names =3D "default";
+ pinctrl-0 =3D <&uart0_pb_pins>;
+ status =3D "okay";
+};
+
+&uart3 {
+ pinctrl-names =3D "default";
+ pinctrl-0 =3D <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
+ uart-has-rtscts;
+ status =3D "okay";
+
+ bluetooth {
+ compatible =3D "brcm,bcm43438-bt";
+ clocks =3D <&ccu CLK_OUTA>;
+ clock-names =3D "lpo";
+ vbat-supply =3D <®_dldo2>;
+ vddio-supply =3D <®_dldo1>;
+ device-wakeup-gpios =3D <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+ /* TODO host wake line connected to PMIC GPIO pins */
+ shutdown-gpios =3D <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
+ max-speed =3D <1500000>;
+ };
+};
+
+&usbphy {
+ usb1_vbus-supply =3D <®_vcc5v0>;
+ usb2_vbus-supply =3D <®_vcc5v0>;
+ status =3D "okay";
+};
--
2.25.1
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 665 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2021-03-03 17:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 10:54 Ivan Uvarov [this message]
2021-03-03 13:08 ` [draft2 PATCH] ARM: dts: sun8i: r40: add devicetree for FETA40i-C/OKA40i-C Andre Przywara
2021-03-03 15:11 ` Ivan Uvarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c4c13d63-e319-48b5-17e6-26d9967aa66f@cognitivepilot.com \
--to=i.uvarov@cognitivepilot.com \
--cc=andre.przywara@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=jernej.skrabec@siol.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox