ARM: dts: suniv: Add Lctech Pi F1C200s devicetree
authorAndre Przywara <andre.przywara@arm.com>
Sun, 19 Mar 2023 21:29:36 +0000 (21:29 +0000)
committerJernej Skrabec <jernej.skrabec@gmail.com>
Thu, 23 Mar 2023 20:57:34 +0000 (21:57 +0100)
The Lctech Pi F1C200s (also previously known under the Cherry Pi brand)
is a small development board with the Allwinner F1C200s SoC. This is the
same as the F1C100s, but with 64MB instead of 32MB co-packaged DRAM.

Alongside the obligatory micro-SD card slot, the board features a
SPI-NAND flash chip, LCD and touch connectors, and unpopulated
expansion header pins.
There are two USB Type-C ports on the board: One supplies the power, also
connects to the USB MUSB OTG controller port. The other one is connected
to an CH340 USB serial chip, which in turn is connected to UART1.

Add a devicetree file, so that the board can be used easily.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20230319212936.26649-7-andre.przywara@arm.com
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/suniv-f1c100s.dtsi
arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts [new file with mode: 0644]

index 3b97d7c1e3c2857bf9017969e46d080993cfc3eb..a627d5593e51b7866181b24e137d11c8ecf89273 100644 (file)
@@ -1407,6 +1407,7 @@ dtb-$(CONFIG_MACH_SUN9I) += \
        sun9i-a80-cubieboard4.dtb
 dtb-$(CONFIG_MACH_SUNIV) += \
        suniv-f1c100s-licheepi-nano.dtb \
+       suniv-f1c200s-lctech-pi.dtb \
        suniv-f1c200s-popstick-v1.1.dtb
 dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
        tegra20-acer-a500-picasso.dtb \
index 111f8bbc2a805ec20de53b95fd1ae24204c6801f..3c61d59ab5f86eb4724709c96cdebb3f0c93de12 100644 (file)
                                pins = "PE0", "PE1";
                                function = "uart0";
                        };
+
+                       /omit-if-no-ref/
+                       uart1_pa_pins: uart1-pa-pins {
+                               pins = "PA2", "PA3";
+                               function = "uart1";
+                       };
                };
 
                i2c0: i2c@1c27000 {
diff --git a/arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts b/arch/arm/boot/dts/suniv-f1c200s-lctech-pi.dts
new file mode 100644 (file)
index 0000000..2d2a3f0
--- /dev/null
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Arm Ltd,
+ * based on work:
+ *   Copyright 2022 Icenowy Zheng <uwu@icenowy.me>
+ */
+
+/dts-v1/;
+#include "suniv-f1c100s.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       model = "Lctech Pi F1C200s";
+       compatible = "lctech,pi-f1c200s", "allwinner,suniv-f1c200s",
+                    "allwinner,suniv-f1c100s";
+
+       aliases {
+               serial0 = &uart1;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       reg_vcc3v3: regulator-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+};
+
+&mmc0 {
+       broken-cd;
+       bus-width = <4>;
+       disable-wp;
+       vmmc-supply = <&reg_vcc3v3>;
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pc_pins>;
+       status = "okay";
+
+       flash@0 {
+               compatible = "spi-nand";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+       };
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pa_pins>;
+       status = "okay";
+};
+
+/*
+ * This is a Type-C socket, but CC1/2 are not connected, and VBUS is connected
+ * to Vin, which supplies the board. Host mode works (if the board is powered
+ * otherwise), but peripheral is probably the intention.
+ */
+&usb_otg {
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};