aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-09-28 02:04:14 -0400
committerMichal Simek <monstr@monstr.eu>2010-10-21 01:51:59 -0400
commit02b08045a0306c38131c6d7155c4034a775d40b1 (patch)
treee146f1811ec3c93ff4877a895e42b71a91932d2b /arch/microblaze/kernel
parente4f29092272ee91a34d3660c31f15ed103057aa0 (diff)
microblaze: Add support for little-endian Microblaze
Microblaze little-endian toolchain exports __MICROBLAZEEL__ which is used in the kernel to identify little/big endian. The most of the changes are in loading values from DTB which is always big endian. Little endian platforms are based on new AXI bus which has impact to early uartlite initialization. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel')
-rw-r--r--arch/microblaze/kernel/heartbeat.c2
-rw-r--r--arch/microblaze/kernel/intc.c9
-rw-r--r--arch/microblaze/kernel/prom.c7
-rw-r--r--arch/microblaze/kernel/timer.c8
-rw-r--r--arch/microblaze/kernel/vmlinux.lds.S4
5 files changed, 19 insertions, 11 deletions
diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c
index 5c24eb8219f1..154756f3c694 100644
--- a/arch/microblaze/kernel/heartbeat.c
+++ b/arch/microblaze/kernel/heartbeat.c
@@ -59,7 +59,7 @@ void setup_heartbeat(void)
59 } 59 }
60 60
61 if (gpio) { 61 if (gpio) {
62 base_addr = *(int *) of_get_property(gpio, "reg", NULL); 62 base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL));
63 base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); 63 base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE);
64 printk(KERN_NOTICE "Heartbeat GPIO at 0x%x\n", base_addr); 64 printk(KERN_NOTICE "Heartbeat GPIO at 0x%x\n", base_addr);
65 65
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index e85bbea1c62b..d61ea33aff7c 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -138,12 +138,15 @@ void __init init_IRQ(void)
138 } 138 }
139 BUG_ON(!intc); 139 BUG_ON(!intc);
140 140
141 intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL); 141 intc_baseaddr = be32_to_cpup(of_get_property(intc,
142 "reg", NULL));
142 intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE); 143 intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
143 nr_irq = *(int *) of_get_property(intc, "xlnx,num-intr-inputs", NULL); 144 nr_irq = be32_to_cpup(of_get_property(intc,
145 "xlnx,num-intr-inputs", NULL));
144 146
145 intr_type = 147 intr_type =
146 *(int *) of_get_property(intc, "xlnx,kind-of-intr", NULL); 148 be32_to_cpup(of_get_property(intc,
149 "xlnx,kind-of-intr", NULL));
147 if (intr_type >= (1 << (nr_irq + 1))) 150 if (intr_type >= (1 << (nr_irq + 1)))
148 printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n"); 151 printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n");
149 152
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 608e5cf2e10a..04d3325039d9 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -77,11 +77,12 @@ static int __init early_init_dt_scan_serial(unsigned long node,
77/* find compatible node with uartlite */ 77/* find compatible node with uartlite */
78 p = of_get_flat_dt_prop(node, "compatible", &l); 78 p = of_get_flat_dt_prop(node, "compatible", &l);
79 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) && 79 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) &&
80 (strncmp(p, "xlnx,opb-uartlite", 17) != 0)) 80 (strncmp(p, "xlnx,opb-uartlite", 17) != 0) &&
81 (strncmp(p, "xlnx,axi-uartlite", 17) != 0))
81 return 0; 82 return 0;
82 83
83 addr = of_get_flat_dt_prop(node, "reg", &l); 84 addr = of_get_flat_dt_prop(node, "reg", &l);
84 return *addr; /* return address */ 85 return be32_to_cpup(addr); /* return address */
85} 86}
86 87
87/* this function is looking for early uartlite console - Microblaze specific */ 88/* this function is looking for early uartlite console - Microblaze specific */
@@ -115,7 +116,7 @@ static int __init early_init_dt_scan_serial_full(unsigned long node,
115 116
116 addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l); 117 addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l);
117 addr += *(u32 *)of_get_flat_dt_prop(node, "reg-offset", &l); 118 addr += *(u32 *)of_get_flat_dt_prop(node, "reg-offset", &l);
118 return addr; /* return address */ 119 return be32_to_cpu(addr); /* return address */
119} 120}
120 121
121/* this function is looking for early uartlite console - Microblaze specific */ 122/* this function is looking for early uartlite console - Microblaze specific */
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index 64ca14dbac6e..fcb97e86003d 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -270,11 +270,11 @@ void __init time_init(void)
270 } 270 }
271 BUG_ON(!timer); 271 BUG_ON(!timer);
272 272
273 timer_baseaddr = *(int *) of_get_property(timer, "reg", NULL); 273 timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL));
274 timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE); 274 timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
275 irq = *(int *) of_get_property(timer, "interrupts", NULL); 275 irq = be32_to_cpup(of_get_property(timer, "interrupts", NULL));
276 timer_num = 276 timer_num = be32_to_cpup(of_get_property(timer,
277 *(int *) of_get_property(timer, "xlnx,one-timer-only", NULL); 277 "xlnx,one-timer-only", NULL));
278 if (timer_num) { 278 if (timer_num) {
279 eprintk(KERN_EMERG "Please enable two timers in HW\n"); 279 eprintk(KERN_EMERG "Please enable two timers in HW\n");
280 BUG(); 280 BUG();
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index 20b0552391d1..96a88c31fe48 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -15,7 +15,11 @@ ENTRY(microblaze_start)
15#include <asm-generic/vmlinux.lds.h> 15#include <asm-generic/vmlinux.lds.h>
16#include <asm/thread_info.h> 16#include <asm/thread_info.h>
17 17
18#ifdef __MICROBLAZEEL__
19jiffies = jiffies_64;
20#else
18jiffies = jiffies_64 + 4; 21jiffies = jiffies_64 + 4;
22#endif
19 23
20SECTIONS { 24SECTIONS {
21 . = CONFIG_KERNEL_START; 25 . = CONFIG_KERNEL_START;