From 1dbffa5af94691cfaa77e1f0b133141128d2c147 Mon Sep 17 00:00:00 2001 From: wlf Date: Thu, 27 Mar 2014 16:16:25 +0800 Subject: [PATCH] USB: Fix USB bypass UART function. --- arch/arm/common/fiq_debugger.c | 19 +++++++++++-------- arch/arm/mach-rockchip/rk3288.c | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) mode change 100644 => 100755 arch/arm/common/fiq_debugger.c mode change 100644 => 100755 arch/arm/mach-rockchip/rk3288.c diff --git a/arch/arm/common/fiq_debugger.c b/arch/arm/common/fiq_debugger.c old mode 100644 new mode 100755 index 64e6269aa12c..658509bbfc63 --- a/arch/arm/common/fiq_debugger.c +++ b/arch/arm/common/fiq_debugger.c @@ -40,6 +40,9 @@ #include #include +#include +#include +#include #include "fiq_debugger_ringbuf.h" @@ -1166,15 +1169,15 @@ static void debug_fiq(struct fiq_glue_handler *h, void *regs, void *svc_sp) * and make uart controller enter infinite fiq loop */ #ifdef CONFIG_RK_USB_UART -#ifdef CONFIG_ARCH_RK2928 - if(!(readl_relaxed(RK2928_GRF_BASE + 0x014c) & (1<<10))){//id low - writel_relaxed(0x34000000, RK2928_GRF_BASE + 0x190); //enter usb phy - } -#elif defined(CONFIG_ARCH_RK3188) - if(!(readl_relaxed(RK30_GRF_BASE + 0x00ac) & (1 << 13))){//id low - writel_relaxed((0x0300 << 16), RK30_GRF_BASE + 0x010c); //enter usb phy + if(cpu_is_rk3188()){ + if(!(readl_relaxed(RK_GRF_VIRT + RK3188_GRF_SOC_STATUS0) & (1 << 13))){//id low + writel_relaxed((0x0300 << 16), RK_GRF_VIRT + RK3188_GRF_UOC0_CON0); //enter usb phy + } + }else if(cpu_is_rk3288()){ + if(!(readl_relaxed(RK_GRF_VIRT + RK3288_GRF_SOC_STATUS2) & (1 << 17))){//id low + writel_relaxed((0x00c0 << 16), RK_GRF_VIRT + RK3288_GRF_UOC0_CON3);//enter usb phy + } } -#endif #endif need_irq = debug_handle_uart_interrupt(state, this_cpu, regs, svc_sp); if (need_irq) diff --git a/arch/arm/mach-rockchip/rk3288.c b/arch/arm/mach-rockchip/rk3288.c old mode 100644 new mode 100755 index 8f1566ca951f..017a3818083b --- a/arch/arm/mach-rockchip/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288.c @@ -118,6 +118,7 @@ static void __init rk3288_dt_map_io(void) { iotable_init(rk3288_io_desc, ARRAY_SIZE(rk3288_io_desc)); debug_ll_io_init(); + usb_uart_init(); rockchip_soc_id = ROCKCHIP_SOC_RK3288; -- 2.34.1