From 492a73856e1e080eb0069c00802181a07542b9c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Sat, 26 Jan 2013 21:32:58 +0800 Subject: [PATCH] rk3188: fix usb uart init --- arch/arm/mach-rk30/common.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-rk30/common.c b/arch/arm/mach-rk30/common.c index 3ca82ba813b0..2cdce195624d 100755 --- a/arch/arm/mach-rk30/common.c +++ b/arch/arm/mach-rk30/common.c @@ -20,6 +20,7 @@ #include #include #include +#include static void __init rk30_cpu_axi_init(void) { @@ -148,19 +149,18 @@ void __init rk30_init_irq(void) rk30_gpio_init(); } -void __init rk30_map_io(void) +static void usb_uart_init(void) { - rk30_map_common_io(); -#ifdef DEBUG_UART_BASE +#if defined(CONFIG_ARCH_RK3188) && (CONFIG_RK_DEBUG_UART == 2) #ifdef CONFIG_RK_USB_UART - if(!(readl_relaxed(RK30_GRF_BASE + GRF_SOC_STATUS0) & (1 << 13))){//detect id + if (!(readl_relaxed(RK30_GRF_BASE + GRF_SOC_STATUS0) & (1 << 13))) { //detect id writel_relaxed((0x0300 << 16), RK30_GRF_BASE + GRF_UOC0_CON0); - }else{ - if(!(readl_relaxed(RK30_GRF_BASE + GRF_SOC_STATUS0) & (1 << 10))){//detect vbus + } else { + if (!(readl_relaxed(RK30_GRF_BASE + GRF_SOC_STATUS0) & (1 << 10))) { //detect vbus writel_relaxed(((0x01 << 2) | ((0x01 << 2) << 16)), RK30_GRF_BASE + GRF_UOC0_CON2); //software control usb phy enable - writel_relaxed((0x2A | (0x3F << 16)), RK30_GRF_BASE + GRF_UOC0_CON3); //usb phy enter suspend + writel_relaxed((0x2A | (0x3F << 16)), RK30_GRF_BASE + GRF_UOC0_CON3); //usb phy enter suspend writel_relaxed((0x0300 | (0x0300 << 16)), RK30_GRF_BASE + GRF_UOC0_CON0); - }else{ + } else { writel_relaxed((0x0300 << 16), RK30_GRF_BASE + GRF_UOC0_CON0); } } @@ -175,6 +175,12 @@ void __init rk30_map_io(void) writel_relaxed(0x00, DEBUG_UART_BASE + 0x04); writel_relaxed(0x03, DEBUG_UART_BASE + 0x0c); #endif +} + +void __init rk30_map_io(void) +{ + rk30_map_common_io(); + usb_uart_init(); rk29_setup_early_printk(); rk30_cpu_axi_init(); rk30_io_drive_strength_init(); -- 2.34.1