From: lyz Date: Fri, 28 Dec 2012 03:35:07 +0000 (+0800) Subject: rk292x: usb-debug: detect otg_id and otg_vbus when boot X-Git-Tag: firefly_0821_release~8052 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6d789e362973cd14fc7171160769c5f917c6497a;p=firefly-linux-kernel-4.4.55.git rk292x: usb-debug: detect otg_id and otg_vbus when boot --- diff --git a/arch/arm/mach-rk2928/common.c b/arch/arm/mach-rk2928/common.c index 2e33b601ef7c..f0816c0dc061 100755 --- a/arch/arm/mach-rk2928/common.c +++ b/arch/arm/mach-rk2928/common.c @@ -128,7 +128,14 @@ void __init rk2928_map_io(void) { rk2928_map_common_io(); #ifdef DEBUG_UART_BASE - #ifdef CONFIG_RK_USB_UART +#ifdef CONFIG_RK_USB_UART + writel_relaxed(0x04000000, RK2928_GRF_BASE + GRF_UOC1_CON4); + if(!(readl_relaxed(RK2928_GRF_BASE + 0x014c) & (1<<10)))//detect id + { + writel_relaxed(0x34000000, RK2928_GRF_BASE + GRF_UOC1_CON4); + } + else + { if(!(readl_relaxed(RK2928_GRF_BASE + 0x014c) & (1<<7)))//detect vbus { writel_relaxed(0x10001000, RK2928_GRF_BASE + GRF_UOC0_CON0); @@ -139,9 +146,10 @@ void __init rk2928_map_io(void) { writel_relaxed(0x34000000, RK2928_GRF_BASE + GRF_UOC1_CON4); } - #else + } +#else writel_relaxed(0x34000000, RK2928_GRF_BASE + GRF_UOC1_CON4); - #endif +#endif writel_relaxed(0x07, DEBUG_UART_BASE + 0x88); writel_relaxed(0x07, DEBUG_UART_BASE + 0x88); writel_relaxed(0x00, DEBUG_UART_BASE + 0x04);