Re: [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init

2016-11-14 Thread Simon Glass
Hi Kever,

On 14 November 2016 at 03:07, Kever Yang  wrote:
> Hi Simon,
>
> On 11/12/2016 12:17 AM, Simon Glass wrote:
>>
>> Hi Kever,
>>
>> On 8 November 2016 at 03:13, Kever Yang  wrote:
>>>
>>> enable the vbus for usb host in board_init().
>>
>> Note 'borad_init' typo in subject.
>
>
> Will fix in next version.
>>
>>
>>> Signed-off-by: Kever Yang 
>>> ---
>>>
>>>   arch/arm/mach-rockchip/rk3036-board.c | 20 
>>>   1 file changed, 20 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-rockchip/rk3036-board.c
>>> b/arch/arm/mach-rockchip/rk3036-board.c
>>> index bf2b268..90d3d33 100644
>>> --- a/arch/arm/mach-rockchip/rk3036-board.c
>>> +++ b/arch/arm/mach-rockchip/rk3036-board.c
>>> @@ -16,6 +16,7 @@
>>>   #include 
>>>   #include 
>>>   #include 
>>> +#include 
>>>
>>>   DECLARE_GLOBAL_DATA_PTR;
>>>
>>> @@ -57,7 +58,26 @@ int board_late_init(void)
>>>
>>>   int board_init(void)
>>>   {
>>> +   int ret;
>>> +   struct udevice *regulator;
>>> +
>>> +   ret = regulator_get_by_platname("vcc5v0_host", );
>>
>> Can this be done in the USB driver? Then you might be able to use
>> device_get_supply_regulator().
>
>
> In dwc2 controller, there do have a bit for host power to control a signal
> named HOST_DRV_VBUS and init at dwc_otg_core_host_init(), but we do not
> using that controller signal, and using a GPIO instead, which may be
> different
> in different board, so we usually enable it in board file.
>
> Let me have a try if we can move it to USB driver.

In that case it should be mentioned in the device tree, so you can
perhaps use gpio-regulator.

>
>>
>> In fact it looks like board_usb_init() should move into a driver.
>
>
> We are not using board_usb_init() for usb host now, this function is only
> used
> for usb gadget/udc.

OK I see, that's fine.

BTW the merge window will open soon so please send any other patches
you have planned for the next release.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init

2016-11-14 Thread Kever Yang

Hi Simon,

On 11/12/2016 12:17 AM, Simon Glass wrote:

Hi Kever,

On 8 November 2016 at 03:13, Kever Yang  wrote:

enable the vbus for usb host in board_init().

Note 'borad_init' typo in subject.


Will fix in next version.



Signed-off-by: Kever Yang 
---

  arch/arm/mach-rockchip/rk3036-board.c | 20 
  1 file changed, 20 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3036-board.c 
b/arch/arm/mach-rockchip/rk3036-board.c
index bf2b268..90d3d33 100644
--- a/arch/arm/mach-rockchip/rk3036-board.c
+++ b/arch/arm/mach-rockchip/rk3036-board.c
@@ -16,6 +16,7 @@
  #include 
  #include 
  #include 
+#include 

  DECLARE_GLOBAL_DATA_PTR;

@@ -57,7 +58,26 @@ int board_late_init(void)

  int board_init(void)
  {
+   int ret;
+   struct udevice *regulator;
+
+   ret = regulator_get_by_platname("vcc5v0_host", );

Can this be done in the USB driver? Then you might be able to use
device_get_supply_regulator().


In dwc2 controller, there do have a bit for host power to control a signal
named HOST_DRV_VBUS and init at dwc_otg_core_host_init(), but we do not
using that controller signal, and using a GPIO instead, which may be 
different

in different board, so we usually enable it in board file.

Let me have a try if we can move it to USB driver.



In fact it looks like board_usb_init() should move into a driver.


We are not using board_usb_init() for usb host now, this function is 
only used

for usb gadget/udc.

Thanks,
- Kever




+   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;
+   }
+
 return 0;
+out:
+   printf("%s board ini error %x\n", __func__, ret);
+
+   return ret;
  }

  int dram_init(void)
--
1.9.1







___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init

2016-11-11 Thread Simon Glass
Hi Kever,

On 8 November 2016 at 03:13, Kever Yang  wrote:
> enable the vbus for usb host in board_init().

Note 'borad_init' typo in subject.

>
> Signed-off-by: Kever Yang 
> ---
>
>  arch/arm/mach-rockchip/rk3036-board.c | 20 
>  1 file changed, 20 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/rk3036-board.c 
> b/arch/arm/mach-rockchip/rk3036-board.c
> index bf2b268..90d3d33 100644
> --- a/arch/arm/mach-rockchip/rk3036-board.c
> +++ b/arch/arm/mach-rockchip/rk3036-board.c
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> @@ -57,7 +58,26 @@ int board_late_init(void)
>
>  int board_init(void)
>  {
> +   int ret;
> +   struct udevice *regulator;
> +
> +   ret = regulator_get_by_platname("vcc5v0_host", );

Can this be done in the USB driver? Then you might be able to use
device_get_supply_regulator().

In fact it looks like board_usb_init() should move into a driver.


> +   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;
> +   }
> +
> return 0;
> +out:
> +   printf("%s board ini error %x\n", __func__, ret);
> +
> +   return ret;
>  }
>
>  int dram_init(void)
> --
> 1.9.1
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init

2016-11-08 Thread Kever Yang
enable the vbus for usb host in board_init().

Signed-off-by: Kever Yang 
---

 arch/arm/mach-rockchip/rk3036-board.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3036-board.c 
b/arch/arm/mach-rockchip/rk3036-board.c
index bf2b268..90d3d33 100644
--- a/arch/arm/mach-rockchip/rk3036-board.c
+++ b/arch/arm/mach-rockchip/rk3036-board.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -57,7 +58,26 @@ int board_late_init(void)
 
 int board_init(void)
 {
+   int ret;
+   struct udevice *regulator;
+
+   ret = regulator_get_by_platname("vcc5v0_host", );
+   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;
+   }
+
return 0;
+out:
+   printf("%s board ini error %x\n", __func__, ret);
+
+   return ret;
 }
 
 int dram_init(void)
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot