rk30: fiq debuger: rk_serial_debug_init use uart virtual address directly, do not double map registers

This commit is contained in:
黄涛
2012-03-15 16:02:21 +08:00
parent f49fc438f7
commit d00be0d79b
3 changed files with 18 additions and 36 deletions

View File

@@ -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;

View 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

View 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);
}