From c138999bb16c60c6561e8cd7e456dd09cba3df30 Mon Sep 17 00:00:00 2001 From: Firefly Date: Fri, 7 Aug 2015 14:45:06 +0800 Subject: [PATCH] [u-boot] rk3368: add UMS boot configurations --- .../arch/arm/include/asm/arch-rk33xx/usbhost.h | 18 ++++++++++++++++++ .../board/rockchip/common/mediaboot/UMSBoot.c | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 u-boot/arch/arm/include/asm/arch-rk33xx/usbhost.h diff --git a/u-boot/arch/arm/include/asm/arch-rk33xx/usbhost.h b/u-boot/arch/arm/include/asm/arch-rk33xx/usbhost.h new file mode 100644 index 0000000000..d05c26eb37 --- /dev/null +++ b/u-boot/arch/arm/include/asm/arch-rk33xx/usbhost.h @@ -0,0 +1,18 @@ +/* + * (C) Copyright 2008-2015 Rockchip Electronics + */ +#ifndef _USBHOST_H_ +#define _USBHOST_H_ + +extern struct rkusb_hcd_cfg *rkusb_active_hcd; + +struct rkusb_hcd_cfg { + bool enable; + void* regbase; + int gpio_vbus; + char *name; + void (*hw_init)(void); + void (*hw_deinit)(void); +}; + +#endif /* _USBHOST_H_ */ diff --git a/u-boot/board/rockchip/common/mediaboot/UMSBoot.c b/u-boot/board/rockchip/common/mediaboot/UMSBoot.c index df9691d943..480a15429c 100644 --- a/u-boot/board/rockchip/common/mediaboot/UMSBoot.c +++ b/u-boot/board/rockchip/common/mediaboot/UMSBoot.c @@ -84,6 +84,22 @@ static struct rkusb_hcd_cfg rkusb_hcd[] = { .hw_init = inno_usb_phy_reset, }, #endif +#elif defined(CONFIG_RKCHIP_RK3368) +#if defined(RKUSB_UMS_BOOT_FROM_HOST1) + { + .name = "ehci", + .enable = true, + .regbase = (void *)RKIO_USBHOST_PHYS, + .gpio_vbus = GPIO_BANK0 | GPIO_A4, + }, +#elif defined(RKUSB_UMS_BOOT_FROM_OTG) + { + .name = "dwc2-otg", + .enable = true, + .regbase = (void *)RKIO_USBOTG_PHYS, + .gpio_vbus = GPIO_BANK0 | GPIO_D1, + }, +#endif #else #error: "PLS config chip for UMS!" #endif