From b44566c4ce5ca95264860f78a6ba1d26a5edb5ea Mon Sep 17 00:00:00 2001 From: MengDongyang Date: Wed, 24 Aug 2016 12:02:17 +0800 Subject: usb: xhci-rockchip: add rockchip dwc3 controller driver This patch add support for rockchip dwc3 controller, which corresponding to the two type-C port on rk3399 evb. Only support usb2.0 currently for we have not enable the usb3.0 phy driver and PD(fusb302) driver. Signed-off-by: MengDongyang Signed-off-by: Kever Yang Reviewed-by: Marek Vasut Reviewed-by: Simon Glass --- include/linux/usb/dwc3.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/linux/usb/dwc3.h b/include/linux/usb/dwc3.h index 6d1e36505d8..a0274461cc1 100644 --- a/include/linux/usb/dwc3.h +++ b/include/linux/usb/dwc3.h @@ -180,7 +180,21 @@ struct dwc3 { /* offset: 0xC100 */ /* Global USB2 PHY Configuration Register */ #define DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31) +#define DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS (1 << 30) +#define DWC3_GUSB2PHYCFG_ENBLSLPM (1 << 8) #define DWC3_GUSB2PHYCFG_SUSPHY (1 << 6) +#define DWC3_GUSB2PHYCFG_PHYIF (1 << 3) + +/* Global USB2 PHY Configuration Mask */ +#define DWC3_GUSB2PHYCFG_USBTRDTIM_MASK (0xf << 10) + +/* Global USB2 PHY Configuration Offset */ +#define DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET 10 + +#define DWC3_GUSB2PHYCFG_USBTRDTIM_16BIT (0x5 << \ + DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET) +#define DWC3_GUSB2PHYCFG_USBTRDTIM_8BIT (0x9 << \ + DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET) /* Global USB3 PIPE Control Register */ #define DWC3_GUSB3PIPECTL_PHYSOFTRST (1 << 31) -- cgit v1.3.1 From 923e7b44ad9e866b0ca2b783c47d95b98b2c8f07 Mon Sep 17 00:00:00 2001 From: MengDongyang Date: Wed, 24 Aug 2016 12:02:19 +0800 Subject: config: rk3399: add usb related configs This patch to enable configs for usb module - xhci - ehci - usb storage - usb net Signed-off-by: MengDongyang Signed-off-by: Kever Yang Squashed in patch to move to Kconfig: https://patchwork.ozlabs.org/patch/672543/ Signed-off-by: Simon Glass Acked-by: Simon Glass --- configs/evb-rk3399_defconfig | 7 +++++++ include/configs/rk3399_common.h | 12 ++++++++++++ 2 files changed, 19 insertions(+) (limited to 'include') diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig index 6135013a3b2..1f6855c4dec 100644 --- a/configs/evb-rk3399_defconfig +++ b/configs/evb-rk3399_defconfig @@ -14,6 +14,7 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_USB=y CONFIG_REGMAP=y CONFIG_SYSCON=y CONFIG_CLK=y @@ -31,3 +32,9 @@ CONFIG_SYS_NS16550=y CONFIG_SYSRESET=y CONFIG_USE_TINY_PRINTF=y CONFIG_ERRNO_STR=y +CONFIG_USB=y +CONFIG_USB_STORAGE=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_GENERIC=y diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index e9626a5e398..b026122f52a 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -83,4 +83,16 @@ #endif +/* enable usb config for usb ether */ +#define CONFIG_USB_HOST_ETHER + +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_USB_ETHER_ASIX88179 +#define CONFIG_USB_ETHER_MCS7830 +#define CONFIG_USB_ETHER_SMSC95XX +#define CONFIG_USB_ETHER_RTL8152 + +/* rockchip xhci host driver */ +#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 + #endif -- cgit v1.3.1 From 5a4a90f6e632448aa60c7fdee575e9d38adfd230 Mon Sep 17 00:00:00 2001 From: Xu Ziyuan Date: Sat, 27 Aug 2016 21:53:14 +0800 Subject: rockchip: rk3288: skip lowlevel_init process lowlevel_init() is never needed for rk3288, so drop it. Signed-off-by: Ziyuan Xu Acked-by: Simon Glass Tested-by: Simon Glass --- arch/arm/mach-rockchip/board.c | 4 ---- arch/arm/mach-rockchip/rk3288-board-spl.c | 4 ---- include/configs/rk3288_common.h | 1 + 3 files changed, 1 insertion(+), 8 deletions(-) (limited to 'include') diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index bec756d7ac0..6c36bf93977 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -81,10 +81,6 @@ void enable_caches(void) } #endif -void lowlevel_init(void) -{ -} - #if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG) #include #include diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index e0d92a66b39..ae509ffab25 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -280,7 +280,3 @@ err: /* No way to report error here */ hang(); } - -void lowlevel_init(void) -{ -} diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 21b60828bb6..e8bf9878f24 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -9,6 +9,7 @@ #include +#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY #define CONFIG_SYS_NO_FLASH #define CONFIG_NR_DRAM_BANKS 1 #define CONFIG_ENV_SIZE 0x2000 -- cgit v1.3.1