summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-06-16 15:38:03 +0530
committerPhilippe Langlais <philippe.langlais@linaro.org>2011-07-22 15:51:39 +0200
commit1551c5735e438452f0be147649120fa79bf619e6 (patch)
treef390944ad0948be1f1d027ba1d43f249907b309e /arch
parent09114e508dc7ae3eeb05b21ba6435ef05a5f7d4d (diff)
ux500: cpuidle_dbg: 5500 support
Also move the debug init functions to __init. ST-Ericsson Linux next: - ST-Ericsson ID: 332226 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ib1b29d021e601c973e038941beac546458903f48 Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25247 Reviewed-by: QATEST Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-ux500/pm/cpuidle_dbg.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/arch/arm/mach-ux500/pm/cpuidle_dbg.c b/arch/arm/mach-ux500/pm/cpuidle_dbg.c
index ae1e165d1eb..05e733eaa3d 100644
--- a/arch/arm/mach-ux500/pm/cpuidle_dbg.c
+++ b/arch/arm/mach-ux500/pm/cpuidle_dbg.c
@@ -809,7 +809,7 @@ static const struct file_operations wake_latency_fops = {
static struct dentry *cpuidle_dir;
-static void setup_debugfs(void)
+static void __init setup_debugfs(void)
{
cpuidle_dir = debugfs_create_dir("cpuidle", NULL);
if (IS_ERR_OR_NULL(cpuidle_dir))
@@ -876,9 +876,14 @@ fail:
debugfs_remove_recursive(cpuidle_dir);
}
-void ux500_ci_dbg_init(void)
+#define __UART_BASE(soc, x) soc##_UART##x##_BASE
+#define UART_BASE(soc, x) __UART_BASE(soc, x)
+
+void __init ux500_ci_dbg_init(void)
{
- char clkname[10];
+ static const char clkname[] __initconst
+ = "uart" __stringify(CONFIG_UX500_DEBUG_UART);
+ unsigned long baseaddr;
int cpu;
struct state_history *sh;
@@ -911,22 +916,17 @@ void ux500_ci_dbg_init(void)
setup_debugfs();
/* Uart debug init */
- switch (CONFIG_UX500_DEBUG_UART) {
- case 0:
- uart_base = ioremap(U8500_UART0_BASE, SZ_4K);
- break;
- case 1:
- uart_base = ioremap(U8500_UART1_BASE, SZ_4K);
- break;
- case 2:
- uart_base = ioremap(U8500_UART2_BASE, SZ_4K);
- break;
- default:
- uart_base = ioremap(U8500_UART2_BASE, SZ_4K);
- break;
- }
- snprintf(clkname, sizeof(clkname), "uart%d", CONFIG_UX500_DEBUG_UART);
+ if (cpu_is_u8500())
+ baseaddr = UART_BASE(U8500, CONFIG_UX500_DEBUG_UART);
+ else if (cpu_is_u5500())
+ baseaddr = UART_BASE(U5500, CONFIG_UX500_DEBUG_UART);
+ else
+ ux500_unknown_soc();
+
+ uart_base = ioremap(baseaddr, SZ_4K);
+ BUG_ON(!uart_base);
+
uart_clk = clk_get_sys(clkname, NULL);
BUG_ON(IS_ERR(uart_clk));