rk30: fiq debuger: rk_serial_debug_init use uart virtual address directly, do not...
author黄涛 <huangtao@rock-chips.com>
Thu, 15 Mar 2012 08:02:21 +0000 (16:02 +0800)
committer黄涛 <huangtao@rock-chips.com>
Thu, 15 Mar 2012 08:15:52 +0000 (16:15 +0800)
arch/arm/mach-rk30/devices.c
arch/arm/plat-rk/include/plat/rk_fiq_debugger.h
arch/arm/plat-rk/rk_fiq_debugger.c

index c5c5936f57e1be743cb0b3e234f96b67d54663ce..402c04da7ae4f84b15c4966e1972283774597077 100755 (executable)
@@ -1024,7 +1024,7 @@ static int __init rk30_init_devices(void)
 #endif
        rk30_init_sdmmc();
 #if defined(CONFIG_FIQ_DEBUGGER) && defined(DEBUG_UART_PHYS)
-       rk_serial_debug_init(DEBUG_UART_PHYS, IRQ_UART0 + CONFIG_RK_DEBUG_UART, IRQ_UART_SIGNAL, -1);
+       rk_serial_debug_init(DEBUG_UART_BASE, IRQ_UART0 + CONFIG_RK_DEBUG_UART, IRQ_UART_SIGNAL, -1);
 #endif
        rk30_init_i2s();
         return 0;
index c1ff163208c3b8e35c73feeff2c76183e227ecc4..5c85c07941230e343e81472d5da5bd65b8498ef8 100644 (file)
@@ -1,27 +1,10 @@
-/*
- * linux/arch/arm/mach-rk30/include/mach/rk30_fiq_debugger.h
- *
- * Copyright (C) 2010 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+#ifndef __PLAT_RK_FIQ_DEBUGGER_H
+#define __PLAT_RK_FIQ_DEBUGGER_H
 
-#ifndef __MACH_RK30_FIQ_DEBUGGER_H
-#define __MACH_RK30_FIQ_DEBUGGER_H
-
-//#ifdef CONFIG_RK30_FIQ_DEBUGGER
 #ifdef CONFIG_FIQ_DEBUGGER
-void rk_serial_debug_init(unsigned int base, int irq, int signal, int wakeup_irq);
+void rk_serial_debug_init(void __iomem *base, int irq, int signal_irq, int wakeup_irq);
 #else
-static inline void rk_serial_debug_init(unsigned int base, int irq, int signal, int wakeup_irq)
+static inline void rk_serial_debug_init(void __iomem *base, int irq, int signal_irq, int wakeup_irq)
 {
 }
 #endif
index 2105af62c9f83544bcb8ad2605f9522c5180a595..86c24a48dd224d52a5ce67758de5776371b43a42 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * arch/arm/mach-rk/rk_fiq_debugger.c
+ * arch/arm/plat-rk/rk_fiq_debugger.c
  *
  * Serial Debugger Interface for Rockchip
  *
+ * Copyright (C) 2012 ROCKCHIP, Inc.
  * Copyright (C) 2008 Google, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
@@ -131,13 +132,18 @@ static void force_irq(struct platform_device *pdev, unsigned int irq)
 
 static int rk_fiq_debugger_id;
 
-void rk_serial_debug_init(unsigned int base, int irq, int signal, int wakeup_irq)
+void rk_serial_debug_init(void __iomem *base, int irq, int signal_irq, int wakeup_irq)
 {
        struct rk_fiq_debugger *t = NULL;
        struct platform_device *pdev = NULL;
        struct resource *res = NULL;
        int res_count = 0;
 
+       if (!base) {
+               pr_err("Invalid fiq debugger uart base\n");
+               return;
+       }
+
        t = kzalloc(sizeof(struct rk_fiq_debugger), GFP_KERNEL);
        if (!t) {
                pr_err("Failed to allocate for fiq debugger\n");
@@ -150,12 +156,7 @@ void rk_serial_debug_init(unsigned int base, int irq, int signal, int wakeup_irq
        t->pdata.uart_flush = debug_flush;
        t->pdata.fiq_enable = fiq_enable;
        t->pdata.force_irq = force_irq;
-       t->debug_port_base = ioremap(base, PAGE_SIZE);
-
-       if (!t->debug_port_base) {
-               pr_err("Failed to ioremap for fiq debugger\n");
-               goto out1;
-       }
+       t->debug_port_base = base;
 
        res = kzalloc(sizeof(struct resource) * 3, GFP_KERNEL);
        if (!res) {
@@ -169,7 +170,7 @@ void rk_serial_debug_init(unsigned int base, int irq, int signal, int wakeup_irq
                goto out3;
        };
 
-       if(irq >= 0){
+       if (irq >= 0) {
                res[0].flags = IORESOURCE_IRQ;
                res[0].start = irq;
                res[0].end = irq;
@@ -177,10 +178,10 @@ void rk_serial_debug_init(unsigned int base, int irq, int signal, int wakeup_irq
                res_count++;
        }
 
-       if(signal >= 0){
+       if (signal_irq >= 0) {
                res[1].flags = IORESOURCE_IRQ;
-               res[1].start = signal;
-               res[1].end = signal;
+               res[1].start = signal_irq;
+               res[1].end = signal_irq;
                res[1].name = "signal";
                res_count++;
        }
@@ -209,7 +210,5 @@ out4:
 out3:
        kfree(res);
 out2:
-       iounmap(t->debug_port_base);
-out1:
        kfree(t);
 }