aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2009-07-30 08:31:23 -0400
committerMichal Simek <monstr@monstr.eu>2009-09-21 08:29:21 -0400
commit2622434ee0108c65808a63f067e72d0bbc75b372 (patch)
treec6f89cd62d636bbdc6e96c589481d79b7b67c3da /arch/microblaze
parent8cc11f5ab5384dad6c63905f71882e65cd70b7b7 (diff)
microblaze: Add checking mechanism for MSR instruction
It was necessary to use fourth parameter(r8) in early_printk to show messages on console. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/include/asm/setup.h2
-rw-r--r--arch/microblaze/kernel/head.S17
-rw-r--r--arch/microblaze/kernel/setup.c12
3 files changed, 27 insertions, 4 deletions
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 27f8dafd8c34..ed67c9ed15b8 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -38,7 +38,7 @@ extern void early_console_reg_tlb_alloc(unsigned int addr);
38void time_init(void); 38void time_init(void);
39void init_IRQ(void); 39void init_IRQ(void);
40void machine_early_init(const char *cmdline, unsigned int ram, 40void machine_early_init(const char *cmdline, unsigned int ram,
41 unsigned int fdt); 41 unsigned int fdt, unsigned int msr);
42 42
43void machine_restart(char *cmd); 43void machine_restart(char *cmd);
44void machine_shutdown(void); 44void machine_shutdown(void);
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index e41c6ce2a7be..bfc7ea801cc4 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -55,6 +55,19 @@ ENTRY(_start)
55 andi r1, r1, ~2 55 andi r1, r1, ~2
56 mts rmsr, r1 56 mts rmsr, r1
57 57
58/*
59 * Here is checking mechanism which check if Microblaze has msr instructions
60 * We load msr and compare it with previous r1 value - if is the same,
61 * msr instructions works if not - cpu don't have them.
62 */
63 or r8, r0, r0 /* 0 - I have msr instr, 1 - I don't have */
64 or r12, r0, r0
65 msrset r12, 0 /* set nothing - just read msr for test */
66 cmpu r12, r12, r1
67 beqi r12, 1f
68 ori r8, r0, 1 /* I don't have msr */
691:
70
58/* r7 may point to an FDT, or there may be one linked in. 71/* r7 may point to an FDT, or there may be one linked in.
59 if it's in r7, we've got to save it away ASAP. 72 if it's in r7, we've got to save it away ASAP.
60 We ensure r7 points to a valid FDT, just in case the bootloader 73 We ensure r7 points to a valid FDT, just in case the bootloader
@@ -209,8 +222,8 @@ start_here:
209 * Please see $(ARCH)/mach-$(SUBARCH)/setup.c for 222 * Please see $(ARCH)/mach-$(SUBARCH)/setup.c for
210 * the function. 223 * the function.
211 */ 224 */
212 la r8, r0, machine_early_init 225 la r9, r0, machine_early_init
213 brald r15, r8 226 brald r15, r9
214 nop 227 nop
215 228
216#ifndef CONFIG_MMU 229#ifndef CONFIG_MMU
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 2a97bf513b64..8c1e0f4dcf18 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -94,7 +94,7 @@ inline unsigned get_romfs_len(unsigned *addr)
94#endif /* CONFIG_MTD_UCLINUX_EBSS */ 94#endif /* CONFIG_MTD_UCLINUX_EBSS */
95 95
96void __init machine_early_init(const char *cmdline, unsigned int ram, 96void __init machine_early_init(const char *cmdline, unsigned int ram,
97 unsigned int fdt) 97 unsigned int fdt, unsigned int msr)
98{ 98{
99 unsigned long *src, *dst = (unsigned long *)0x0; 99 unsigned long *src, *dst = (unsigned long *)0x0;
100 100
@@ -157,6 +157,16 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
157 early_printk("New klimit: 0x%08x\n", (unsigned)klimit); 157 early_printk("New klimit: 0x%08x\n", (unsigned)klimit);
158#endif 158#endif
159 159
160#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
161 if (msr)
162 early_printk("!!!Your kernel has setup MSR instruction but "
163 "CPU don't have it %d\n", msr);
164#else
165 if (!msr)
166 early_printk("!!!Your kernel not setup MSR instruction but "
167 "CPU have it %d\n", msr);
168#endif
169
160 for (src = __ivt_start; src < __ivt_end; src++, dst++) 170 for (src = __ivt_start; src < __ivt_end; src++, dst++)
161 *dst = *src; 171 *dst = *src;
162 172