mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 23:51:33 +00:00
exynos: usb: Fix data abort on boards w/o vbus-gpio node in the DT
Commit 4a271cb1b4
doesn't take into account that fdtdec_setup_gpio()
returns success when the gpio passed to it is FDT_GPIO_NONE (no
gpio node found in the fdtdec_decode_gpio() call). This results in
calling gpio_direction_output() on invalid gpio. For this reason
executing "usb start" command on Arndale causes data abort in the
ehci-exynos driver.
Add the fdt_gpio_isvalid() check to fix that problem.
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
078d7302ac
commit
e6e493f341
2 changed files with 4 additions and 2 deletions
|
@ -197,7 +197,8 @@ int ehci_hcd_init(int index, enum usb_init_type init,
|
|||
|
||||
#ifdef CONFIG_OF_CONTROL
|
||||
/* setup the Vbus gpio here */
|
||||
if (!fdtdec_setup_gpio(&ctx->vbus_gpio))
|
||||
if (fdt_gpio_isvalid(&ctx->vbus_gpio) &&
|
||||
!fdtdec_setup_gpio(&ctx->vbus_gpio))
|
||||
gpio_direction_output(ctx->vbus_gpio.gpio, 1);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -298,7 +298,8 @@ int xhci_hcd_init(int index, struct xhci_hccr **hccr, struct xhci_hcor **hcor)
|
|||
|
||||
#ifdef CONFIG_OF_CONTROL
|
||||
/* setup the Vbus gpio here */
|
||||
if (!fdtdec_setup_gpio(&ctx->vbus_gpio))
|
||||
if (fdt_gpio_isvalid(&ctx->vbus_gpio) &&
|
||||
!fdtdec_setup_gpio(&ctx->vbus_gpio))
|
||||
gpio_direction_output(ctx->vbus_gpio.gpio, 1);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue