* [U-Boot] [PATCH 0/4] enable the host controller for rk3036
@ 2016-11-08 10:13 Kever Yang
2016-11-08 10:13 ` [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST Kever Yang
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Kever Yang @ 2016-11-08 10:13 UTC (permalink / raw)
To: u-boot
To enable usb host function, you need:
- enable the host port power, usually controled by a gpio named
vbus_drv;
- enable the controller driver like dwc2;
- enable the usb framework like CONFIG_CMD_USB and CONFIG_USB;
- enable the usb function like storage or ether;
Kever Yang (4):
config: rk3036: enable configs for USB HOST
config: rk3036: enable fix regulator
dts: arm: rk3036: add usb vbus node
rk3036: enable the vbus regulator when borad_init
arch/arm/dts/rk3036-sdk.dts | 37 +++++++++++++++++++++++++++++++----
arch/arm/mach-rockchip/rk3036-board.c | 20 +++++++++++++++++++
configs/kylin-rk3036_defconfig | 4 ++++
include/configs/rk3036_common.h | 7 +++++++
4 files changed, 64 insertions(+), 4 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 14+ messages in thread* [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST 2016-11-08 10:13 [U-Boot] [PATCH 0/4] enable the host controller for rk3036 Kever Yang @ 2016-11-08 10:13 ` Kever Yang 2016-11-11 16:16 ` Simon Glass 2016-11-08 10:13 ` [U-Boot] [PATCH 2/4] config: rk3036: enable fix regulator Kever Yang ` (2 subsequent siblings) 3 siblings, 1 reply; 14+ messages in thread From: Kever Yang @ 2016-11-08 10:13 UTC (permalink / raw) To: u-boot rk3036 using dwc2 usb controller, need enable relate configs for it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- configs/kylin-rk3036_defconfig | 3 +++ include/configs/rk3036_common.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/configs/kylin-rk3036_defconfig b/configs/kylin-rk3036_defconfig index 424cdab..5a8b85a 100644 --- a/configs/kylin-rk3036_defconfig +++ b/configs/kylin-rk3036_defconfig @@ -36,3 +36,6 @@ CONFIG_RAM=y CONFIG_SYSRESET=y CONFIG_CMD_DHRYSTONE=y CONFIG_ERRNO_STR=y +CONFIG_CMD_USB=y +CONFIG_USB=y +CONFIG_USB_STORAGE=y diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h index 4eef3f8..92be29e 100644 --- a/include/configs/rk3036_common.h +++ b/include/configs/rk3036_common.h @@ -79,6 +79,13 @@ #define CONFIG_G_DNL_VENDOR_NUM 0x2207 #define CONFIG_G_DNL_PRODUCT_NUM 0x310a +/* usb host */ +#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=0x60000000\0" \ "pxefile_addr_r=0x60100000\0" \ -- 1.9.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST 2016-11-08 10:13 ` [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST Kever Yang @ 2016-11-11 16:16 ` Simon Glass 2016-11-25 19:38 ` Simon Glass 0 siblings, 1 reply; 14+ messages in thread From: Simon Glass @ 2016-11-11 16:16 UTC (permalink / raw) To: u-boot Hi Kever, On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> wrote: > rk3036 using dwc2 usb controller, need enable relate configs for it. > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > configs/kylin-rk3036_defconfig | 3 +++ > include/configs/rk3036_common.h | 7 +++++++ > 2 files changed, 10 insertions(+) Acked-by: Simon Glass <sjg@chromium.org> Are these added in the right order? Did you use 'make savedefconfig' afterwards? > > diff --git a/configs/kylin-rk3036_defconfig b/configs/kylin-rk3036_defconfig > index 424cdab..5a8b85a 100644 > --- a/configs/kylin-rk3036_defconfig > +++ b/configs/kylin-rk3036_defconfig > @@ -36,3 +36,6 @@ CONFIG_RAM=y > CONFIG_SYSRESET=y > CONFIG_CMD_DHRYSTONE=y > CONFIG_ERRNO_STR=y > +CONFIG_CMD_USB=y > +CONFIG_USB=y > +CONFIG_USB_STORAGE=y > diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h > index 4eef3f8..92be29e 100644 > --- a/include/configs/rk3036_common.h > +++ b/include/configs/rk3036_common.h > @@ -79,6 +79,13 @@ > #define CONFIG_G_DNL_VENDOR_NUM 0x2207 > #define CONFIG_G_DNL_PRODUCT_NUM 0x310a > > +/* usb host */ > +#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=0x60000000\0" \ > "pxefile_addr_r=0x60100000\0" \ > -- > 1.9.1 > Regards, Simon ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST 2016-11-11 16:16 ` Simon Glass @ 2016-11-25 19:38 ` Simon Glass 0 siblings, 0 replies; 14+ messages in thread From: Simon Glass @ 2016-11-25 19:38 UTC (permalink / raw) To: u-boot On 11 November 2016 at 09:16, Simon Glass <sjg@chromium.org> wrote: > Hi Kever, > > On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> wrote: >> rk3036 using dwc2 usb controller, need enable relate configs for it. >> >> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> >> --- >> >> configs/kylin-rk3036_defconfig | 3 +++ >> include/configs/rk3036_common.h | 7 +++++++ >> 2 files changed, 10 insertions(+) > > Acked-by: Simon Glass <sjg@chromium.org> > > Are these added in the right order? Did you use 'make savedefconfig' afterwards? No response - please send a follow-up patch if needed. Applied to u-boot-rockchip, thanks! ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 2/4] config: rk3036: enable fix regulator 2016-11-08 10:13 [U-Boot] [PATCH 0/4] enable the host controller for rk3036 Kever Yang 2016-11-08 10:13 ` [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST Kever Yang @ 2016-11-08 10:13 ` Kever Yang 2016-11-11 16:17 ` Simon Glass 2016-11-08 10:13 ` [U-Boot] [PATCH 3/4] dts: arm: rk3036: add usb vbus node Kever Yang 2016-11-08 10:13 ` [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init Kever Yang 3 siblings, 1 reply; 14+ messages in thread From: Kever Yang @ 2016-11-08 10:13 UTC (permalink / raw) To: u-boot usb host vbus power is using gpio fix regulator, enable it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- configs/kylin-rk3036_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/kylin-rk3036_defconfig b/configs/kylin-rk3036_defconfig index 5a8b85a..631d1f5 100644 --- a/configs/kylin-rk3036_defconfig +++ b/configs/kylin-rk3036_defconfig @@ -32,6 +32,7 @@ CONFIG_LED=y CONFIG_ROCKCHIP_DWMMC=y CONFIG_PINCTRL=y CONFIG_ROCKCHIP_RK3036_PINCTRL=y +CONFIG_DM_REGULATOR_FIXED=y CONFIG_RAM=y CONFIG_SYSRESET=y CONFIG_CMD_DHRYSTONE=y -- 1.9.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 2/4] config: rk3036: enable fix regulator 2016-11-08 10:13 ` [U-Boot] [PATCH 2/4] config: rk3036: enable fix regulator Kever Yang @ 2016-11-11 16:17 ` Simon Glass 2016-11-25 19:38 ` Simon Glass 0 siblings, 1 reply; 14+ messages in thread From: Simon Glass @ 2016-11-11 16:17 UTC (permalink / raw) To: u-boot On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> wrote: > usb host vbus power is using gpio fix regulator, enable it. > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > configs/kylin-rk3036_defconfig | 1 + > 1 file changed, 1 insertion(+) Acked-by: Simon Glass <sjg@chromium.org> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 2/4] config: rk3036: enable fix regulator 2016-11-11 16:17 ` Simon Glass @ 2016-11-25 19:38 ` Simon Glass 0 siblings, 0 replies; 14+ messages in thread From: Simon Glass @ 2016-11-25 19:38 UTC (permalink / raw) To: u-boot On 11 November 2016 at 09:17, Simon Glass <sjg@chromium.org> wrote: > On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> wrote: >> usb host vbus power is using gpio fix regulator, enable it. >> >> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> >> --- >> >> configs/kylin-rk3036_defconfig | 1 + >> 1 file changed, 1 insertion(+) > > Acked-by: Simon Glass <sjg@chromium.org> Applied to u-boot-rockchip, thanks! ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 3/4] dts: arm: rk3036: add usb vbus node 2016-11-08 10:13 [U-Boot] [PATCH 0/4] enable the host controller for rk3036 Kever Yang 2016-11-08 10:13 ` [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST Kever Yang 2016-11-08 10:13 ` [U-Boot] [PATCH 2/4] config: rk3036: enable fix regulator Kever Yang @ 2016-11-08 10:13 ` Kever Yang 2016-11-11 16:17 ` Simon Glass 2016-11-08 10:13 ` [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init Kever Yang 3 siblings, 1 reply; 14+ messages in thread From: Kever Yang @ 2016-11-08 10:13 UTC (permalink / raw) To: u-boot add fix regulator node for usb vbus power control. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- arch/arm/dts/rk3036-sdk.dts | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/arch/arm/dts/rk3036-sdk.dts b/arch/arm/dts/rk3036-sdk.dts index 1c9ddf9..bdc7b98 100644 --- a/arch/arm/dts/rk3036-sdk.dts +++ b/arch/arm/dts/rk3036-sdk.dts @@ -16,10 +16,25 @@ stdout-path = &uart2; }; - usb_control { - compatible = "rockchip,rk3036-usb-control"; - host_drv_gpio = <&gpio2 23 GPIO_ACTIVE_LOW>; - otg_drv_gpio = <&gpio0 26 GPIO_ACTIVE_LOW>; + vcc5v0_otg: vcc5v0-otg-drv { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_otg"; + gpio = <&gpio0 26 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&otg_vbus_drv>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + vcc5v0_host: vcc5v0-host-drv { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_host"; + gpio = <&gpio2 23 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&host_vbus_drv>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; }; }; @@ -42,3 +57,17 @@ &usb_otg { status = "okay"; }; + +&pinctrl { + usb_otg { + otg_vbus_drv: host-vbus-drv { + rockchip,pins = <0 26 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + usb_host { + host_vbus_drv: host-vbus-drv { + rockchip,pins = <2 23 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; -- 1.9.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 3/4] dts: arm: rk3036: add usb vbus node 2016-11-08 10:13 ` [U-Boot] [PATCH 3/4] dts: arm: rk3036: add usb vbus node Kever Yang @ 2016-11-11 16:17 ` Simon Glass 2016-11-25 19:38 ` Simon Glass 0 siblings, 1 reply; 14+ messages in thread From: Simon Glass @ 2016-11-11 16:17 UTC (permalink / raw) To: u-boot On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> wrote: > add fix regulator node for usb vbus power control. > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > arch/arm/dts/rk3036-sdk.dts | 37 +++++++++++++++++++++++++++++++++---- > 1 file changed, 33 insertions(+), 4 deletions(-) Acked-by: Simon Glass <sjg@chromium.org> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 3/4] dts: arm: rk3036: add usb vbus node 2016-11-11 16:17 ` Simon Glass @ 2016-11-25 19:38 ` Simon Glass 0 siblings, 0 replies; 14+ messages in thread From: Simon Glass @ 2016-11-25 19:38 UTC (permalink / raw) To: u-boot On 11 November 2016 at 09:17, Simon Glass <sjg@chromium.org> wrote: > On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> wrote: >> add fix regulator node for usb vbus power control. >> >> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> >> --- >> >> arch/arm/dts/rk3036-sdk.dts | 37 +++++++++++++++++++++++++++++++++---- >> 1 file changed, 33 insertions(+), 4 deletions(-) > > Acked-by: Simon Glass <sjg@chromium.org> Applied to u-boot-rockchip, thanks! ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init 2016-11-08 10:13 [U-Boot] [PATCH 0/4] enable the host controller for rk3036 Kever Yang ` (2 preceding siblings ...) 2016-11-08 10:13 ` [U-Boot] [PATCH 3/4] dts: arm: rk3036: add usb vbus node Kever Yang @ 2016-11-08 10:13 ` Kever Yang 2016-11-11 16:17 ` Simon Glass 3 siblings, 1 reply; 14+ messages in thread From: Kever Yang @ 2016-11-08 10:13 UTC (permalink / raw) To: u-boot enable the vbus for usb host in board_init(). Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- 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 <asm/arch/sdram_rk3036.h> #include <asm/gpio.h> #include <dm/pinctrl.h> +#include <power/regulator.h> 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", ®ulator); + 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 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init 2016-11-08 10:13 ` [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init Kever Yang @ 2016-11-11 16:17 ` Simon Glass 2016-11-14 10:07 ` Kever Yang 0 siblings, 1 reply; 14+ messages in thread From: Simon Glass @ 2016-11-11 16:17 UTC (permalink / raw) To: u-boot Hi Kever, On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> wrote: > enable the vbus for usb host in board_init(). Note 'borad_init' typo in subject. > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > 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 <asm/arch/sdram_rk3036.h> > #include <asm/gpio.h> > #include <dm/pinctrl.h> > +#include <power/regulator.h> > > 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", ®ulator); 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 > ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init 2016-11-11 16:17 ` Simon Glass @ 2016-11-14 10:07 ` Kever Yang 2016-11-14 20:44 ` Simon Glass 0 siblings, 1 reply; 14+ messages in thread From: Kever Yang @ 2016-11-14 10:07 UTC (permalink / raw) To: u-boot Hi Simon, On 11/12/2016 12:17 AM, Simon Glass wrote: > Hi Kever, > > On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> 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 <kever.yang@rock-chips.com> >> --- >> >> 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 <asm/arch/sdram_rk3036.h> >> #include <asm/gpio.h> >> #include <dm/pinctrl.h> >> +#include <power/regulator.h> >> >> 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", ®ulator); > 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 >> > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init 2016-11-14 10:07 ` Kever Yang @ 2016-11-14 20:44 ` Simon Glass 0 siblings, 0 replies; 14+ messages in thread From: Simon Glass @ 2016-11-14 20:44 UTC (permalink / raw) To: u-boot Hi Kever, On 14 November 2016 at 03:07, Kever Yang <kever.yang@rock-chips.com> wrote: > Hi Simon, > > On 11/12/2016 12:17 AM, Simon Glass wrote: >> >> Hi Kever, >> >> On 8 November 2016 at 03:13, Kever Yang <kever.yang@rock-chips.com> 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 <kever.yang@rock-chips.com> >>> --- >>> >>> 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 <asm/arch/sdram_rk3036.h> >>> #include <asm/gpio.h> >>> #include <dm/pinctrl.h> >>> +#include <power/regulator.h> >>> >>> 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", ®ulator); >> >> 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2016-11-25 19:38 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-11-08 10:13 [U-Boot] [PATCH 0/4] enable the host controller for rk3036 Kever Yang 2016-11-08 10:13 ` [U-Boot] [PATCH 1/4] config: rk3036: enable configs for USB HOST Kever Yang 2016-11-11 16:16 ` Simon Glass 2016-11-25 19:38 ` Simon Glass 2016-11-08 10:13 ` [U-Boot] [PATCH 2/4] config: rk3036: enable fix regulator Kever Yang 2016-11-11 16:17 ` Simon Glass 2016-11-25 19:38 ` Simon Glass 2016-11-08 10:13 ` [U-Boot] [PATCH 3/4] dts: arm: rk3036: add usb vbus node Kever Yang 2016-11-11 16:17 ` Simon Glass 2016-11-25 19:38 ` Simon Glass 2016-11-08 10:13 ` [U-Boot] [PATCH 4/4] rk3036: enable the vbus regulator when borad_init Kever Yang 2016-11-11 16:17 ` Simon Glass 2016-11-14 10:07 ` Kever Yang 2016-11-14 20:44 ` Simon Glass
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox