Message ID | 1479972592-32761-3-git-send-email-kever.yang@rock-chips.com |
---|---|
State | Accepted |
Commit | da20981269d890cb85ef9336a3f488d61fbd73b7 |
Delegated to: | Simon Glass |
Headers | show |
Hi Kever, On 24 November 2016 at 00:29, Kever Yang <kever.yang@rock-chips.com> wrote: > 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 to enable it. > > Signed-off-by: Kever Yang <kever.yang@rock-chips.com> > --- > > Changes in v2: > - move the vbus power enable into dwc2 driver > > board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c > index aad74ef..ed82b2b 100644 > --- a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c > +++ b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c > @@ -6,6 +6,7 @@ > > #include <common.h> > #include <spl.h> > +#include <asm/gpio.h> > > void board_boot_order(u32 *spl_boot_list) > { > @@ -13,3 +14,19 @@ 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; > + > + ret = gpio_request(GPIO7A3_HUB_RST, "hub_rst"); > + if (ret) > + return ret; > + ret = gpio_direction_output(GPIO7A3_HUB_RST, 1); > + if (ret) Can we get this from the device tree instead of hard-coding it? Then it can go in generic code. > + return ret; > + > + return 0; > +} > -- > 1.9.1 > Regards, Simon
Hi Simon, On 11/26/2016 03:39 AM, Simon Glass wrote: > Hi Kever, > > On 24 November 2016 at 00:29, Kever Yang <kever.yang@rock-chips.com> wrote: >> 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 to enable it. >> >> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> >> --- >> >> Changes in v2: >> - move the vbus power enable into dwc2 driver >> >> board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 17 +++++++++++++++++ >> 1 file changed, 17 insertions(+) >> >> diff --git a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >> index aad74ef..ed82b2b 100644 >> --- a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >> +++ b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >> @@ -6,6 +6,7 @@ >> >> #include <common.h> >> #include <spl.h> >> +#include <asm/gpio.h> >> >> void board_boot_order(u32 *spl_boot_list) >> { >> @@ -13,3 +14,19 @@ 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; >> + >> + ret = gpio_request(GPIO7A3_HUB_RST, "hub_rst"); >> + if (ret) >> + return ret; >> + ret = gpio_direction_output(GPIO7A3_HUB_RST, 1); >> + if (ret) > Can we get this from the device tree instead of hard-coding it? Then > it can go in generic code. I don't understand how to get this from device tree, this board is the only one based on rk3288 with a USB hub on board and need the de-assert its reset pin. I think it is reasonable to hard coding it in its board file. Thanks, - Kever > >> + return ret; >> + >> + return 0; >> +} >> -- >> 1.9.1 >> > Regards, > Simon > > >
On 29 November 2016 at 01:49, Kever Yang <kever.yang@rock-chips.com> wrote: > Hi Simon, > > > On 11/26/2016 03:39 AM, Simon Glass wrote: >> >> Hi Kever, >> >> On 24 November 2016 at 00:29, Kever Yang <kever.yang@rock-chips.com> >> wrote: >>> >>> 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 to enable it. >>> >>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> >>> --- >>> >>> Changes in v2: >>> - move the vbus power enable into dwc2 driver >>> >>> board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 17 >>> +++++++++++++++++ >>> 1 file changed, 17 insertions(+) >>> >>> diff --git a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>> b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>> index aad74ef..ed82b2b 100644 >>> --- a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>> +++ b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>> @@ -6,6 +6,7 @@ >>> >>> #include <common.h> >>> #include <spl.h> >>> +#include <asm/gpio.h> >>> >>> void board_boot_order(u32 *spl_boot_list) >>> { >>> @@ -13,3 +14,19 @@ 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; >>> + >>> + ret = gpio_request(GPIO7A3_HUB_RST, "hub_rst"); >>> + if (ret) >>> + return ret; >>> + ret = gpio_direction_output(GPIO7A3_HUB_RST, 1); >>> + if (ret) >> >> Can we get this from the device tree instead of hard-coding it? Then >> it can go in generic code. > > > I don't understand how to get this from device tree, this board is the > only one based on rk3288 with a USB hub on board and need the de-assert > its reset pin. I think it is reasonable to hard coding it in its board file. OK, since it's just one board. Acked-by: Simon Glass <sjg@chromium.org> In general we can support this sort of thing by adding a driver for UCLASS_USB_HUB, but I suspect it would need refactoring of common/usb.c. Regards, Simon
On 29 November 2016 at 17:34, Simon Glass <sjg@chromium.org> wrote: > On 29 November 2016 at 01:49, Kever Yang <kever.yang@rock-chips.com> wrote: >> Hi Simon, >> >> >> On 11/26/2016 03:39 AM, Simon Glass wrote: >>> >>> Hi Kever, >>> >>> On 24 November 2016 at 00:29, Kever Yang <kever.yang@rock-chips.com> >>> wrote: >>>> >>>> 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 to enable it. >>>> >>>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> >>>> --- >>>> >>>> Changes in v2: >>>> - move the vbus power enable into dwc2 driver >>>> >>>> board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 17 >>>> +++++++++++++++++ >>>> 1 file changed, 17 insertions(+) >>>> >>>> diff --git a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>>> b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>>> index aad74ef..ed82b2b 100644 >>>> --- a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>>> +++ b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c >>>> @@ -6,6 +6,7 @@ >>>> >>>> #include <common.h> >>>> #include <spl.h> >>>> +#include <asm/gpio.h> >>>> >>>> void board_boot_order(u32 *spl_boot_list) >>>> { >>>> @@ -13,3 +14,19 @@ 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; >>>> + >>>> + ret = gpio_request(GPIO7A3_HUB_RST, "hub_rst"); >>>> + if (ret) >>>> + return ret; >>>> + ret = gpio_direction_output(GPIO7A3_HUB_RST, 1); >>>> + if (ret) >>> >>> Can we get this from the device tree instead of hard-coding it? Then >>> it can go in generic code. >> >> >> I don't understand how to get this from device tree, this board is the >> only one based on rk3288 with a USB hub on board and need the de-assert >> its reset pin. I think it is reasonable to hard coding it in its board file. > > OK, since it's just one board. > > Acked-by: Simon Glass <sjg@chromium.org> > > In general we can support this sort of thing by adding a driver for > UCLASS_USB_HUB, but I suspect it would need refactoring of > common/usb.c. Added 'rockchip' tag, Applied to u-boot-rockchip, thanks.
diff --git a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c index aad74ef..ed82b2b 100644 --- a/board/chipspark/popmetal_rk3288/popmetal-rk3288.c +++ b/board/chipspark/popmetal_rk3288/popmetal-rk3288.c @@ -6,6 +6,7 @@ #include <common.h> #include <spl.h> +#include <asm/gpio.h> void board_boot_order(u32 *spl_boot_list) { @@ -13,3 +14,19 @@ 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; + + ret = gpio_request(GPIO7A3_HUB_RST, "hub_rst"); + if (ret) + return ret; + ret = gpio_direction_output(GPIO7A3_HUB_RST, 1); + if (ret) + return ret; + + return 0; +}
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 to enable it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> --- Changes in v2: - move the vbus power enable into dwc2 driver board/chipspark/popmetal_rk3288/popmetal-rk3288.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)