All of lore.kernel.org
 help / color / mirror / Atom feed
From: Icenowy Zheng <icenowy@aosc.io>
To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com,
	Icenowy Zheng <icenowy@aosc.io>
Subject: [PATCH] ARM: dts: sun8i: r40/v40: rewrite BPi M2 Berry DTS to rebase on M2 Ultra
Date: Wed, 25 Jul 2018 00:36:55 +0800	[thread overview]
Message-ID: <20180724163655.61365-1-icenowy@aosc.io> (raw)

Banana Pi designs the BPi M2 Berry board to be software compatible with
BPi M2 Ultra, so it's based on M2 Ultra with some function cuts,
including:

- 2048MiB DRAM -> 1024MiB (this should be proceed by the bootloader);
- dropped a LED;
- dropped eMMC;
- dropped USB2 and connect USB1 to a 4-port HUB.

Thus we can make the M2 Berry device tree based on the M2 Ultra, rather
than write one from scratch.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  | 141 +++---------------
 1 file changed, 24 insertions(+), 117 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 35859d8f3267..b740c659e623 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -40,143 +40,50 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/dts-v1/;
-#include "sun8i-r40.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
+#include "sun8i-r40-bananapi-m2-ultra.dts"
 
 / {
 	model = "Banana Pi M2 Berry";
 	compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
 
-	aliases {
-		serial0 = &uart0;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
 	leds {
-		compatible = "gpio-leds";
-
-		pwr-led {
-			label = "bananapi:red:pwr";
-			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-
-		user-led {
-			label = "bananapi:green:user";
-			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
-	reg_vcc5v0: vcc5v0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc5v0";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
-		enable-active-high;
-	};
-
-	wifi_pwrseq: wifi_pwrseq {
-		compatible = "mmc-pwrseq-simple";
-		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
+		/* M2 Berry dropped blue LED due to size */
+		/delete-node/ user-led-blue;
 	};
 };
 
 &ehci1 {
 	/* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
-	status = "okay";
-};
-
-&i2c0 {
-	status = "okay";
-
-	axp22x: pmic@68 {
-		compatible = "x-powers,axp221";
-		reg = <0x34>;
-		interrupt-parent = <&nmi_intc>;
-		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-	};
-};
-
-#include "axp22x.dtsi"
-
-&reg_aldo3 {
-	regulator-always-on;
-	regulator-min-microvolt = <2700000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "avcc";
-};
-
-&reg_dcdc1 {
-	regulator-always-on;
-	regulator-min-microvolt = <3000000>;
-	regulator-max-microvolt = <3000000>;
-	regulator-name = "vcc-3v0";
-};
-
-&reg_dcdc2 {
-	regulator-always-on;
-	regulator-min-microvolt = <1000000>;
-	regulator-max-microvolt = <1300000>;
-	regulator-name = "vdd-cpu";
-};
-
-&reg_dcdc3 {
-	regulator-always-on;
-	regulator-min-microvolt = <1000000>;
-	regulator-max-microvolt = <1300000>;
-	regulator-name = "vdd-sys";
-};
-
-&reg_dcdc5 {
-	regulator-always-on;
-	regulator-min-microvolt = <1500000>;
-	regulator-max-microvolt = <1500000>;
-	regulator-name = "vcc-dram";
-};
-
-&reg_dldo1 {
-	regulator-min-microvolt = <1800000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "vcc-wifi-io";
 };
 
-&reg_dldo2 {
-	regulator-min-microvolt = <3300000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "vcc-wifi";
+&ehci2 {
+	/*
+	 * M2 Berry dropped wiring out USB2, due to all USB port is
+	 * from a hub at USB1.
+	 */
+	status = "disabled";
 };
 
-&mmc0 {
-	vmmc-supply = <&reg_dcdc1>;
-	bus-width = <4>;
-	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
-	status = "okay";
+&mmc2 {
+	/* M2 Berry has no eMMC */
+	status = "disabled";
 };
 
-&mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pg_pins>;
-	vmmc-supply = <&reg_dldo2>;
-	vqmmc-supply = <&reg_dldo1>;
-	mmc-pwrseq = <&wifi_pwrseq>;
-	bus-width = <4>;
-	non-removable;
-	status = "okay";
+&ohci1 {
+	/*
+	 * M2 Berry have a Hub connected to the USB1 pins, so no USB1.1 device
+	 * can be directly connected to the USB1 port, thus the OHCI controller
+	 * can be disabled.
+	 */
+	status = "disabled";
 };
 
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pb_pins>;
-	status = "okay";
+&ohci2 {
+	/* See comments at &ehci2 */
+	status = "disabled";
 };
 
 &usbphy {
-	usb1_vbus-supply = <&reg_vcc5v0>;
-	status = "okay";
+	/* See comments at &ehci2 */
+	/delete-property/ usb2_vbus-supply;
 };
-- 
2.18.0


WARNING: multiple messages have this Message-ID (diff)
From: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
To: Maxime Ripard
	<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
Subject: [PATCH] ARM: dts: sun8i: r40/v40: rewrite BPi M2 Berry DTS to rebase on M2 Ultra
Date: Wed, 25 Jul 2018 00:36:55 +0800	[thread overview]
Message-ID: <20180724163655.61365-1-icenowy@aosc.io> (raw)

Banana Pi designs the BPi M2 Berry board to be software compatible with
BPi M2 Ultra, so it's based on M2 Ultra with some function cuts,
including:

- 2048MiB DRAM -> 1024MiB (this should be proceed by the bootloader);
- dropped a LED;
- dropped eMMC;
- dropped USB2 and connect USB1 to a 4-port HUB.

Thus we can make the M2 Berry device tree based on the M2 Ultra, rather
than write one from scratch.

Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
---
 .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  | 141 +++---------------
 1 file changed, 24 insertions(+), 117 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 35859d8f3267..b740c659e623 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -40,143 +40,50 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/dts-v1/;
-#include "sun8i-r40.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
+#include "sun8i-r40-bananapi-m2-ultra.dts"
 
 / {
 	model = "Banana Pi M2 Berry";
 	compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
 
-	aliases {
-		serial0 = &uart0;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
 	leds {
-		compatible = "gpio-leds";
-
-		pwr-led {
-			label = "bananapi:red:pwr";
-			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-
-		user-led {
-			label = "bananapi:green:user";
-			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
-	reg_vcc5v0: vcc5v0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc5v0";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
-		enable-active-high;
-	};
-
-	wifi_pwrseq: wifi_pwrseq {
-		compatible = "mmc-pwrseq-simple";
-		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
+		/* M2 Berry dropped blue LED due to size */
+		/delete-node/ user-led-blue;
 	};
 };
 
 &ehci1 {
 	/* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
-	status = "okay";
-};
-
-&i2c0 {
-	status = "okay";
-
-	axp22x: pmic@68 {
-		compatible = "x-powers,axp221";
-		reg = <0x34>;
-		interrupt-parent = <&nmi_intc>;
-		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-	};
-};
-
-#include "axp22x.dtsi"
-
-&reg_aldo3 {
-	regulator-always-on;
-	regulator-min-microvolt = <2700000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "avcc";
-};
-
-&reg_dcdc1 {
-	regulator-always-on;
-	regulator-min-microvolt = <3000000>;
-	regulator-max-microvolt = <3000000>;
-	regulator-name = "vcc-3v0";
-};
-
-&reg_dcdc2 {
-	regulator-always-on;
-	regulator-min-microvolt = <1000000>;
-	regulator-max-microvolt = <1300000>;
-	regulator-name = "vdd-cpu";
-};
-
-&reg_dcdc3 {
-	regulator-always-on;
-	regulator-min-microvolt = <1000000>;
-	regulator-max-microvolt = <1300000>;
-	regulator-name = "vdd-sys";
-};
-
-&reg_dcdc5 {
-	regulator-always-on;
-	regulator-min-microvolt = <1500000>;
-	regulator-max-microvolt = <1500000>;
-	regulator-name = "vcc-dram";
-};
-
-&reg_dldo1 {
-	regulator-min-microvolt = <1800000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "vcc-wifi-io";
 };
 
-&reg_dldo2 {
-	regulator-min-microvolt = <3300000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "vcc-wifi";
+&ehci2 {
+	/*
+	 * M2 Berry dropped wiring out USB2, due to all USB port is
+	 * from a hub at USB1.
+	 */
+	status = "disabled";
 };
 
-&mmc0 {
-	vmmc-supply = <&reg_dcdc1>;
-	bus-width = <4>;
-	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
-	status = "okay";
+&mmc2 {
+	/* M2 Berry has no eMMC */
+	status = "disabled";
 };
 
-&mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pg_pins>;
-	vmmc-supply = <&reg_dldo2>;
-	vqmmc-supply = <&reg_dldo1>;
-	mmc-pwrseq = <&wifi_pwrseq>;
-	bus-width = <4>;
-	non-removable;
-	status = "okay";
+&ohci1 {
+	/*
+	 * M2 Berry have a Hub connected to the USB1 pins, so no USB1.1 device
+	 * can be directly connected to the USB1 port, thus the OHCI controller
+	 * can be disabled.
+	 */
+	status = "disabled";
 };
 
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pb_pins>;
-	status = "okay";
+&ohci2 {
+	/* See comments at &ehci2 */
+	status = "disabled";
 };
 
 &usbphy {
-	usb1_vbus-supply = <&reg_vcc5v0>;
-	status = "okay";
+	/* See comments at &ehci2 */
+	/delete-property/ usb2_vbus-supply;
 };
-- 
2.18.0

WARNING: multiple messages have this Message-ID (diff)
From: icenowy@aosc.io (Icenowy Zheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: dts: sun8i: r40/v40: rewrite BPi M2 Berry DTS to rebase on M2 Ultra
Date: Wed, 25 Jul 2018 00:36:55 +0800	[thread overview]
Message-ID: <20180724163655.61365-1-icenowy@aosc.io> (raw)

Banana Pi designs the BPi M2 Berry board to be software compatible with
BPi M2 Ultra, so it's based on M2 Ultra with some function cuts,
including:

- 2048MiB DRAM -> 1024MiB (this should be proceed by the bootloader);
- dropped a LED;
- dropped eMMC;
- dropped USB2 and connect USB1 to a 4-port HUB.

Thus we can make the M2 Berry device tree based on the M2 Ultra, rather
than write one from scratch.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 .../boot/dts/sun8i-v40-bananapi-m2-berry.dts  | 141 +++---------------
 1 file changed, 24 insertions(+), 117 deletions(-)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 35859d8f3267..b740c659e623 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -40,143 +40,50 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/dts-v1/;
-#include "sun8i-r40.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
+#include "sun8i-r40-bananapi-m2-ultra.dts"
 
 / {
 	model = "Banana Pi M2 Berry";
 	compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
 
-	aliases {
-		serial0 = &uart0;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
 	leds {
-		compatible = "gpio-leds";
-
-		pwr-led {
-			label = "bananapi:red:pwr";
-			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-
-		user-led {
-			label = "bananapi:green:user";
-			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
-	reg_vcc5v0: vcc5v0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc5v0";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
-		enable-active-high;
-	};
-
-	wifi_pwrseq: wifi_pwrseq {
-		compatible = "mmc-pwrseq-simple";
-		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
+		/* M2 Berry dropped blue LED due to size */
+		/delete-node/ user-led-blue;
 	};
 };
 
 &ehci1 {
 	/* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
-	status = "okay";
-};
-
-&i2c0 {
-	status = "okay";
-
-	axp22x: pmic at 68 {
-		compatible = "x-powers,axp221";
-		reg = <0x34>;
-		interrupt-parent = <&nmi_intc>;
-		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-	};
-};
-
-#include "axp22x.dtsi"
-
-&reg_aldo3 {
-	regulator-always-on;
-	regulator-min-microvolt = <2700000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "avcc";
-};
-
-&reg_dcdc1 {
-	regulator-always-on;
-	regulator-min-microvolt = <3000000>;
-	regulator-max-microvolt = <3000000>;
-	regulator-name = "vcc-3v0";
-};
-
-&reg_dcdc2 {
-	regulator-always-on;
-	regulator-min-microvolt = <1000000>;
-	regulator-max-microvolt = <1300000>;
-	regulator-name = "vdd-cpu";
-};
-
-&reg_dcdc3 {
-	regulator-always-on;
-	regulator-min-microvolt = <1000000>;
-	regulator-max-microvolt = <1300000>;
-	regulator-name = "vdd-sys";
-};
-
-&reg_dcdc5 {
-	regulator-always-on;
-	regulator-min-microvolt = <1500000>;
-	regulator-max-microvolt = <1500000>;
-	regulator-name = "vcc-dram";
-};
-
-&reg_dldo1 {
-	regulator-min-microvolt = <1800000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "vcc-wifi-io";
 };
 
-&reg_dldo2 {
-	regulator-min-microvolt = <3300000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "vcc-wifi";
+&ehci2 {
+	/*
+	 * M2 Berry dropped wiring out USB2, due to all USB port is
+	 * from a hub at USB1.
+	 */
+	status = "disabled";
 };
 
-&mmc0 {
-	vmmc-supply = <&reg_dcdc1>;
-	bus-width = <4>;
-	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
-	status = "okay";
+&mmc2 {
+	/* M2 Berry has no eMMC */
+	status = "disabled";
 };
 
-&mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pg_pins>;
-	vmmc-supply = <&reg_dldo2>;
-	vqmmc-supply = <&reg_dldo1>;
-	mmc-pwrseq = <&wifi_pwrseq>;
-	bus-width = <4>;
-	non-removable;
-	status = "okay";
+&ohci1 {
+	/*
+	 * M2 Berry have a Hub connected to the USB1 pins, so no USB1.1 device
+	 * can be directly connected to the USB1 port, thus the OHCI controller
+	 * can be disabled.
+	 */
+	status = "disabled";
 };
 
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pb_pins>;
-	status = "okay";
+&ohci2 {
+	/* See comments at &ehci2 */
+	status = "disabled";
 };
 
 &usbphy {
-	usb1_vbus-supply = <&reg_vcc5v0>;
-	status = "okay";
+	/* See comments at &ehci2 */
+	/delete-property/ usb2_vbus-supply;
 };
-- 
2.18.0

             reply	other threads:[~2018-07-24 16:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 16:36 Icenowy Zheng [this message]
2018-07-24 16:36 ` [PATCH] ARM: dts: sun8i: r40/v40: rewrite BPi M2 Berry DTS to rebase on M2 Ultra Icenowy Zheng
2018-07-24 16:36 ` Icenowy Zheng
2018-07-24 18:36 ` Simon Baatz
2018-07-24 18:36   ` Simon Baatz
2018-07-26 12:41 ` Maxime Ripard
2018-07-26 12:41   ` Maxime Ripard
2018-07-26 12:41   ` Maxime Ripard
2018-07-26 12:47   ` Icenowy Zheng
2018-07-26 12:47     ` Icenowy Zheng
2018-07-26 12:47     ` Icenowy Zheng
2018-07-26 15:24     ` Maxime Ripard
2018-07-26 15:24       ` Maxime Ripard
2018-07-26 15:24       ` Maxime Ripard
2018-07-26 15:26       ` Icenowy Zheng
2018-07-26 15:26         ` Icenowy Zheng
2018-07-26 15:26         ` Icenowy Zheng
2018-08-08 10:36   ` [linux-sunxi] " Icenowy Zheng
2018-08-08 10:36     ` Icenowy Zheng
2018-08-20 12:00     ` Maxime Ripard
2018-08-20 12:00       ` Maxime Ripard
2018-08-20 12:00       ` Maxime Ripard
2018-08-20 12:06       ` [linux-sunxi] " Icenowy Zheng
2018-08-20 12:06         ` Icenowy Zheng
2018-08-20 12:06         ` Icenowy Zheng
2018-08-20 15:02         ` [linux-sunxi] " Maxime Ripard
2018-08-20 15:02           ` Maxime Ripard
2018-08-20 15:02           ` Maxime Ripard

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=20180724163655.61365-1-icenowy@aosc.io \
    --to=icenowy@aosc.io \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@bootlin.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.