Skip to contentSkip to conversation

ARM: dts: sun7i: BPI-M1+ USB support

PATCH Applied Chen-Yu Tsai 2 participants 5 messages Nov 15, 2016

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

v2 cover ARM: dts: sun7i: BPI-M1+ USB support

Hi Maxime,

These are the remaining patches of my BPI-M1+ fixes series from July.

Changes since v1:

- Split out USB PHY enable patch.

- Dropped custom OPP table. Tested the A20 default one with cpufreq-ljt-stress-test and it seemed stable.

- Dropped voltage range for cpu supply regulator to normal 1.0V ~ 1.4V.

- Dropped pinmux setting for OTG ID pin.

Please have a look.

Regards
ChenYu

Chen-Yu Tsai (3):
ARM: dts: sun7i: bananapi-m1-plus: Enable USB PHY for USB host support
ARM: dts: sun7i: bananapi-m1-plus: Add PMIC regulators
ARM: dts: sun7i: bananapi-m1-plus: Enable USB OTG

 arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts | 60 ++++++++++++++++++++++--
 1 file changed, 56 insertions(+), 4 deletions(-)
Signature · 1 line
2.10.2
#1 lore raw

PATCH v2 1/3 ARM: dts: sun7i: bananapi-m1-plus: Enable USB PHY for USB host support

The 2 USB host ports are directly tied to the 2 USB hosts in the SoC. The 2 host pairs were already enabled, but the USB PHY wasn't. VBUS on the 2 ports are always on.

Enable the USB PHY.

Fixes 04c85ecad32a ("ARM: dts: sun7i: Add dts file for Bananapi M1 Plus
		      board")
---
 arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts +5 -0
index ba5bca0fe997..44377a98cc89 100644
@@ -227,3 +227,8 @@
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
+
+&usbphy {
+	/* VBUS on usb host ports are tied to DC5V and therefore always on */
+	status = "okay";
+};
Signature · 1 line
2.10.2
#2 lore raw

PATCH v2 2/3 ARM: dts: sun7i: bananapi-m1-plus: Add PMIC regulators

In reply to Chen-Yu Tsai

The Bananapi M1+, like other Allwinner A20 based boards, uses the AXP209 PMIC to supply its power.

Add the AXP209 regulators.

---
 arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts | 35 +++++++++++++++++++++---
 1 file changed, 31 insertions(+), 4 deletions(-)
arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts +31 -4
index 44377a98cc89..ac19630c1c23 100644
@@ -105,6 +105,10 @@
 	status = "okay";
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &ehci0 {
 	status = "okay";
 };
@@ -132,16 +136,14 @@
 	status = "okay";
 
 	axp209: pmic at 34 {
-		compatible = "x-powers,axp209";
 		reg = <0x34>;
 		interrupt-parent = <&nmi_intc>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-		interrupt-controller;
-		#interrupt-cells = <1>;
 	};
 };
 
+#include "axp209.dtsi"
+
 &ir0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&ir0_rx_pins_a>;
@@ -222,6 +224,31 @@
 	};
 };
 
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1400000>;
+	regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1400000>;
+	regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+	regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "avcc";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
Signature · 1 line
2.10.2
#3 lore raw

PATCH v2 3/3 ARM: dts: sun7i: bananapi-m1-plus: Enable USB OTG

In reply to Chen-Yu Tsai

The Bananapi M1+ supports USB OTG, with the PMIC doing VBUS sensing. Enable the USB OTG related functions.

---
 arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts +20 -0
index ac19630c1c23..5f7114e13850 100644
@@ -194,6 +194,10 @@
 	status = "okay";
 };
 
+&otg_sram {
+	status = "okay";
+};
+
 &pio {
 	gmac_power_pin_bpi_m1p: gmac_power_pin at 0 {
 		allwinner,pins = "PH23";
@@ -249,13 +253,29 @@
 	regulator-name = "avcc";
 };
 
+&reg_usb0_vbus {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usb_power_supply {
+	status = "okay";
+};
+
 &usbphy {
+	usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+	usb0_vbus_power-supply = <&usb_power_supply>;
+	usb0_vbus-supply = <&reg_usb0_vbus>;
 	/* VBUS on usb host ports are tied to DC5V and therefore always on */
 	status = "okay";
 };
Signature · 1 line
2.10.2
#4 lore raw
In reply to Chen-Yu Tsai
Quoted 6 lines · Chen-Yu Tsai

Hi Maxime,

These are the remaining patches of my BPI-M1+ fixes series from July.

Changes since v1:

Quoted 8 lines

- Split out USB PHY enable patch.

- Dropped custom OPP table. Tested the A20 default one with cpufreq-ljt-stress-test and it seemed stable.

- Dropped voltage range for cpu supply regulator to normal 1.0V ~ 1.4V.

- Dropped pinmux setting for OTG ID pin.

Applied all three, thanks!
Maxime

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