aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-06-16 15:38:03 +0530
committersaid m bagheri <ebgheri@steludxu2848.(none)>2011-06-29 10:30:28 +0200
commitd02ad7a33b70f74765daf0b85bfa037d053a2bc1 (patch)
tree39939e1d0a70f4999c152f6b5ebb2a03ab544b0d
parentb5fbf87dda3c33a788652db24da9e303af2a7d7f (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>
-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));