fix fiq infinite loop when otg id change
authoryangkai <yk@rock-chips.com>
Tue, 13 Nov 2012 09:56:07 +0000 (17:56 +0800)
committeryangkai <yk@rock-chips.com>
Tue, 13 Nov 2012 09:56:07 +0000 (17:56 +0800)
arch/arm/common/fiq_debugger.c

index 114c98e4d0bab7cc2520264ccf3945aa9f5af1b5..da173e47c160e4a1dcf4666d57712b74fd401d2e 100644 (file)
@@ -1015,6 +1015,16 @@ static void debug_fiq(struct fiq_glue_handler *h, void *regs, void *svc_sp)
        unsigned int this_cpu = THREAD_INFO(svc_sp)->cpu;
        bool need_irq;
 
+       /* RK2928 USB-UART function, otg dp/dm default in uart status;
+        * connect with otg cable&usb device, dp/dm will be hi-z status 
+        * and make uart controller enter infinite fiq loop 
+        */
+#ifdef CONFIG_RK_USB_UART
+       if(!(readl_relaxed(RK2928_GRF_BASE + 0x014c) & (1<<10))) //id low    
+       {         
+               writel_relaxed(0x34000000, RK2928_GRF_BASE + 0x190);   //enter usb phy    
+       }
+#endif
        need_irq = debug_handle_uart_interrupt(state, this_cpu, regs, svc_sp);
        if (need_irq)
                debug_force_irq(state);