From 5a26cd69cc8156df8e8bfac8d656ebaabc62be2c Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 9 Dec 2011 12:26:16 +0100 Subject: microblaze: Use of_find_compatible_node for timer and intc Calling of_find_compatible_node instead of calling private code which does the same. Signed-off-by: Michal Simek --- arch/microblaze/kernel/timer.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'arch/microblaze/kernel/timer.c') diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index af74b1113aab..3ba1e1c8c2eb 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -243,7 +243,7 @@ static int timer_initialized; void __init time_init(void) { - u32 irq, i = 0; + u32 irq; u32 timer_num = 1; struct device_node *timer = NULL; const void *prop; @@ -258,16 +258,7 @@ void __init time_init(void) 0 }; #endif - const char * const timer_list[] = { - "xlnx,xps-timer-1.00.a", - NULL - }; - - for (i = 0; timer_list[i] != NULL; i++) { - timer = of_find_compatible_node(NULL, NULL, timer_list[i]); - if (timer) - break; - } + timer = of_find_compatible_node(NULL, NULL, "xlnx,xps-timer-1.00.a"); BUG_ON(!timer); timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); @@ -283,8 +274,8 @@ void __init time_init(void) #ifdef CONFIG_SELFMOD_TIMER selfmod_function((int *) arr_func, timer_baseaddr); #endif - printk(KERN_INFO "%s #0 at 0x%08x, irq=%d\n", - timer_list[i], timer_baseaddr, irq); + printk(KERN_INFO "XPS timer #0 at 0x%08x, irq=%d\n", + timer_baseaddr, irq); /* If there is clock-frequency property than use it */ prop = of_get_property(timer, "clock-frequency", NULL); -- cgit v1.2.3 From 9d0ced0084d8ae38883cc688ace8a9a4350d6bc9 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 9 Dec 2011 10:46:52 +0100 Subject: microblaze: Use irq_of_parse_and_map for timer It is necessary to call generic function for irq finding. The main reason is that this generic function calls irq_create_of_mapping which can add some shift because of NO_IRQ. Signed-off-by: Michal Simek --- arch/microblaze/kernel/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/microblaze/kernel/timer.c') diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index 3ba1e1c8c2eb..52e3eaf7f304 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -263,7 +263,7 @@ void __init time_init(void) timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE); - irq = be32_to_cpup(of_get_property(timer, "interrupts", NULL)); + irq = irq_of_parse_and_map(timer, 0); timer_num = be32_to_cpup(of_get_property(timer, "xlnx,one-timer-only", NULL)); if (timer_num) { -- cgit v1.2.3 From b6d5b28e446896278a0b02d6cc1bf4447ed07019 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 10 Nov 2011 13:38:54 +0100 Subject: microblaze: Remove eprintk macro eprintk macro was used for printing early_printk messages. Early console registration was changed that's why this is not needed. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/setup.h | 6 ------ arch/microblaze/kernel/setup.c | 18 +++++++++--------- arch/microblaze/kernel/timer.c | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) (limited to 'arch/microblaze/kernel/timer.c') diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h index 904e5ef6a11b..6c72ed7eba98 100644 --- a/arch/microblaze/include/asm/setup.h +++ b/arch/microblaze/include/asm/setup.h @@ -26,12 +26,6 @@ int setup_early_printk(char *opt); void remap_early_printk(void); void disable_early_printk(void); -#if defined(CONFIG_EARLY_PRINTK) -#define eprintk early_printk -#else -#define eprintk printk -#endif - void heartbeat(void); void setup_heartbeat(void); diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index 0e654a12d37e..604cd9dd1333 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c @@ -145,32 +145,32 @@ void __init machine_early_init(const char *cmdline, unsigned int ram, setup_early_printk(NULL); #endif - eprintk("Ramdisk addr 0x%08x, ", ram); + printk("Ramdisk addr 0x%08x, ", ram); if (fdt) - eprintk("FDT at 0x%08x\n", fdt); + printk("FDT at 0x%08x\n", fdt); else - eprintk("Compiled-in FDT at 0x%08x\n", + printk("Compiled-in FDT at 0x%08x\n", (unsigned int)_fdt_start); #ifdef CONFIG_MTD_UCLINUX - eprintk("Found romfs @ 0x%08x (0x%08x)\n", + printk("Found romfs @ 0x%08x (0x%08x)\n", romfs_base, romfs_size); - eprintk("#### klimit %p ####\n", old_klimit); + printk("#### klimit %p ####\n", old_klimit); BUG_ON(romfs_size < 0); /* What else can we do? */ - eprintk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n", + printk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n", romfs_size, romfs_base, (unsigned)&_ebss); - eprintk("New klimit: 0x%08x\n", (unsigned)klimit); + printk("New klimit: 0x%08x\n", (unsigned)klimit); #endif #if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR if (msr) - eprintk("!!!Your kernel has setup MSR instruction but " + printk("!!!Your kernel has setup MSR instruction but " "CPU don't have it %x\n", msr); #else if (!msr) - eprintk("!!!Your kernel not setup MSR instruction but " + printk("!!!Your kernel not setup MSR instruction but " "CPU have it %x\n", msr); #endif diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index 52e3eaf7f304..3cb0bf640135 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -267,7 +267,7 @@ void __init time_init(void) timer_num = be32_to_cpup(of_get_property(timer, "xlnx,one-timer-only", NULL)); if (timer_num) { - eprintk(KERN_EMERG "Please enable two timers in HW\n"); + printk(KERN_EMERG "Please enable two timers in HW\n"); BUG(); } -- cgit v1.2.3