aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 20:37:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 20:37:49 -0500
commit4690dfa8cd66c37fbe99bb8cd5baa86102110776 (patch)
tree063d1f68298cab19d29a4aa689d755266ae85a7d /arch/microblaze/kernel
parentc2e08e7ce5ab25a781197a71c5241742e8c9fdfe (diff)
parentf3aef2510e2bb28cdbf32e5f3b8f04f03336ac81 (diff)
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: Wire-up new system calls microblaze: Remove NO_IRQ from architecture input: xilinx_ps2: Don't use NO_IRQ block: xsysace: Don't use NO_IRQ microblaze: Trivial asm fix microblaze: Fix debug message in module microblaze: Remove eprintk macro microblaze: Send CR before LF for early console microblaze: Change NO_IRQ to 0 microblaze: Use irq_of_parse_and_map for timer microblaze: intc: Change variable name microblaze: Use of_find_compatible_node for timer and intc microblaze: Add __cmpdi2 microblaze: Synchronize __pa __va macros
Diffstat (limited to 'arch/microblaze/kernel')
-rw-r--r--arch/microblaze/kernel/early_printk.c4
-rw-r--r--arch/microblaze/kernel/entry.S2
-rw-r--r--arch/microblaze/kernel/intc.c52
-rw-r--r--arch/microblaze/kernel/irq.c11
-rw-r--r--arch/microblaze/kernel/module.c2
-rw-r--r--arch/microblaze/kernel/setup.c18
-rw-r--r--arch/microblaze/kernel/syscall_table.S3
-rw-r--r--arch/microblaze/kernel/timer.c21
8 files changed, 50 insertions, 63 deletions
diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c
index d26d92d47754..8356e47631c4 100644
--- a/arch/microblaze/kernel/early_printk.c
+++ b/arch/microblaze/kernel/early_printk.c
@@ -50,9 +50,9 @@ static void early_printk_uartlite_write(struct console *unused,
50 const char *s, unsigned n) 50 const char *s, unsigned n)
51{ 51{
52 while (*s && n-- > 0) { 52 while (*s && n-- > 0) {
53 early_printk_uartlite_putc(*s);
54 if (*s == '\n') 53 if (*s == '\n')
55 early_printk_uartlite_putc('\r'); 54 early_printk_uartlite_putc('\r');
55 early_printk_uartlite_putc(*s);
56 s++; 56 s++;
57 } 57 }
58} 58}
@@ -94,9 +94,9 @@ static void early_printk_uart16550_write(struct console *unused,
94 const char *s, unsigned n) 94 const char *s, unsigned n)
95{ 95{
96 while (*s && n-- > 0) { 96 while (*s && n-- > 0) {
97 early_printk_uart16550_putc(*s);
98 if (*s == '\n') 97 if (*s == '\n')
99 early_printk_uart16550_putc('\r'); 98 early_printk_uart16550_putc('\r');
99 early_printk_uart16550_putc(*s);
100 s++; 100 s++;
101 } 101 }
102} 102}
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S
index ca15bc5c7449..66e34a3bfe1b 100644
--- a/arch/microblaze/kernel/entry.S
+++ b/arch/microblaze/kernel/entry.S
@@ -468,7 +468,7 @@ C_ENTRY(sys_fork_wrapper):
468 addi r5, r0, SIGCHLD /* Arg 0: flags */ 468 addi r5, r0, SIGCHLD /* Arg 0: flags */
469 lwi r6, r1, PT_R1 /* Arg 1: child SP (use parent's) */ 469 lwi r6, r1, PT_R1 /* Arg 1: child SP (use parent's) */
470 addik r7, r1, 0 /* Arg 2: parent context */ 470 addik r7, r1, 0 /* Arg 2: parent context */
471 add r8. r0, r0 /* Arg 3: (unused) */ 471 add r8, r0, r0 /* Arg 3: (unused) */
472 add r9, r0, r0; /* Arg 4: (unused) */ 472 add r9, r0, r0; /* Arg 4: (unused) */
473 brid do_fork /* Do real work (tail-call) */ 473 brid do_fork /* Do real work (tail-call) */
474 add r10, r0, r0; /* Arg 5: (unused) */ 474 add r10, r0, r0; /* Arg 5: (unused) */
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index eb41441c7fd0..44b177e2ab12 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -42,8 +42,9 @@ unsigned int nr_irq;
42 42
43static void intc_enable_or_unmask(struct irq_data *d) 43static void intc_enable_or_unmask(struct irq_data *d)
44{ 44{
45 unsigned long mask = 1 << d->irq; 45 unsigned long mask = 1 << d->hwirq;
46 pr_debug("enable_or_unmask: %d\n", d->irq); 46
47 pr_debug("enable_or_unmask: %ld\n", d->hwirq);
47 out_be32(INTC_BASE + SIE, mask); 48 out_be32(INTC_BASE + SIE, mask);
48 49
49 /* ack level irqs because they can't be acked during 50 /* ack level irqs because they can't be acked during
@@ -56,20 +57,21 @@ static void intc_enable_or_unmask(struct irq_data *d)
56 57
57static void intc_disable_or_mask(struct irq_data *d) 58static void intc_disable_or_mask(struct irq_data *d)
58{ 59{
59 pr_debug("disable: %d\n", d->irq); 60 pr_debug("disable: %ld\n", d->hwirq);
60 out_be32(INTC_BASE + CIE, 1 << d->irq); 61 out_be32(INTC_BASE + CIE, 1 << d->hwirq);
61} 62}
62 63
63static void intc_ack(struct irq_data *d) 64static void intc_ack(struct irq_data *d)
64{ 65{
65 pr_debug("ack: %d\n", d->irq); 66 pr_debug("ack: %ld\n", d->hwirq);
66 out_be32(INTC_BASE + IAR, 1 << d->irq); 67 out_be32(INTC_BASE + IAR, 1 << d->hwirq);
67} 68}
68 69
69static void intc_mask_ack(struct irq_data *d) 70static void intc_mask_ack(struct irq_data *d)
70{ 71{
71 unsigned long mask = 1 << d->irq; 72 unsigned long mask = 1 << d->hwirq;
72 pr_debug("disable_and_ack: %d\n", d->irq); 73
74 pr_debug("disable_and_ack: %ld\n", d->hwirq);
73 out_be32(INTC_BASE + CIE, mask); 75 out_be32(INTC_BASE + CIE, mask);
74 out_be32(INTC_BASE + IAR, mask); 76 out_be32(INTC_BASE + IAR, mask);
75} 77}
@@ -91,7 +93,7 @@ unsigned int get_irq(struct pt_regs *regs)
91 * order to handle multiple interrupt controllers. It currently 93 * order to handle multiple interrupt controllers. It currently
92 * is hardcoded to check for interrupts only on the first INTC. 94 * is hardcoded to check for interrupts only on the first INTC.
93 */ 95 */
94 irq = in_be32(INTC_BASE + IVR); 96 irq = in_be32(INTC_BASE + IVR) + NO_IRQ_OFFSET;
95 pr_debug("get_irq: %d\n", irq); 97 pr_debug("get_irq: %d\n", irq);
96 98
97 return irq; 99 return irq;
@@ -99,7 +101,7 @@ unsigned int get_irq(struct pt_regs *regs)
99 101
100void __init init_IRQ(void) 102void __init init_IRQ(void)
101{ 103{
102 u32 i, j, intr_type; 104 u32 i, intr_mask;
103 struct device_node *intc = NULL; 105 struct device_node *intc = NULL;
104#ifdef CONFIG_SELFMOD_INTC 106#ifdef CONFIG_SELFMOD_INTC
105 unsigned int intc_baseaddr = 0; 107 unsigned int intc_baseaddr = 0;
@@ -113,35 +115,24 @@ void __init init_IRQ(void)
113 0 115 0
114 }; 116 };
115#endif 117#endif
116 const char * const intc_list[] = { 118 intc = of_find_compatible_node(NULL, NULL, "xlnx,xps-intc-1.00.a");
117 "xlnx,xps-intc-1.00.a",
118 NULL
119 };
120
121 for (j = 0; intc_list[j] != NULL; j++) {
122 intc = of_find_compatible_node(NULL, NULL, intc_list[j]);
123 if (intc)
124 break;
125 }
126 BUG_ON(!intc); 119 BUG_ON(!intc);
127 120
128 intc_baseaddr = be32_to_cpup(of_get_property(intc, 121 intc_baseaddr = be32_to_cpup(of_get_property(intc, "reg", NULL));
129 "reg", NULL));
130 intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE); 122 intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
131 nr_irq = be32_to_cpup(of_get_property(intc, 123 nr_irq = be32_to_cpup(of_get_property(intc,
132 "xlnx,num-intr-inputs", NULL)); 124 "xlnx,num-intr-inputs", NULL));
133 125
134 intr_type = 126 intr_mask =
135 be32_to_cpup(of_get_property(intc, 127 be32_to_cpup(of_get_property(intc, "xlnx,kind-of-intr", NULL));
136 "xlnx,kind-of-intr", NULL)); 128 if (intr_mask > (u32)((1ULL << nr_irq) - 1))
137 if (intr_type > (u32)((1ULL << nr_irq) - 1))
138 printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n"); 129 printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n");
139 130
140#ifdef CONFIG_SELFMOD_INTC 131#ifdef CONFIG_SELFMOD_INTC
141 selfmod_function((int *) arr_func, intc_baseaddr); 132 selfmod_function((int *) arr_func, intc_baseaddr);
142#endif 133#endif
143 printk(KERN_INFO "%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n", 134 printk(KERN_INFO "XPS intc #0 at 0x%08x, num_irq=%d, edge=0x%x\n",
144 intc_list[j], intc_baseaddr, nr_irq, intr_type); 135 intc_baseaddr, nr_irq, intr_mask);
145 136
146 /* 137 /*
147 * Disable all external interrupts until they are 138 * Disable all external interrupts until they are
@@ -155,8 +146,8 @@ void __init init_IRQ(void)
155 /* Turn on the Master Enable. */ 146 /* Turn on the Master Enable. */
156 out_be32(intc_baseaddr + MER, MER_HIE | MER_ME); 147 out_be32(intc_baseaddr + MER, MER_HIE | MER_ME);
157 148
158 for (i = 0; i < nr_irq; ++i) { 149 for (i = IRQ_OFFSET; i < (nr_irq + IRQ_OFFSET); ++i) {
159 if (intr_type & (0x00000001 << i)) { 150 if (intr_mask & (0x00000001 << (i - IRQ_OFFSET))) {
160 irq_set_chip_and_handler_name(i, &intc_dev, 151 irq_set_chip_and_handler_name(i, &intc_dev,
161 handle_edge_irq, "edge"); 152 handle_edge_irq, "edge");
162 irq_clear_status_flags(i, IRQ_LEVEL); 153 irq_clear_status_flags(i, IRQ_LEVEL);
@@ -165,5 +156,6 @@ void __init init_IRQ(void)
165 handle_level_irq, "level"); 156 handle_level_irq, "level");
166 irq_set_status_flags(i, IRQ_LEVEL); 157 irq_set_status_flags(i, IRQ_LEVEL);
167 } 158 }
159 irq_get_irq_data(i)->hwirq = i - IRQ_OFFSET;
168 } 160 }
169} 161}
diff --git a/arch/microblaze/kernel/irq.c b/arch/microblaze/kernel/irq.c
index e5d63a89b9b2..bbebcae72c02 100644
--- a/arch/microblaze/kernel/irq.c
+++ b/arch/microblaze/kernel/irq.c
@@ -33,11 +33,12 @@ void __irq_entry do_IRQ(struct pt_regs *regs)
33 irq_enter(); 33 irq_enter();
34 irq = get_irq(regs); 34 irq = get_irq(regs);
35next_irq: 35next_irq:
36 BUG_ON(irq == -1U); 36 BUG_ON(!irq);
37 generic_handle_irq(irq); 37 /* Substract 1 because of get_irq */
38 generic_handle_irq(irq + IRQ_OFFSET - NO_IRQ_OFFSET);
38 39
39 irq = get_irq(regs); 40 irq = get_irq(regs);
40 if (irq != -1U) { 41 if (irq) {
41 pr_debug("next irq: %d\n", irq); 42 pr_debug("next irq: %d\n", irq);
42 ++concurrent_irq; 43 ++concurrent_irq;
43 goto next_irq; 44 goto next_irq;
@@ -52,13 +53,13 @@ next_irq:
52 intc without any cascades or any connection that's why mapping is 1:1 */ 53 intc without any cascades or any connection that's why mapping is 1:1 */
53unsigned int irq_create_mapping(struct irq_host *host, irq_hw_number_t hwirq) 54unsigned int irq_create_mapping(struct irq_host *host, irq_hw_number_t hwirq)
54{ 55{
55 return hwirq; 56 return hwirq + IRQ_OFFSET;
56} 57}
57EXPORT_SYMBOL_GPL(irq_create_mapping); 58EXPORT_SYMBOL_GPL(irq_create_mapping);
58 59
59unsigned int irq_create_of_mapping(struct device_node *controller, 60unsigned int irq_create_of_mapping(struct device_node *controller,
60 const u32 *intspec, unsigned int intsize) 61 const u32 *intspec, unsigned int intsize)
61{ 62{
62 return intspec[0]; 63 return intspec[0] + IRQ_OFFSET;
63} 64}
64EXPORT_SYMBOL_GPL(irq_create_of_mapping); 65EXPORT_SYMBOL_GPL(irq_create_of_mapping);
diff --git a/arch/microblaze/kernel/module.c b/arch/microblaze/kernel/module.c
index 142426f631bb..f39257a5abcf 100644
--- a/arch/microblaze/kernel/module.c
+++ b/arch/microblaze/kernel/module.c
@@ -100,7 +100,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
100 break; 100 break;
101 101
102 case R_MICROBLAZE_64_NONE: 102 case R_MICROBLAZE_64_NONE:
103 pr_debug("R_MICROBLAZE_NONE\n"); 103 pr_debug("R_MICROBLAZE_64_NONE\n");
104 break; 104 break;
105 105
106 case R_MICROBLAZE_NONE: 106 case R_MICROBLAZE_NONE:
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,
145 setup_early_printk(NULL); 145 setup_early_printk(NULL);
146#endif 146#endif
147 147
148 eprintk("Ramdisk addr 0x%08x, ", ram); 148 printk("Ramdisk addr 0x%08x, ", ram);
149 if (fdt) 149 if (fdt)
150 eprintk("FDT at 0x%08x\n", fdt); 150 printk("FDT at 0x%08x\n", fdt);
151 else 151 else
152 eprintk("Compiled-in FDT at 0x%08x\n", 152 printk("Compiled-in FDT at 0x%08x\n",
153 (unsigned int)_fdt_start); 153 (unsigned int)_fdt_start);
154 154
155#ifdef CONFIG_MTD_UCLINUX 155#ifdef CONFIG_MTD_UCLINUX
156 eprintk("Found romfs @ 0x%08x (0x%08x)\n", 156 printk("Found romfs @ 0x%08x (0x%08x)\n",
157 romfs_base, romfs_size); 157 romfs_base, romfs_size);
158 eprintk("#### klimit %p ####\n", old_klimit); 158 printk("#### klimit %p ####\n", old_klimit);
159 BUG_ON(romfs_size < 0); /* What else can we do? */ 159 BUG_ON(romfs_size < 0); /* What else can we do? */
160 160
161 eprintk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n", 161 printk("Moved 0x%08x bytes from 0x%08x to 0x%08x\n",
162 romfs_size, romfs_base, (unsigned)&_ebss); 162 romfs_size, romfs_base, (unsigned)&_ebss);
163 163
164 eprintk("New klimit: 0x%08x\n", (unsigned)klimit); 164 printk("New klimit: 0x%08x\n", (unsigned)klimit);
165#endif 165#endif
166 166
167#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR 167#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
168 if (msr) 168 if (msr)
169 eprintk("!!!Your kernel has setup MSR instruction but " 169 printk("!!!Your kernel has setup MSR instruction but "
170 "CPU don't have it %x\n", msr); 170 "CPU don't have it %x\n", msr);
171#else 171#else
172 if (!msr) 172 if (!msr)
173 eprintk("!!!Your kernel not setup MSR instruction but " 173 printk("!!!Your kernel not setup MSR instruction but "
174 "CPU have it %x\n", msr); 174 "CPU have it %x\n", msr);
175#endif 175#endif
176 176
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index 8789daa2a346..6a2b294ef6dc 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -380,3 +380,6 @@ ENTRY(sys_call_table)
380 .long sys_clock_adjtime 380 .long sys_clock_adjtime
381 .long sys_syncfs 381 .long sys_syncfs
382 .long sys_setns /* 375 */ 382 .long sys_setns /* 375 */
383 .long sys_sendmmsg
384 .long sys_process_vm_readv
385 .long sys_process_vm_writev
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index af74b1113aab..3cb0bf640135 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -243,7 +243,7 @@ static int timer_initialized;
243 243
244void __init time_init(void) 244void __init time_init(void)
245{ 245{
246 u32 irq, i = 0; 246 u32 irq;
247 u32 timer_num = 1; 247 u32 timer_num = 1;
248 struct device_node *timer = NULL; 248 struct device_node *timer = NULL;
249 const void *prop; 249 const void *prop;
@@ -258,33 +258,24 @@ void __init time_init(void)
258 0 258 0
259 }; 259 };
260#endif 260#endif
261 const char * const timer_list[] = { 261 timer = of_find_compatible_node(NULL, NULL, "xlnx,xps-timer-1.00.a");
262 "xlnx,xps-timer-1.00.a",
263 NULL
264 };
265
266 for (i = 0; timer_list[i] != NULL; i++) {
267 timer = of_find_compatible_node(NULL, NULL, timer_list[i]);
268 if (timer)
269 break;
270 }
271 BUG_ON(!timer); 262 BUG_ON(!timer);
272 263
273 timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); 264 timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL));
274 timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE); 265 timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
275 irq = be32_to_cpup(of_get_property(timer, "interrupts", NULL)); 266 irq = irq_of_parse_and_map(timer, 0);
276 timer_num = be32_to_cpup(of_get_property(timer, 267 timer_num = be32_to_cpup(of_get_property(timer,
277 "xlnx,one-timer-only", NULL)); 268 "xlnx,one-timer-only", NULL));
278 if (timer_num) { 269 if (timer_num) {
279 eprintk(KERN_EMERG "Please enable two timers in HW\n"); 270 printk(KERN_EMERG "Please enable two timers in HW\n");
280 BUG(); 271 BUG();
281 } 272 }
282 273
283#ifdef CONFIG_SELFMOD_TIMER 274#ifdef CONFIG_SELFMOD_TIMER
284 selfmod_function((int *) arr_func, timer_baseaddr); 275 selfmod_function((int *) arr_func, timer_baseaddr);
285#endif 276#endif
286 printk(KERN_INFO "%s #0 at 0x%08x, irq=%d\n", 277 printk(KERN_INFO "XPS timer #0 at 0x%08x, irq=%d\n",
287 timer_list[i], timer_baseaddr, irq); 278 timer_baseaddr, irq);
288 279
289 /* If there is clock-frequency property than use it */ 280 /* If there is clock-frequency property than use it */
290 prop = of_get_property(timer, "clock-frequency", NULL); 281 prop = of_get_property(timer, "clock-frequency", NULL);