Message ID | 20221012055602.1544944-11-uwu@icenowy.me (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | SUNIV USB and PopStick support (and updating mailmap) | expand |
Hi Icenowy, On Wed, 12 Oct 2022 at 07:57, Icenowy Zheng <uwu@icenowy.me> wrote: > > PopStick is a minimal Allwinner F1C200s dongle, with its USB controller > wired to a USB Type-A port, a SD slot and a SPI NAND flash on board, and > an on-board CH340 USB-UART converted connected to F1C200s's UART0. > > Add a device tree for it. As F1C200s is just F1C100s with a different > DRAM chip co-packaged, directly use F1C100s DTSI here. > > This commit covers the v1.1 version of this board, which is now shipped. > v1.0 is some internal sample that have not been shipped at all. > > Signed-off-by: Icenowy Zheng <uwu@icenowy.me> > --- > New patch introduced in v2. > > arch/arm/boot/dts/Makefile | 3 +- > .../boot/dts/suniv-f1c200s-popstick-v1.1.dts | 101 ++++++++++++++++++ > 2 files changed, 103 insertions(+), 1 deletion(-) > create mode 100644 arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts > > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile > index 6aa7dc4db2fc..0249c07bd8a6 100644 > --- a/arch/arm/boot/dts/Makefile > +++ b/arch/arm/boot/dts/Makefile > @@ -1391,7 +1391,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \ > sun9i-a80-optimus.dtb \ > sun9i-a80-cubieboard4.dtb > dtb-$(CONFIG_MACH_SUNIV) += \ > - suniv-f1c100s-licheepi-nano.dtb > + suniv-f1c100s-licheepi-nano.dtb \ > + suniv-f1c200s-popstick-v1.1.dtb > dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \ > tegra20-acer-a500-picasso.dtb \ > tegra20-asus-tf101.dtb \ > diff --git a/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts > new file mode 100644 > index 000000000000..121dfc6f609d > --- /dev/null > +++ b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts > @@ -0,0 +1,101 @@ > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > +/* > + * Copyright 2022 Icenowy Zheng <uwu@icenowy.me> > + */ > + > +/dts-v1/; > +#include "suniv-f1c100s.dtsi" > + > +#include <dt-bindings/gpio/gpio.h> > +#include <dt-bindings/leds/common.h> > + > +/ { > + model = "Popcorn Computer PopStick v1.1"; > + compatible = "sourceparts,popstick-v1.1", "sourceparts,popstick", > + "allwinner,suniv-f1c200s", "allwinner,suniv-f1c100s"; > + > + aliases { > + mmc0 = &mmc0; > + serial0 = &uart0; > + spi0 = &spi0; > + }; > + > + chosen { > + stdout-path = "serial0:115200n8"; > + }; > + > + leds { > + compatible = "gpio-leds"; > + > + led { > + function = LED_FUNCTION_STATUS; > + color = <LED_COLOR_ID_GREEN>; > + gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>; /* PE6 */ > + linux,default-trigger = "heartbeat"; > + }; > + }; > + > + reg_vcc3v3: vcc3v3 { > + compatible = "regulator-fixed"; > + regulator-name = "vcc3v3"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + }; > +}; > + > +&mmc0 { > + cd-gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */ > + bus-width = <4>; > + disable-wp; > + status = "okay"; > + vmmc-supply = <®_vcc3v3>; > +}; > + > +&spi0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&spi0_pc_pins>; > + status = "okay"; > + > + flash@0 { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "spi-nand"; > + reg = <0>; > + spi-max-frequency = <40000000>; > + > + partitions { > + compatible = "fixed-partitions"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + partition@0 { > + label = "u-boot-with-spl"; > + reg = <0x0 0x100000>; > + }; > + > + ubi@100000 { > + label = "ubi"; > + reg = <0x100000 0x7f00000>; > + }; > + }; > + }; > +}; > + > +&otg_sram { Nitpick, but this should be alphabetically ordered no? > + status = "okay"; > +}; > + > +&uart0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart0_pe_pins>; > + status = "okay"; > +}; > + > +&usb_otg { > + dr_mode = "peripheral"; > + status = "okay"; > +}; > + > +&usbphy { > + status = "okay"; > +}; > -- > 2.37.1 > >
On 12/10/2022 01:56, Icenowy Zheng wrote: > PopStick is a minimal Allwinner F1C200s dongle, with its USB controller > wired to a USB Type-A port, a SD slot and a SPI NAND flash on board, and > an on-board CH340 USB-UART converted connected to F1C200s's UART0. (...) > + > + chosen { > + stdout-path = "serial0:115200n8"; > + }; > + > + leds { > + compatible = "gpio-leds"; > + > + led { > + function = LED_FUNCTION_STATUS; > + color = <LED_COLOR_ID_GREEN>; > + gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>; /* PE6 */ > + linux,default-trigger = "heartbeat"; > + }; > + }; > + > + reg_vcc3v3: vcc3v3 { Generic node names, so at least generic "regulator" prefix or suffix. > + compatible = "regulator-fixed"; > + regulator-name = "vcc3v3"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + }; > +}; > + > +&mmc0 { > + cd-gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */ > + bus-width = <4>; > + disable-wp; > + status = "okay"; Keep status as last property. > + vmmc-supply = <®_vcc3v3>; > +}; > + > +&spi0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&spi0_pc_pins>; > + status = "okay"; > + > + flash@0 { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "spi-nand"; > + reg = <0>; compatible and reg are by convention the first properties. > + spi-max-frequency = <40000000>; > + Best regards, Krzysztof
On Wed, 12 Oct 2022 13:56:02 +0800 Icenowy Zheng <uwu@icenowy.me> wrote: Hi, > PopStick is a minimal Allwinner F1C200s dongle, with its USB controller > wired to a USB Type-A port, a SD slot and a SPI NAND flash on board, and > an on-board CH340 USB-UART converted connected to F1C200s's UART0. > > Add a device tree for it. As F1C200s is just F1C100s with a different > DRAM chip co-packaged, directly use F1C100s DTSI here. > > This commit covers the v1.1 version of this board, which is now shipped. > v1.0 is some internal sample that have not been shipped at all. As mentioned in the other patch, if that is the case, I don't think we need to bother about the version number in the filename and compatible strings, especially if a v1.0 will never be upstreamed. If there are users of the internal version still, they can use an explicit "v1.0" in their downstream versions. So apart from what Krzysztof and Clement already mentioned, the DT itself looks fine to me otherwise. I also ran dt-validate on it, and used it as a base for another F1C200s board. Cheers, Andre > Signed-off-by: Icenowy Zheng <uwu@icenowy.me> > --- > New patch introduced in v2. > > arch/arm/boot/dts/Makefile | 3 +- > .../boot/dts/suniv-f1c200s-popstick-v1.1.dts | 101 ++++++++++++++++++ > 2 files changed, 103 insertions(+), 1 deletion(-) > create mode 100644 arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts > > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile > index 6aa7dc4db2fc..0249c07bd8a6 100644 > --- a/arch/arm/boot/dts/Makefile > +++ b/arch/arm/boot/dts/Makefile > @@ -1391,7 +1391,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \ > sun9i-a80-optimus.dtb \ > sun9i-a80-cubieboard4.dtb > dtb-$(CONFIG_MACH_SUNIV) += \ > - suniv-f1c100s-licheepi-nano.dtb > + suniv-f1c100s-licheepi-nano.dtb \ > + suniv-f1c200s-popstick-v1.1.dtb > dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \ > tegra20-acer-a500-picasso.dtb \ > tegra20-asus-tf101.dtb \ > diff --git a/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts > new file mode 100644 > index 000000000000..121dfc6f609d > --- /dev/null > +++ b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts > @@ -0,0 +1,101 @@ > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > +/* > + * Copyright 2022 Icenowy Zheng <uwu@icenowy.me> > + */ > + > +/dts-v1/; > +#include "suniv-f1c100s.dtsi" > + > +#include <dt-bindings/gpio/gpio.h> > +#include <dt-bindings/leds/common.h> > + > +/ { > + model = "Popcorn Computer PopStick v1.1"; > + compatible = "sourceparts,popstick-v1.1", "sourceparts,popstick", > + "allwinner,suniv-f1c200s", "allwinner,suniv-f1c100s"; > + > + aliases { > + mmc0 = &mmc0; > + serial0 = &uart0; > + spi0 = &spi0; > + }; > + > + chosen { > + stdout-path = "serial0:115200n8"; > + }; > + > + leds { > + compatible = "gpio-leds"; > + > + led { > + function = LED_FUNCTION_STATUS; > + color = <LED_COLOR_ID_GREEN>; > + gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>; /* PE6 */ > + linux,default-trigger = "heartbeat"; > + }; > + }; > + > + reg_vcc3v3: vcc3v3 { > + compatible = "regulator-fixed"; > + regulator-name = "vcc3v3"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + }; > +}; > + > +&mmc0 { > + cd-gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */ > + bus-width = <4>; > + disable-wp; > + status = "okay"; > + vmmc-supply = <®_vcc3v3>; > +}; > + > +&spi0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&spi0_pc_pins>; > + status = "okay"; > + > + flash@0 { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "spi-nand"; > + reg = <0>; > + spi-max-frequency = <40000000>; > + > + partitions { > + compatible = "fixed-partitions"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + partition@0 { > + label = "u-boot-with-spl"; > + reg = <0x0 0x100000>; > + }; > + > + ubi@100000 { > + label = "ubi"; > + reg = <0x100000 0x7f00000>; > + }; > + }; > + }; > +}; > + > +&otg_sram { > + status = "okay"; > +}; > + > +&uart0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart0_pe_pins>; > + status = "okay"; > +}; > + > +&usb_otg { > + dr_mode = "peripheral"; > + status = "okay"; > +}; > + > +&usbphy { > + status = "okay"; > +};
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 6aa7dc4db2fc..0249c07bd8a6 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1391,7 +1391,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \ sun9i-a80-optimus.dtb \ sun9i-a80-cubieboard4.dtb dtb-$(CONFIG_MACH_SUNIV) += \ - suniv-f1c100s-licheepi-nano.dtb + suniv-f1c100s-licheepi-nano.dtb \ + suniv-f1c200s-popstick-v1.1.dtb dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \ tegra20-acer-a500-picasso.dtb \ tegra20-asus-tf101.dtb \ diff --git a/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts new file mode 100644 index 000000000000..121dfc6f609d --- /dev/null +++ b/arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright 2022 Icenowy Zheng <uwu@icenowy.me> + */ + +/dts-v1/; +#include "suniv-f1c100s.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> + +/ { + model = "Popcorn Computer PopStick v1.1"; + compatible = "sourceparts,popstick-v1.1", "sourceparts,popstick", + "allwinner,suniv-f1c200s", "allwinner,suniv-f1c100s"; + + aliases { + mmc0 = &mmc0; + serial0 = &uart0; + spi0 = &spi0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led { + function = LED_FUNCTION_STATUS; + color = <LED_COLOR_ID_GREEN>; + gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>; /* PE6 */ + linux,default-trigger = "heartbeat"; + }; + }; + + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&mmc0 { + cd-gpios = <&pio 4 3 GPIO_ACTIVE_LOW>; /* PE3 */ + bus-width = <4>; + disable-wp; + status = "okay"; + vmmc-supply = <®_vcc3v3>; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pc_pins>; + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot-with-spl"; + reg = <0x0 0x100000>; + }; + + ubi@100000 { + label = "ubi"; + reg = <0x100000 0x7f00000>; + }; + }; + }; +}; + +&otg_sram { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pe_pins>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + status = "okay"; +};
PopStick is a minimal Allwinner F1C200s dongle, with its USB controller wired to a USB Type-A port, a SD slot and a SPI NAND flash on board, and an on-board CH340 USB-UART converted connected to F1C200s's UART0. Add a device tree for it. As F1C200s is just F1C100s with a different DRAM chip co-packaged, directly use F1C100s DTSI here. This commit covers the v1.1 version of this board, which is now shipped. v1.0 is some internal sample that have not been shipped at all. Signed-off-by: Icenowy Zheng <uwu@icenowy.me> --- New patch introduced in v2. arch/arm/boot/dts/Makefile | 3 +- .../boot/dts/suniv-f1c200s-popstick-v1.1.dts | 101 ++++++++++++++++++ 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/suniv-f1c200s-popstick-v1.1.dts