Skip to contentSkip to conversation

ARM: dts: sun5i: Enable otg on the auxtex t004

PATCH New Hans de Goede 2 participants 11 messages Jun 29, 2016 – Jul 5, 2016

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

PATCH 1/4 ARM: dts: sun5i: Enable otg on the auxtex t004

The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case people use it to power the board instead of the dedicated power micro usb connector), it does have an id pin, so it allows full otg functionality.

---
 arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts +19 -0
index e15d1ef..7ddebce 100644
@@ -130,7 +130,18 @@
 	status = "okay";
 };
 
+&otg_sram {
+	status = "okay";
+};
+
 &pio {
+	usb0_id_detect_pin: usb0_id_detect_pin at 0 {
+		allwinner,pins = "PG12";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+
 	mmc0_cd_pin_t004: mmc0_cd_pin at 0 {
 		allwinner,pins = "PG1";
 		allwinner,function = "gpio_in";
@@ -164,11 +175,19 @@
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
 &usb1_vbus_pin_a {
 	allwinner,pins = "PG13";
 };
 
 &usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_id_detect_pin>;
+	usb0_id_det-gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
 	usb1_vbus-supply = <&reg_usb1_vbus>;
 	status = "okay";
 };
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/4 ARM: dts: sun5i: Enable otg on the mk802

Enable the otg controller, the id pin is not connected so enable it in peripheral only mode.

---
 arch/arm/boot/dts/sun5i-a10s-mk802.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/sun5i-a10s-mk802.dts +9 -0
index 46ff940..0bb5755 100644
@@ -87,6 +87,10 @@
 	status = "okay";
 };
 
+&otg_sram {
+	status = "okay";
+};
+
 &pio {
 	led_pins_mk802: led_pins at 0 {
 		allwinner,pins = "PB2";
@@ -122,6 +126,11 @@
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
 &usbphy {
 	usb1_vbus-supply = <&reg_usb1_vbus>;
 	status = "okay";
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/4 ARM: dts: sun5i: Enable otg on the mk802

Quoted 4 lines · Hans de Goede

Enable the otg controller, the id pin is not connected so enable it in peripheral only mode.

Applied, 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: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160629/b5b8f242/attachment.sig>
#3 lore raw

PATCH 3/4 ARM: dts: sun5i: Add axp152 pmic node to mk802

In reply to Hans de Goede

Add a node describing the axp152 pmic to the mk802 dts, note there are no regulator nodes as we do not yet support the regulators on the axp152.

---
 arch/arm/boot/dts/sun5i-a10s-mk802.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/sun5i-a10s-mk802.dts +14 -0
index 0bb5755..04120e1 100644
@@ -73,6 +73,20 @@
 	status = "okay";
 };
 
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins_a>;
+	status = "okay";
+
+	axp152: pmic at 30 {
+		compatible = "x-powers,axp152";
+		reg = <0x30>;
+		interrupts = <0>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_mk802>;
Signature · 1 line
2.7.4
#4 lore raw

PATCH 3/4 ARM: dts: sun5i: Add axp152 pmic node to mk802

Quoted 5 lines · Hans de Goede

Add a node describing the axp152 pmic to the mk802 dts, note there are no regulator nodes as we do not yet support the regulators on the axp152.

Applied, 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: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160629/5596b5f1/attachment.sig>
#5 lore raw

PATCH 4/4 ARM: dts: sun5i: Add mmc1 / sdio-wifi node to mk802

In reply to Hans de Goede

The a10s mk802 uses a rtl8189es sdio wifi chip, add a node enabling the mmc1 controller, this enables using the wifi chip (together with an out of tree sdio driver for it).

---
 arch/arm/boot/dts/sun5i-a10s-mk802.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/sun5i-a10s-mk802.dts +9 -0
index 04120e1..c84ac00 100644
@@ -97,6 +97,15 @@
 	status = "okay";
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci0 {
 	status = "okay";
 };
Signature · 1 line
2.7.4
#6 lore raw

PATCH 4/4 ARM: dts: sun5i: Add mmc1 / sdio-wifi node to mk802

Quoted 5 lines · Hans de Goede

The a10s mk802 uses a rtl8189es sdio wifi chip, add a node enabling the mmc1 controller, this enables using the wifi chip (together with an out of tree sdio driver for it).

Applied, thanks!

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: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160629/97fb5f15/attachment.sig>
#7 lore raw

PATCH 1/4 ARM: dts: sun5i: Enable otg on the auxtex t004

In reply to Hans de Goede

Hi,

Quoted 4 lines · Hans de Goede

The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case people use it to power the board instead of the dedicated power micro usb connector), it does have an id pin, so it allows full otg functionality.

I don't really get what you're saying here. Is the VBUS hardcoded to 5V, without any way to switch it, or it is not wired at all?

In the former case, how can one of the PMIC output be related to the board power input?

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: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160629/7630b06c/attachment.sig>
#8 lore raw

Hi,

Quoted 10 lines · Maxime Ripard

Hi,

Quoted 4 lines · Hans de Goede

The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case people use it to power the board instead of the dedicated power micro usb connector), it does have an id pin, so it allows full otg functionality.

I don't really get what you're saying here. Is the VBUS hardcoded to 5V, without any way to switch it, or it is not wired at all?

It is hardwired to 5v, quoting from my commit msg
"has its otg usb vbus hardwired to 5v"

Quoted 2 lines

In the former case, how can one of the PMIC output be related to the board power input?

I believe it is not wired to the pmic output, but to the pmic 5v input.

Regards,

Hans

#9 lore raw
Quoted 14 lines · Hans de Goede

Hi,

Quoted 10 lines · Maxime Ripard

Hi,

Quoted 4 lines · Hans de Goede

The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case people use it to power the board instead of the dedicated power micro usb connector), it does have an id pin, so it allows full otg functionality.

I don't really get what you're saying here. Is the VBUS hardcoded to 5V, without any way to switch it, or it is not wired at all?

Quoted 7 lines

It is hardwired to 5v, quoting from my commit msg
"has its otg usb vbus hardwired to 5v"

Quoted 2 lines

In the former case, how can one of the PMIC output be related to the board power input?

I believe it is not wired to the pmic output, but to the pmic 5v input.

Weird. Ok, I just applied it.

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: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160705/47a7195d/attachment-0001.sig>
#10 lore raw

Hi,

Quoted 18 lines · Maxime Ripard
Quoted 17 lines · Hans de Goede

Hi,

Quoted 10 lines · Maxime Ripard

Hi,

Quoted 4 lines · Hans de Goede

The auxtek t004 has its otg usb vbus hardwired to 5v (likely in case people use it to power the board instead of the dedicated power micro usb connector), it does have an id pin, so it allows full otg functionality.

I don't really get what you're saying here. Is the VBUS hardcoded to 5V, without any way to switch it, or it is not wired at all?

It is hardwired to 5v, quoting from my commit msg
"has its otg usb vbus hardwired to 5v"

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

In the former case, how can one of the PMIC output be related to the board power input?

I believe it is not wired to the pmic output, but to the pmic 5v input.

Weird.

This is an a10s based hdmi stick, with a axp152 pmic, which does not have separate ac-in / vbus-in and the matching ips out and selection logic. So I guess that when using this pmic boards just wire all the dcdc vin-s to 5v. As said this hdmi dongle has 2 micro-usb connectors one for power only and one for otg. I believe that also want to be able to power the dongle from just the otg (e.g. when connected to a pc), at which point wiring its 5v to the 5v of the micro-usb power connector aka THE 5v line is pretty much the only thing they can do. Note this is all based on observation, no schematics available.

Quoted 1 line

Ok, I just applied it.

Thanks.

Regards,

Hans