diff options
author | Michal Simek <monstr@monstr.eu> | 2010-09-28 06:04:14 (GMT) |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-10-21 05:51:59 (GMT) |
commit | 02b08045a0306c38131c6d7155c4034a775d40b1 (patch) | |
tree | e146f1811ec3c93ff4877a895e42b71a91932d2b /arch/microblaze/kernel | |
parent | e4f29092272ee91a34d3660c31f15ed103057aa0 (diff) | |
download | linux-02b08045a0306c38131c6d7155c4034a775d40b1.tar.xz |
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.c | 2 | ||||
-rw-r--r-- | arch/microblaze/kernel/intc.c | 9 | ||||
-rw-r--r-- | arch/microblaze/kernel/prom.c | 7 | ||||
-rw-r--r-- | arch/microblaze/kernel/timer.c | 8 | ||||
-rw-r--r-- | arch/microblaze/kernel/vmlinux.lds.S | 4 |
5 files changed, 19 insertions, 11 deletions
diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c index 5c24eb8..154756f 100644 --- a/arch/microblaze/kernel/heartbeat.c +++ b/arch/microblaze/kernel/heartbeat.c @@ -59,7 +59,7 @@ void setup_heartbeat(void) } if (gpio) { - base_addr = *(int *) of_get_property(gpio, "reg", NULL); + base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL)); base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); printk(KERN_NOTICE "Heartbeat GPIO at 0x%x\n", base_addr); diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c index e85bbea..d61ea33 100644 --- a/arch/microblaze/kernel/intc.c +++ b/arch/microblaze/kernel/intc.c @@ -138,12 +138,15 @@ void __init init_IRQ(void) } BUG_ON(!intc); - intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL); + intc_baseaddr = be32_to_cpup(of_get_property(intc, + "reg", NULL)); intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE); - nr_irq = *(int *) of_get_property(intc, "xlnx,num-intr-inputs", NULL); + nr_irq = be32_to_cpup(of_get_property(intc, + "xlnx,num-intr-inputs", NULL)); intr_type = - *(int *) of_get_property(intc, "xlnx,kind-of-intr", NULL); + be32_to_cpup(of_get_property(intc, + "xlnx,kind-of-intr", NULL)); if (intr_type >= (1 << (nr_irq + 1))) printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n"); diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c index 608e5cf..04d3325 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, /* find compatible node with uartlite */ p = of_get_flat_dt_prop(node, "compatible", &l); if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) && - (strncmp(p, "xlnx,opb-uartlite", 17) != 0)) + (strncmp(p, "xlnx,opb-uartlite", 17) != 0) && + (strncmp(p, "xlnx,axi-uartlite", 17) != 0)) return 0; addr = of_get_flat_dt_prop(node, "reg", &l); - return *addr; /* return address */ + return be32_to_cpup(addr); /* return address */ } /* 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, addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l); addr += *(u32 *)of_get_flat_dt_prop(node, "reg-offset", &l); - return addr; /* return address */ + return be32_to_cpu(addr); /* return address */ } /* 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 64ca14d..fcb97e8 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -270,11 +270,11 @@ void __init time_init(void) } BUG_ON(!timer); - timer_baseaddr = *(int *) of_get_property(timer, "reg", NULL); + timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL)); timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE); - irq = *(int *) of_get_property(timer, "interrupts", NULL); - timer_num = - *(int *) of_get_property(timer, "xlnx,one-timer-only", NULL); + irq = be32_to_cpup(of_get_property(timer, "interrupts", NULL)); + 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"); BUG(); diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S index 20b0552..96a88c3 100644 --- a/arch/microblaze/kernel/vmlinux.lds.S +++ b/arch/microblaze/kernel/vmlinux.lds.S @@ -15,7 +15,11 @@ ENTRY(microblaze_start) #include <asm-generic/vmlinux.lds.h> #include <asm/thread_info.h> +#ifdef __MICROBLAZEEL__ +jiffies = jiffies_64; +#else jiffies = jiffies_64 + 4; +#endif SECTIONS { . = CONFIG_KERNEL_START; |