All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] Enable the host controller and hub on PopMetal board
@ 2016-11-09  7:30 Kever Yang
  2016-11-09  7:30 ` [U-Boot] [PATCH 1/3] dts: popmetal: add usb host power supply node Kever Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kever Yang @ 2016-11-09  7:30 UTC (permalink / raw)
  To: u-boot


The PopMetal board based on rk3288 SoC have 3 USB 2.0 host ports from
a usb 2.0 hub which connect to the rk3288 usb host1.

This patch set enable those ports by enable the rk3288 usb host controller
driver and usb host function like storage and ether, enable the port
power and de-assert the hub reset signal.

Test with U-disk on Popmetal board.
=> usb start
starting USB...
USB0:   Core Release: 3.10a
scanning bus 0 for devices... ** First descriptor is NOT a primary desc
on 0:1 **
3 USB Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
=> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
  |   U-Boot Root Hub
  |
  +-2  Hub (480 Mb/s, 100mA)
    |   USB 2.0 Hub
    |
    +-3  Mass Storage (480 Mb/s, 300mA)
         Kingston DataTraveler G2 001D92AD7612B91113680066



Kever Yang (3):
  dts: popmetal: add usb host power supply node
  config: popmetal: enable the USB host controller and function
  board: popmetal: enable the usb host port power in board init

 arch/arm/dts/rk3288-popmetal.dtsi                 | 22 ++++++++++++++++
 board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 31 +++++++++++++++++++++++
 configs/popmetal-rk3288_defconfig                 |  3 +++
 include/configs/rk3288_common.h                   |  7 +++++
 4 files changed, 63 insertions(+)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 1/3] dts: popmetal: add usb host power supply node
  2016-11-09  7:30 [U-Boot] [PATCH 0/3] Enable the host controller and hub on PopMetal board Kever Yang
@ 2016-11-09  7:30 ` Kever Yang
  2016-11-11 16:17   ` Simon Glass
  2016-11-09  7:30 ` [U-Boot] [PATCH 2/3] config: popmetal: enable the USB host controller and function Kever Yang
  2016-11-09  7:30 ` [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init Kever Yang
  2 siblings, 1 reply; 9+ messages in thread
From: Kever Yang @ 2016-11-09  7:30 UTC (permalink / raw)
  To: u-boot

The popmetal board using a HOST_VBUS_DRV gpio signal to control the
USB host port 5V power, add a fix regulator and pinctrl for it, and
enable the USB host1 controller at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/dts/rk3288-popmetal.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/dts/rk3288-popmetal.dtsi b/arch/arm/dts/rk3288-popmetal.dtsi
index f3bd468..4382860 100644
--- a/arch/arm/dts/rk3288-popmetal.dtsi
+++ b/arch/arm/dts/rk3288-popmetal.dtsi
@@ -145,6 +145,18 @@
 		regulator-always-on;
 		vin-supply = <&vcc_io>;
 	};
+
+	vcc5v0_host: usb-host-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&host_vbus_drv>;
+		regulator-name = "vcc5v0_host";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
 
 &cpu0 {
@@ -471,6 +483,12 @@
 			rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	usb_host {
+		host_vbus_drv: host-vbus-drv {
+			rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &tsadc {
@@ -515,6 +533,10 @@
 	status = "okay";
 };
 
+&usb_host1 {
+	status = "okay";
+};
+
 &usbphy {
 	status = "okay";
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 2/3] config: popmetal: enable the USB host controller and function
  2016-11-09  7:30 [U-Boot] [PATCH 0/3] Enable the host controller and hub on PopMetal board Kever Yang
  2016-11-09  7:30 ` [U-Boot] [PATCH 1/3] dts: popmetal: add usb host power supply node Kever Yang
@ 2016-11-09  7:30 ` Kever Yang
  2016-11-11 16:17   ` Simon Glass
  2016-11-09  7:30 ` [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init Kever Yang
  2 siblings, 1 reply; 9+ messages in thread
From: Kever Yang @ 2016-11-09  7:30 UTC (permalink / raw)
  To: u-boot

RK3288 using the dwc2 USB host controller, enable it and other usb host
funtion like storage and ether.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 configs/popmetal-rk3288_defconfig | 3 +++
 include/configs/rk3288_common.h   | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/configs/popmetal-rk3288_defconfig b/configs/popmetal-rk3288_defconfig
index 1e70ae0..a2d1d65 100644
--- a/configs/popmetal-rk3288_defconfig
+++ b/configs/popmetal-rk3288_defconfig
@@ -63,3 +63,6 @@ CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
 CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
+CONFIG_CMD_USB=y
+CONFIG_USB=y
+CONFIG_USB_STORAGE=y
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h
index 0868612..8006aac 100644
--- a/include/configs/rk3288_common.h
+++ b/include/configs/rk3288_common.h
@@ -90,6 +90,13 @@
 #define CONFIG_G_DNL_VENDOR_NUM		0x2207
 #define CONFIG_G_DNL_PRODUCT_NUM	0x320a
 
+/* usb host support */
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_DWC2
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_USB_ETHER_ASIX
+#endif
 #define ENV_MEM_LAYOUT_SETTINGS \
 	"scriptaddr=0x00000000\0" \
 	"pxefile_addr_r=0x00100000\0" \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init
  2016-11-09  7:30 [U-Boot] [PATCH 0/3] Enable the host controller and hub on PopMetal board Kever Yang
  2016-11-09  7:30 ` [U-Boot] [PATCH 1/3] dts: popmetal: add usb host power supply node Kever Yang
  2016-11-09  7:30 ` [U-Boot] [PATCH 2/3] config: popmetal: enable the USB host controller and function Kever Yang
@ 2016-11-09  7:30 ` Kever Yang
  2016-11-11 16:17   ` Simon Glass
  2 siblings, 1 reply; 9+ messages in thread
From: Kever Yang @ 2016-11-09  7:30 UTC (permalink / raw)
  To: u-boot

Enable the usb host port 5V power by enable the fix regulator.
The PopMetal board have a on board FE1.1 usb 2.0 hub which connect to
the usb host port, we need to de-assert its reset pin at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 31 +++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c
index aad74ef..6f5d3a8c 100644
--- a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c
+++ b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c
@@ -6,6 +6,8 @@
 
 #include <common.h>
 #include <spl.h>
+#include <asm/gpio.h>
+#include <power/regulator.h>
 
 void board_boot_order(u32 *spl_boot_list)
 {
@@ -13,3 +15,32 @@ void board_boot_order(u32 *spl_boot_list)
 	spl_boot_list[0] = BOOT_DEVICE_MMC2;
 	spl_boot_list[1] = BOOT_DEVICE_MMC1;
 }
+
+#define GPIO7A3_HUB_RST	227
+
+int rk_board_late_init(void)
+{
+	int ret;
+	struct udevice *regulator;
+
+	ret = regulator_get_by_platname("vcc5v0_host", &regulator);
+	if (ret) {
+		printf("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
+		goto out;
+	}
+
+	ret = regulator_set_enable(regulator, true);
+	if (ret) {
+		printf("%s vcc5v0-host enable fail!\n", __func__);
+		goto out;
+	}
+
+	gpio_request(GPIO7A3_HUB_RST, "hub_rst");
+	gpio_direction_output(GPIO7A3_HUB_RST, 1);
+
+	return 0;
+out:
+	printf("%s init error %x\n", __func__, ret);
+
+	return ret;
+}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 1/3] dts: popmetal: add usb host power supply node
  2016-11-09  7:30 ` [U-Boot] [PATCH 1/3] dts: popmetal: add usb host power supply node Kever Yang
@ 2016-11-11 16:17   ` Simon Glass
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2016-11-11 16:17 UTC (permalink / raw)
  To: u-boot

On 9 November 2016 at 00:30, Kever Yang <kever.yang@rock-chips.com> wrote:
> The popmetal board using a HOST_VBUS_DRV gpio signal to control the
> USB host port 5V power, add a fix regulator and pinctrl for it, and
> enable the USB host1 controller at the same time.
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  arch/arm/dts/rk3288-popmetal.dtsi | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)

Acked-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 2/3] config: popmetal: enable the USB host controller and function
  2016-11-09  7:30 ` [U-Boot] [PATCH 2/3] config: popmetal: enable the USB host controller and function Kever Yang
@ 2016-11-11 16:17   ` Simon Glass
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2016-11-11 16:17 UTC (permalink / raw)
  To: u-boot

On 9 November 2016 at 00:30, Kever Yang <kever.yang@rock-chips.com> wrote:
> RK3288 using the dwc2 USB host controller, enable it and other usb host
> funtion like storage and ether.
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  configs/popmetal-rk3288_defconfig | 3 +++
>  include/configs/rk3288_common.h   | 7 +++++++
>  2 files changed, 10 insertions(+)

Acked-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init
  2016-11-09  7:30 ` [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init Kever Yang
@ 2016-11-11 16:17   ` Simon Glass
  2016-11-15  8:30     ` Kever Yang
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Glass @ 2016-11-11 16:17 UTC (permalink / raw)
  To: u-boot

Hi Kever,

On 9 November 2016 at 00:30, Kever Yang <kever.yang@rock-chips.com> wrote:
> Enable the usb host port 5V power by enable the fix regulator.
> The PopMetal board have a on board FE1.1 usb 2.0 hub which connect to
> the usb host port, we need to de-assert its reset pin at the same time.

This should go in a USB driver.

>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 31 +++++++++++++++++++++++
>  1 file changed, 31 insertions(+)

Regards,
Simon

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init
  2016-11-11 16:17   ` Simon Glass
@ 2016-11-15  8:30     ` Kever Yang
  2016-11-18  1:14       ` Simon Glass
  0 siblings, 1 reply; 9+ messages in thread
From: Kever Yang @ 2016-11-15  8:30 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On 11/12/2016 12:17 AM, Simon Glass wrote:
> Hi Kever,
>
> On 9 November 2016 at 00:30, Kever Yang <kever.yang@rock-chips.com> wrote:
>> Enable the usb host port 5V power by enable the fix regulator.
>> The PopMetal board have a on board FE1.1 usb 2.0 hub which connect to
>> the usb host port, we need to de-assert its reset pin at the same time.
> This should go in a USB driver.

This patch 1)enable the 5V vbus power and 2)de-assert the hub reset pin,
1) may go to USB driver, but 2) still need to be in board init because 
that is
totally board specific.


Thanks,
- Kever
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>> ---
>>
>>   board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 31 +++++++++++++++++++++++
>>   1 file changed, 31 insertions(+)
> Regards,
> Simon
>
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init
  2016-11-15  8:30     ` Kever Yang
@ 2016-11-18  1:14       ` Simon Glass
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2016-11-18  1:14 UTC (permalink / raw)
  To: u-boot

Hi Kever,

On 15 November 2016 at 01:30, Kever Yang <kever.yang@rock-chips.com> wrote:
> Hi Simon,
>
> On 11/12/2016 12:17 AM, Simon Glass wrote:
>>
>> Hi Kever,
>>
>> On 9 November 2016 at 00:30, Kever Yang <kever.yang@rock-chips.com> wrote:
>>>
>>> Enable the usb host port 5V power by enable the fix regulator.
>>> The PopMetal board have a on board FE1.1 usb 2.0 hub which connect to
>>> the usb host port, we need to de-assert its reset pin at the same time.
>>
>> This should go in a USB driver.
>
>
> This patch 1)enable the 5V vbus power and 2)de-assert the hub reset pin,
> 1) may go to USB driver, but 2) still need to be in board init because that
> is
> totally board specific.

What is board-specific about it? Are those differences described in
the device tree?

Regards,
Simon
[...]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-11-18  1:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09  7:30 [U-Boot] [PATCH 0/3] Enable the host controller and hub on PopMetal board Kever Yang
2016-11-09  7:30 ` [U-Boot] [PATCH 1/3] dts: popmetal: add usb host power supply node Kever Yang
2016-11-11 16:17   ` Simon Glass
2016-11-09  7:30 ` [U-Boot] [PATCH 2/3] config: popmetal: enable the USB host controller and function Kever Yang
2016-11-11 16:17   ` Simon Glass
2016-11-09  7:30 ` [U-Boot] [PATCH 3/3] board: popmetal: enable the usb host port power in board init Kever Yang
2016-11-11 16:17   ` Simon Glass
2016-11-15  8:30     ` Kever Yang
2016-11-18  1:14       ` Simon Glass

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.