Skip to contentSkip to conversation

ARM: dt: sun7i: Add Banana Pi board

PATCH New Hans de Goede 2 participants 4 messages Jul 29, 2014 – Jul 31, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dt: sun7i: Add Banana Pi board

The Banana Pi is an A20 based development board using Raspberry Pi compatible IO headers. It comes with 1 GB RAM, 1 Gb ethernet, 2x USB host, sata, hdmi and stereo audio out + various expenansion headers:

http://www.bananapi.org/

---
 arch/arm/boot/dts/Makefile               |   1 +
 arch/arm/boot/dts/sun7i-a20-bananapi.dts | 183 +++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-bananapi.dts
arch/arm/boot/dts/Makefile +1 -0
index bdbc84a..440e037 100644
@@ -379,6 +379,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
 	sun6i-a31-hummingbird.dtb \
 	sun6i-a31-m9.dtb
 dtb-$(CONFIG_MACH_SUN7I) += \
+	sun7i-a20-bananapi.dtb \
 	sun7i-a20-cubieboard2.dtb \
 	sun7i-a20-cubietruck.dtb \
 	sun7i-a20-i12-tvbox.dtb \
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +183 -0

183 lines not on this page · raw message

Signature · 1 line
2.0.0
#1 lore raw

PATCH 1/1 ARM: dt: sun7i: Add Banana Pi board

Hi Hans,

Quoted 90 lines · Hans de Goede

The Banana Pi is an A20 based development board using Raspberry Pi compatible IO headers. It comes with 1 GB RAM, 1 Gb ethernet, 2x USB host, sata, hdmi and stereo audio out + various expenansion headers:

http://www.bananapi.org/

---
 arch/arm/boot/dts/Makefile               |   1 +
 arch/arm/boot/dts/sun7i-a20-bananapi.dts | 183 +++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-bananapi.dts
arch/arm/boot/dts/Makefile +1 -0
index bdbc84a..440e037 100644
@@ -379,6 +379,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
 	sun6i-a31-hummingbird.dtb \
 	sun6i-a31-m9.dtb
 dtb-$(CONFIG_MACH_SUN7I) += \
+	sun7i-a20-bananapi.dtb \
 	sun7i-a20-cubieboard2.dtb \
 	sun7i-a20-cubietruck.dtb \
 	sun7i-a20-i12-tvbox.dtb \
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +59 -0
new file mode 100644
index 0000000..0332b82
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2014 Hans de Goede <[email protected]>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "sun7i-a20.dtsi"
+/include/ "sunxi-common-regulators.dtsi"
+
+/ {
+	model = "LeMaker Banana Pi";
+	compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
+
+	soc at 01c00000 {
+		spi0: spi at 01c05000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&spi0_pins_a>;
+			status = "okay";
+		};
+
+		mmc0: mmc at 01c0f000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
+			vmmc-supply = <&reg_vcc3v3>;
+			bus-width = <4>;
+			cd-gpios = <&pio 7 10 0>; /* PH10 */
+			cd-inverted;
+			status = "okay";
+		};
+
+		usbphy: phy at 01c13400 {
+			usb1_vbus-supply = <&reg_usb1_vbus>;
+			usb2_vbus-supply = <&reg_usb2_vbus>;
+			status = "okay";
+		};
+
+		ehci0: usb at 01c14000 {
+			status = "okay";
+		};
+
+		ohci0: usb at 01c14400 {
+			status = "okay";
+		};
+
+		ahci: sata at 01c18000 {
+			status = "okay";
+		};
+
+		ehci1: usb at 01c1c000 {
+			status = "okay";
+		};
+
+		ohci1: usb at 01c1c400 {

arch/arm/boot/dts/sun7i-a20-bananapi.dts line 69

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +10 -0
+			status = "okay";
+		};
+
+		pinctrl at 01c20800 {
+			uart3_pins_bananapi: uart3_pin at 0 {
+				allwinner,pins = "PH0", "PH1";
+				allwinner,function = "uart3";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};

That node should be in the DTSI

Quoted 104 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +104 -0
+
+			mmc0_cd_pin_bananapi: mmc0_cd_pin at 0 {
+				allwinner,pins = "PH10";
+				allwinner,function = "gpio_in";
+				allwinner,drive = <0>;
+				allwinner,pull = <1>;
+			};
+
+			gmac_power_pin_bananapi: gmac_power_pin at 0 {
+				allwinner,pins = "PH23";
+				allwinner,function = "gpio_out";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
+
+			led_pins_bananapi: led_pins at 0 {
+				allwinner,pins = "PH24";
+				allwinner,function = "gpio_out";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
+		};
+
+		ir0: ir at 01c21800 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&ir0_pins_a>;
+			status = "okay";
+		};
+
+		uart0: serial at 01c28000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&uart0_pins_a>;
+			status = "okay";
+		};
+
+		uart3: serial at 01c28c00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&uart3_pins_bananapi>;
+			status = "okay";
+		};
+
+		uart7: serial at 01c29c00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&uart7_pins_a>;
+			status = "okay";
+		};
+
+		i2c0: i2c at 01c2ac00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins_a>;
+			status = "okay";
+
+			axp209: pmic at 34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupt-parent = <&nmi_intc>;
+				interrupts = <0 8>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+			};
+		};
+
+		i2c2: i2c at 01c2b400 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c2_pins_a>;
+			status = "okay";
+		};
+
+		gmac: ethernet at 01c50000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&gmac_pins_rgmii_a>;
+			phy = <&phy1>;
+			phy-mode = "rgmii";
+			phy-supply = <&reg_gmac_3v3>;
+			status = "okay";
+
+			phy1: ethernet-phy at 1 {
+				reg = <1>;
+			};
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_bananapi>;
+
+		green {
+			label = "bananapi:green:usr";
+			gpios = <&pio 7 24 0>;
+		};
+	};
+
+	reg_usb1_vbus: usb1-vbus {
+		status = "okay";
+	};
+
+	reg_usb2_vbus: usb2-vbus {
+		status = "okay";
+	};
+
+	reg_gmac_3v3: gmac-3v3 {
+		compatible = "regulator-fixed";

arch/arm/boot/dts/sun7i-a20-bananapi.dts line 183

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +10 -0
+		pinctrl-names = "default";
+		pinctrl-0 = <&gmac_power_pin_bananapi>;
+		regulator-name = "gmac-3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <50000>;
+		enable-active-high;
+		gpio = <&pio 7 23 0>;
+	};
+};

Looks fine otherwise, thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140731/6f761c60/attachment.sig>
#2 lore raw

PATCH 1/1 ARM: dt: sun7i: Add Banana Pi board

Hi,

Quoted 97 lines · Maxime Ripard

Hi Hans,

Quoted 94 lines · Hans de Goede

The Banana Pi is an A20 based development board using Raspberry Pi compatible IO headers. It comes with 1 GB RAM, 1 Gb ethernet, 2x USB host, sata, hdmi and stereo audio out + various expenansion headers:

http://www.bananapi.org/

---
 arch/arm/boot/dts/Makefile               |   1 +
 arch/arm/boot/dts/sun7i-a20-bananapi.dts | 183 +++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-bananapi.dts
arch/arm/boot/dts/Makefile +1 -0
index bdbc84a..440e037 100644
@@ -379,6 +379,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
 	sun6i-a31-hummingbird.dtb \
 	sun6i-a31-m9.dtb
 dtb-$(CONFIG_MACH_SUN7I) += \
+	sun7i-a20-bananapi.dtb \
 	sun7i-a20-cubieboard2.dtb \
 	sun7i-a20-cubietruck.dtb \
 	sun7i-a20-i12-tvbox.dtb \
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +63 -0
new file mode 100644
index 0000000..0332b82
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2014 Hans de Goede <[email protected]>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "sun7i-a20.dtsi"
+/include/ "sunxi-common-regulators.dtsi"
+
+/ {
+	model = "LeMaker Banana Pi";
+	compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
+
+	soc at 01c00000 {
+		spi0: spi at 01c05000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&spi0_pins_a>;
+			status = "okay";
+		};
+
+		mmc0: mmc at 01c0f000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
+			vmmc-supply = <&reg_vcc3v3>;
+			bus-width = <4>;
+			cd-gpios = <&pio 7 10 0>; /* PH10 */
+			cd-inverted;
+			status = "okay";
+		};
+
+		usbphy: phy at 01c13400 {
+			usb1_vbus-supply = <&reg_usb1_vbus>;
+			usb2_vbus-supply = <&reg_usb2_vbus>;
+			status = "okay";
+		};
+
+		ehci0: usb at 01c14000 {
+			status = "okay";
+		};
+
+		ohci0: usb at 01c14400 {
+			status = "okay";
+		};
+
+		ahci: sata at 01c18000 {
+			status = "okay";
+		};
+
+		ehci1: usb at 01c1c000 {
+			status = "okay";
+		};
+
+		ohci1: usb at 01c1c400 {
+			status = "okay";
+		};
+
+		pinctrl at 01c20800 {
Quoted 8 lines

arch/arm/boot/dts/sun7i-a20-bananapi.dts line 69

Quoted 6 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +6 -0
+			uart3_pins_bananapi: uart3_pin at 0 {
+				allwinner,pins = "PH0", "PH1";
+				allwinner,function = "uart3";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};

That node should be in the DTSI

I deliberately put it here because it is non standard, uart3 has 4 pins rx, tx, cts and rts, which can be mapped to either PG6-9 or PH0-3 but here only 2 are used, it seemed appropriate to put this inside the dts, if we start also taking pinctrl variants where a subset of the pins are used into the dtsi then we will end up with a lot of pinctrl entries there.

Note if you decide to take this as is, please s/bananapi.org/lemaker.org/ in the commit message, bananapi.org is an unofficial site, I should have put lemaker.org there.

Note btw that we already have this problem for spi1, the current spi1_pins_a does not include the cs1 pin, because it was added for use in sun7i-a20-olinuxino-micro.dts where only cs0 is hooked up, but I decided to leave that as is for now.

Also the "primary" binding for spi2 is to PORTB, but our spi2_pins_a binds it to PORTC, so it should be renamed spi2_pins_b IMHO.

Regards,

Hans

#3 lore raw

PATCH 1/1 ARM: dt: sun7i: Add Banana Pi board

Quoted 109 lines · Hans de Goede

Hi,

Quoted 97 lines · Maxime Ripard

Hi Hans,

Quoted 94 lines · Hans de Goede

The Banana Pi is an A20 based development board using Raspberry Pi compatible IO headers. It comes with 1 GB RAM, 1 Gb ethernet, 2x USB host, sata, hdmi and stereo audio out + various expenansion headers:

http://www.bananapi.org/

---
 arch/arm/boot/dts/Makefile               |   1 +
 arch/arm/boot/dts/sun7i-a20-bananapi.dts | 183 +++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-bananapi.dts
arch/arm/boot/dts/Makefile +1 -0
index bdbc84a..440e037 100644
@@ -379,6 +379,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
 	sun6i-a31-hummingbird.dtb \
 	sun6i-a31-m9.dtb
 dtb-$(CONFIG_MACH_SUN7I) += \
+	sun7i-a20-bananapi.dtb \
 	sun7i-a20-cubieboard2.dtb \
 	sun7i-a20-cubietruck.dtb \
 	sun7i-a20-i12-tvbox.dtb \
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +63 -0
new file mode 100644
index 0000000..0332b82
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2014 Hans de Goede <[email protected]>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "sun7i-a20.dtsi"
+/include/ "sunxi-common-regulators.dtsi"
+
+/ {
+	model = "LeMaker Banana Pi";
+	compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
+
+	soc at 01c00000 {
+		spi0: spi at 01c05000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&spi0_pins_a>;
+			status = "okay";
+		};
+
+		mmc0: mmc at 01c0f000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
+			vmmc-supply = <&reg_vcc3v3>;
+			bus-width = <4>;
+			cd-gpios = <&pio 7 10 0>; /* PH10 */
+			cd-inverted;
+			status = "okay";
+		};
+
+		usbphy: phy at 01c13400 {
+			usb1_vbus-supply = <&reg_usb1_vbus>;
+			usb2_vbus-supply = <&reg_usb2_vbus>;
+			status = "okay";
+		};
+
+		ehci0: usb at 01c14000 {
+			status = "okay";
+		};
+
+		ohci0: usb at 01c14400 {
+			status = "okay";
+		};
+
+		ahci: sata at 01c18000 {
+			status = "okay";
+		};
+
+		ehci1: usb at 01c1c000 {
+			status = "okay";
+		};
+
+		ohci1: usb at 01c1c400 {
+			status = "okay";
+		};
+
+		pinctrl at 01c20800 {
Quoted 8 lines

arch/arm/boot/dts/sun7i-a20-bananapi.dts line 69

Quoted 6 lines
arch/arm/boot/dts/sun7i-a20-bananapi.dts new file +6 -0
+			uart3_pins_bananapi: uart3_pin at 0 {
+				allwinner,pins = "PH0", "PH1";
+				allwinner,function = "uart3";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};

That node should be in the DTSI

Quoted 6 lines

I deliberately put it here because it is non standard, uart3 has 4 pins rx, tx, cts and rts, which can be mapped to either PG6-9 or PH0-3 but here only 2 are used, it seemed appropriate to put this inside the dts, if we start also taking pinctrl variants where a subset of the pins are used into the dtsi then we will end up with a lot of pinctrl entries there.

We're already pretty much in that situation, and most UART (aside from UART0) can work with at least 4 pins, so it's nothing new really.

There was some patches made to DTC at some point to garbage collect specifically flagged nodes when they're not referenced, which would prevent the DTB size to get too big. I'm not sure about the status of these patches though.

But it's definitely something that is worked on, and we shouldn't worry too much about it.

Quoted 9 lines

Note if you decide to take this as is, please s/bananapi.org/lemaker.org/ in the commit message, bananapi.org is an unofficial site, I should have put lemaker.org there.

Note btw that we already have this problem for spi1, the current spi1_pins_a does not include the cs1 pin, because it was added for use in sun7i-a20-olinuxino-micro.dts where only cs0 is hooked up, but I decided to leave that as is for now.

Yeah, that's another issue, maybe we should split the SPI pinctrl nodes then, to have the "main" pins (CLK, MISO, MOSI), and then individual nodes for each chip select.

Quoted 3 lines

Also the "primary" binding for spi2 is to PORTB, but our spi2_pins_a binds it to PORTC, so it should be renamed spi2_pins_b IMHO.

I don't have any opinion on this, I was applying the "whoever is first wins" on this, but if you come up with a better and more sensible policy, it's totally fine for me :)

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140731/05a22716/attachment.sig>