diff options
Diffstat (limited to 'arch/microblaze/kernel')
-rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | 1 | ||||
-rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo-static.c | 1 | ||||
-rw-r--r-- | arch/microblaze/kernel/cpu/cpuinfo.c | 4 | ||||
-rw-r--r-- | arch/microblaze/kernel/cpu/mb.c | 9 | ||||
-rw-r--r-- | arch/microblaze/kernel/early_printk.c | 68 | ||||
-rw-r--r-- | arch/microblaze/kernel/hw_exception_handler.S | 56 | ||||
-rw-r--r-- | arch/microblaze/kernel/intc.c | 2 | ||||
-rw-r--r-- | arch/microblaze/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/microblaze/kernel/prom.c | 97 | ||||
-rw-r--r-- | arch/microblaze/kernel/setup.c | 5 |
10 files changed, 128 insertions, 116 deletions
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c index f70a6047f08e..916aaedf1945 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | |||
@@ -72,6 +72,7 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) | |||
72 | CI(pvr_user2, USER2); | 72 | CI(pvr_user2, USER2); |
73 | 73 | ||
74 | CI(mmu, USE_MMU); | 74 | CI(mmu, USE_MMU); |
75 | CI(mmu_privins, MMU_PRIVINS); | ||
75 | CI(endian, ENDIAN); | 76 | CI(endian, ENDIAN); |
76 | 77 | ||
77 | CI(use_icache, USE_ICACHE); | 78 | CI(use_icache, USE_ICACHE); |
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c index b16b994ca3d2..592bb2e838c4 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-static.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c | |||
@@ -119,6 +119,7 @@ void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) | |||
119 | ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2"); | 119 | ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2"); |
120 | 120 | ||
121 | ci->mmu = fcpu(cpu, "xlnx,use-mmu"); | 121 | ci->mmu = fcpu(cpu, "xlnx,use-mmu"); |
122 | ci->mmu_privins = fcpu(cpu, "xlnx,mmu-privileged-instr"); | ||
122 | ci->endian = fcpu(cpu, "xlnx,endianness"); | 123 | ci->endian = fcpu(cpu, "xlnx,endianness"); |
123 | 124 | ||
124 | ci->ver_code = 0; | 125 | ci->ver_code = 0; |
diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c index c1640c52711f..44394d80a683 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo.c +++ b/arch/microblaze/kernel/cpu/cpuinfo.c | |||
@@ -88,4 +88,8 @@ void __init setup_cpuinfo(void) | |||
88 | printk(KERN_WARNING "%s: Unsupported PVR setting\n", __func__); | 88 | printk(KERN_WARNING "%s: Unsupported PVR setting\n", __func__); |
89 | set_cpuinfo_static(&cpuinfo, cpu); | 89 | set_cpuinfo_static(&cpuinfo, cpu); |
90 | } | 90 | } |
91 | |||
92 | if (cpuinfo.mmu_privins) | ||
93 | printk(KERN_WARNING "%s: Stream instructions enabled" | ||
94 | " - USERSPACE CAN LOCK THIS KERNEL!\n", __func__); | ||
91 | } | 95 | } |
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c index b4048af02615..7b5dca7ed39d 100644 --- a/arch/microblaze/kernel/cpu/mb.c +++ b/arch/microblaze/kernel/cpu/mb.c | |||
@@ -97,6 +97,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
97 | (cpuinfo.use_exc & PVR2_FPU_EXC_MASK) ? "fpu " : "", | 97 | (cpuinfo.use_exc & PVR2_FPU_EXC_MASK) ? "fpu " : "", |
98 | (cpuinfo.use_exc & PVR2_USE_FSL_EXC) ? "fsl " : ""); | 98 | (cpuinfo.use_exc & PVR2_USE_FSL_EXC) ? "fsl " : ""); |
99 | 99 | ||
100 | count += seq_printf(m, | ||
101 | "Stream-insns:\t%sprivileged\n", | ||
102 | cpuinfo.mmu_privins ? "un" : ""); | ||
103 | |||
100 | if (cpuinfo.use_icache) | 104 | if (cpuinfo.use_icache) |
101 | count += seq_printf(m, | 105 | count += seq_printf(m, |
102 | "Icache:\t\t%ukB\tline length:\t%dB\n", | 106 | "Icache:\t\t%ukB\tline length:\t%dB\n", |
@@ -110,10 +114,11 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
110 | "Dcache:\t\t%ukB\tline length:\t%dB\n", | 114 | "Dcache:\t\t%ukB\tline length:\t%dB\n", |
111 | cpuinfo.dcache_size >> 10, | 115 | cpuinfo.dcache_size >> 10, |
112 | cpuinfo.dcache_line_length); | 116 | cpuinfo.dcache_line_length); |
117 | seq_printf(m, "Dcache-Policy:\t"); | ||
113 | if (cpuinfo.dcache_wb) | 118 | if (cpuinfo.dcache_wb) |
114 | count += seq_printf(m, "\t\twrite-back\n"); | 119 | count += seq_printf(m, "write-back\n"); |
115 | else | 120 | else |
116 | count += seq_printf(m, "\t\twrite-through\n"); | 121 | count += seq_printf(m, "write-through\n"); |
117 | } else | 122 | } else |
118 | count += seq_printf(m, "Dcache:\t\tno\n"); | 123 | count += seq_printf(m, "Dcache:\t\tno\n"); |
119 | 124 | ||
diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c index c3616a080ebf..d26d92d47754 100644 --- a/arch/microblaze/kernel/early_printk.c +++ b/arch/microblaze/kernel/early_printk.c | |||
@@ -35,7 +35,7 @@ static void early_printk_uartlite_putc(char c) | |||
35 | * we'll never timeout on a working UART. | 35 | * we'll never timeout on a working UART. |
36 | */ | 36 | */ |
37 | 37 | ||
38 | unsigned retries = 10000; | 38 | unsigned retries = 1000000; |
39 | /* read status bit - 0x8 offset */ | 39 | /* read status bit - 0x8 offset */ |
40 | while (--retries && (in_be32(base_addr + 8) & (1 << 3))) | 40 | while (--retries && (in_be32(base_addr + 8) & (1 << 3))) |
41 | ; | 41 | ; |
@@ -60,7 +60,7 @@ static void early_printk_uartlite_write(struct console *unused, | |||
60 | static struct console early_serial_uartlite_console = { | 60 | static struct console early_serial_uartlite_console = { |
61 | .name = "earlyser", | 61 | .name = "earlyser", |
62 | .write = early_printk_uartlite_write, | 62 | .write = early_printk_uartlite_write, |
63 | .flags = CON_PRINTBUFFER, | 63 | .flags = CON_PRINTBUFFER | CON_BOOT, |
64 | .index = -1, | 64 | .index = -1, |
65 | }; | 65 | }; |
66 | #endif /* CONFIG_SERIAL_UARTLITE_CONSOLE */ | 66 | #endif /* CONFIG_SERIAL_UARTLITE_CONSOLE */ |
@@ -104,7 +104,7 @@ static void early_printk_uart16550_write(struct console *unused, | |||
104 | static struct console early_serial_uart16550_console = { | 104 | static struct console early_serial_uart16550_console = { |
105 | .name = "earlyser", | 105 | .name = "earlyser", |
106 | .write = early_printk_uart16550_write, | 106 | .write = early_printk_uart16550_write, |
107 | .flags = CON_PRINTBUFFER, | 107 | .flags = CON_PRINTBUFFER | CON_BOOT, |
108 | .index = -1, | 108 | .index = -1, |
109 | }; | 109 | }; |
110 | #endif /* CONFIG_SERIAL_8250_CONSOLE */ | 110 | #endif /* CONFIG_SERIAL_8250_CONSOLE */ |
@@ -127,48 +127,56 @@ void early_printk(const char *fmt, ...) | |||
127 | 127 | ||
128 | int __init setup_early_printk(char *opt) | 128 | int __init setup_early_printk(char *opt) |
129 | { | 129 | { |
130 | int version = 0; | ||
131 | |||
130 | if (early_console_initialized) | 132 | if (early_console_initialized) |
131 | return 1; | 133 | return 1; |
132 | 134 | ||
133 | #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE | 135 | base_addr = of_early_console(&version); |
134 | base_addr = early_uartlite_console(); | ||
135 | if (base_addr) { | 136 | if (base_addr) { |
136 | early_console_initialized = 1; | ||
137 | #ifdef CONFIG_MMU | 137 | #ifdef CONFIG_MMU |
138 | early_console_reg_tlb_alloc(base_addr); | 138 | early_console_reg_tlb_alloc(base_addr); |
139 | #endif | 139 | #endif |
140 | early_console = &early_serial_uartlite_console; | 140 | switch (version) { |
141 | early_printk("early_printk_console is enabled at 0x%08x\n", | 141 | #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE |
142 | base_addr); | 142 | case UARTLITE: |
143 | 143 | printk(KERN_INFO "Early console on uartlite " | |
144 | /* register_console(early_console); */ | 144 | "at 0x%08x\n", base_addr); |
145 | 145 | early_console = &early_serial_uartlite_console; | |
146 | return 0; | 146 | break; |
147 | } | 147 | #endif |
148 | #endif /* CONFIG_SERIAL_UARTLITE_CONSOLE */ | ||
149 | |||
150 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 148 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
151 | base_addr = early_uart16550_console(); | 149 | case UART16550: |
152 | base_addr &= ~3; /* clear register offset */ | 150 | printk(KERN_INFO "Early console on uart16650 " |
153 | if (base_addr) { | 151 | "at 0x%08x\n", base_addr); |
154 | early_console_initialized = 1; | 152 | early_console = &early_serial_uart16550_console; |
155 | #ifdef CONFIG_MMU | 153 | break; |
156 | early_console_reg_tlb_alloc(base_addr); | ||
157 | #endif | 154 | #endif |
158 | early_console = &early_serial_uart16550_console; | 155 | default: |
159 | 156 | printk(KERN_INFO "Unsupported early console %d\n", | |
160 | early_printk("early_printk_console is enabled at 0x%08x\n", | 157 | version); |
161 | base_addr); | 158 | return 1; |
162 | 159 | } | |
163 | /* register_console(early_console); */ | ||
164 | 160 | ||
161 | register_console(early_console); | ||
162 | early_console_initialized = 1; | ||
165 | return 0; | 163 | return 0; |
166 | } | 164 | } |
167 | #endif /* CONFIG_SERIAL_8250_CONSOLE */ | ||
168 | |||
169 | return 1; | 165 | return 1; |
170 | } | 166 | } |
171 | 167 | ||
168 | /* Remap early console to virtual address and do not allocate one TLB | ||
169 | * only for early console because of performance degression */ | ||
170 | void __init remap_early_printk(void) | ||
171 | { | ||
172 | if (!early_console_initialized || !early_console) | ||
173 | return; | ||
174 | printk(KERN_INFO "early_printk_console remaping from 0x%x to ", | ||
175 | base_addr); | ||
176 | base_addr = (u32) ioremap(base_addr, PAGE_SIZE); | ||
177 | printk(KERN_CONT "0x%x\n", base_addr); | ||
178 | } | ||
179 | |||
172 | void __init disable_early_printk(void) | 180 | void __init disable_early_printk(void) |
173 | { | 181 | { |
174 | if (!early_console_initialized || !early_console) | 182 | if (!early_console_initialized || !early_console) |
diff --git a/arch/microblaze/kernel/hw_exception_handler.S b/arch/microblaze/kernel/hw_exception_handler.S index 56572e923a83..e62be8379604 100644 --- a/arch/microblaze/kernel/hw_exception_handler.S +++ b/arch/microblaze/kernel/hw_exception_handler.S | |||
@@ -1113,23 +1113,23 @@ lw_r10_vm: R3_TO_LWREG_VM_V (10); | |||
1113 | lw_r11_vm: R3_TO_LWREG_VM_V (11); | 1113 | lw_r11_vm: R3_TO_LWREG_VM_V (11); |
1114 | lw_r12_vm: R3_TO_LWREG_VM_V (12); | 1114 | lw_r12_vm: R3_TO_LWREG_VM_V (12); |
1115 | lw_r13_vm: R3_TO_LWREG_VM_V (13); | 1115 | lw_r13_vm: R3_TO_LWREG_VM_V (13); |
1116 | lw_r14_vm: R3_TO_LWREG_VM (14); | 1116 | lw_r14_vm: R3_TO_LWREG_VM_V (14); |
1117 | lw_r15_vm: R3_TO_LWREG_VM_V (15); | 1117 | lw_r15_vm: R3_TO_LWREG_VM_V (15); |
1118 | lw_r16_vm: R3_TO_LWREG_VM (16); | 1118 | lw_r16_vm: R3_TO_LWREG_VM_V (16); |
1119 | lw_r17_vm: R3_TO_LWREG_VM_V (17); | 1119 | lw_r17_vm: R3_TO_LWREG_VM_V (17); |
1120 | lw_r18_vm: R3_TO_LWREG_VM_V (18); | 1120 | lw_r18_vm: R3_TO_LWREG_VM_V (18); |
1121 | lw_r19_vm: R3_TO_LWREG_VM (19); | 1121 | lw_r19_vm: R3_TO_LWREG_VM_V (19); |
1122 | lw_r20_vm: R3_TO_LWREG_VM (20); | 1122 | lw_r20_vm: R3_TO_LWREG_VM_V (20); |
1123 | lw_r21_vm: R3_TO_LWREG_VM (21); | 1123 | lw_r21_vm: R3_TO_LWREG_VM_V (21); |
1124 | lw_r22_vm: R3_TO_LWREG_VM (22); | 1124 | lw_r22_vm: R3_TO_LWREG_VM_V (22); |
1125 | lw_r23_vm: R3_TO_LWREG_VM (23); | 1125 | lw_r23_vm: R3_TO_LWREG_VM_V (23); |
1126 | lw_r24_vm: R3_TO_LWREG_VM (24); | 1126 | lw_r24_vm: R3_TO_LWREG_VM_V (24); |
1127 | lw_r25_vm: R3_TO_LWREG_VM (25); | 1127 | lw_r25_vm: R3_TO_LWREG_VM_V (25); |
1128 | lw_r26_vm: R3_TO_LWREG_VM (26); | 1128 | lw_r26_vm: R3_TO_LWREG_VM_V (26); |
1129 | lw_r27_vm: R3_TO_LWREG_VM (27); | 1129 | lw_r27_vm: R3_TO_LWREG_VM_V (27); |
1130 | lw_r28_vm: R3_TO_LWREG_VM (28); | 1130 | lw_r28_vm: R3_TO_LWREG_VM_V (28); |
1131 | lw_r29_vm: R3_TO_LWREG_VM (29); | 1131 | lw_r29_vm: R3_TO_LWREG_VM_V (29); |
1132 | lw_r30_vm: R3_TO_LWREG_VM (30); | 1132 | lw_r30_vm: R3_TO_LWREG_VM_V (30); |
1133 | lw_r31_vm: R3_TO_LWREG_VM_V (31); | 1133 | lw_r31_vm: R3_TO_LWREG_VM_V (31); |
1134 | 1134 | ||
1135 | sw_table_vm: | 1135 | sw_table_vm: |
@@ -1147,23 +1147,23 @@ sw_r10_vm: SWREG_TO_R3_VM_V (10); | |||
1147 | sw_r11_vm: SWREG_TO_R3_VM_V (11); | 1147 | sw_r11_vm: SWREG_TO_R3_VM_V (11); |
1148 | sw_r12_vm: SWREG_TO_R3_VM_V (12); | 1148 | sw_r12_vm: SWREG_TO_R3_VM_V (12); |
1149 | sw_r13_vm: SWREG_TO_R3_VM_V (13); | 1149 | sw_r13_vm: SWREG_TO_R3_VM_V (13); |
1150 | sw_r14_vm: SWREG_TO_R3_VM (14); | 1150 | sw_r14_vm: SWREG_TO_R3_VM_V (14); |
1151 | sw_r15_vm: SWREG_TO_R3_VM_V (15); | 1151 | sw_r15_vm: SWREG_TO_R3_VM_V (15); |
1152 | sw_r16_vm: SWREG_TO_R3_VM (16); | 1152 | sw_r16_vm: SWREG_TO_R3_VM_V (16); |
1153 | sw_r17_vm: SWREG_TO_R3_VM_V (17); | 1153 | sw_r17_vm: SWREG_TO_R3_VM_V (17); |
1154 | sw_r18_vm: SWREG_TO_R3_VM_V (18); | 1154 | sw_r18_vm: SWREG_TO_R3_VM_V (18); |
1155 | sw_r19_vm: SWREG_TO_R3_VM (19); | 1155 | sw_r19_vm: SWREG_TO_R3_VM_V (19); |
1156 | sw_r20_vm: SWREG_TO_R3_VM (20); | 1156 | sw_r20_vm: SWREG_TO_R3_VM_V (20); |
1157 | sw_r21_vm: SWREG_TO_R3_VM (21); | 1157 | sw_r21_vm: SWREG_TO_R3_VM_V (21); |
1158 | sw_r22_vm: SWREG_TO_R3_VM (22); | 1158 | sw_r22_vm: SWREG_TO_R3_VM_V (22); |
1159 | sw_r23_vm: SWREG_TO_R3_VM (23); | 1159 | sw_r23_vm: SWREG_TO_R3_VM_V (23); |
1160 | sw_r24_vm: SWREG_TO_R3_VM (24); | 1160 | sw_r24_vm: SWREG_TO_R3_VM_V (24); |
1161 | sw_r25_vm: SWREG_TO_R3_VM (25); | 1161 | sw_r25_vm: SWREG_TO_R3_VM_V (25); |
1162 | sw_r26_vm: SWREG_TO_R3_VM (26); | 1162 | sw_r26_vm: SWREG_TO_R3_VM_V (26); |
1163 | sw_r27_vm: SWREG_TO_R3_VM (27); | 1163 | sw_r27_vm: SWREG_TO_R3_VM_V (27); |
1164 | sw_r28_vm: SWREG_TO_R3_VM (28); | 1164 | sw_r28_vm: SWREG_TO_R3_VM_V (28); |
1165 | sw_r29_vm: SWREG_TO_R3_VM (29); | 1165 | sw_r29_vm: SWREG_TO_R3_VM_V (29); |
1166 | sw_r30_vm: SWREG_TO_R3_VM (30); | 1166 | sw_r30_vm: SWREG_TO_R3_VM_V (30); |
1167 | sw_r31_vm: SWREG_TO_R3_VM_V (31); | 1167 | sw_r31_vm: SWREG_TO_R3_VM_V (31); |
1168 | #endif /* CONFIG_MMU */ | 1168 | #endif /* CONFIG_MMU */ |
1169 | 1169 | ||
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c index c88f066f41bd..eb41441c7fd0 100644 --- a/arch/microblaze/kernel/intc.c +++ b/arch/microblaze/kernel/intc.c | |||
@@ -134,7 +134,7 @@ void __init init_IRQ(void) | |||
134 | intr_type = | 134 | intr_type = |
135 | be32_to_cpup(of_get_property(intc, | 135 | be32_to_cpup(of_get_property(intc, |
136 | "xlnx,kind-of-intr", NULL)); | 136 | "xlnx,kind-of-intr", NULL)); |
137 | if (intr_type >= (1 << (nr_irq + 1))) | 137 | if (intr_type > (u32)((1ULL << nr_irq) - 1)) |
138 | printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n"); | 138 | printk(KERN_INFO " ERROR: Mismatch in kind-of-intr param\n"); |
139 | 139 | ||
140 | #ifdef CONFIG_SELFMOD_INTC | 140 | #ifdef CONFIG_SELFMOD_INTC |
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index 968648a81c1e..dbb812421d8a 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c | |||
@@ -237,7 +237,6 @@ unsigned long get_wchan(struct task_struct *p) | |||
237 | /* Set up a thread for executing a new program */ | 237 | /* Set up a thread for executing a new program */ |
238 | void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp) | 238 | void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp) |
239 | { | 239 | { |
240 | set_fs(USER_DS); | ||
241 | regs->pc = pc; | 240 | regs->pc = pc; |
242 | regs->r1 = usp; | 241 | regs->r1 = usp; |
243 | regs->pt_mode = 0; | 242 | regs->pt_mode = 0; |
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c index b15cc219b1d9..977484add216 100644 --- a/arch/microblaze/kernel/prom.c +++ b/arch/microblaze/kernel/prom.c | |||
@@ -53,69 +53,58 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | #ifdef CONFIG_EARLY_PRINTK | 55 | #ifdef CONFIG_EARLY_PRINTK |
56 | /* MS this is Microblaze specifig function */ | 56 | char *stdout; |
57 | static int __init early_init_dt_scan_serial(unsigned long node, | ||
58 | const char *uname, int depth, void *data) | ||
59 | { | ||
60 | unsigned long l; | ||
61 | char *p; | ||
62 | const __be32 *addr; | ||
63 | |||
64 | pr_debug("search \"serial\", depth: %d, uname: %s\n", depth, uname); | ||
65 | |||
66 | /* find all serial nodes */ | ||
67 | if (strncmp(uname, "serial", 6) != 0) | ||
68 | return 0; | ||
69 | |||
70 | /* find compatible node with uartlite */ | ||
71 | p = of_get_flat_dt_prop(node, "compatible", &l); | ||
72 | if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) && | ||
73 | (strncmp(p, "xlnx,opb-uartlite", 17) != 0) && | ||
74 | (strncmp(p, "xlnx,axi-uartlite", 17) != 0)) | ||
75 | return 0; | ||
76 | |||
77 | addr = of_get_flat_dt_prop(node, "reg", &l); | ||
78 | return be32_to_cpup(addr); /* return address */ | ||
79 | } | ||
80 | 57 | ||
81 | /* this function is looking for early uartlite console - Microblaze specific */ | 58 | int __init early_init_dt_scan_chosen_serial(unsigned long node, |
82 | int __init early_uartlite_console(void) | ||
83 | { | ||
84 | return of_scan_flat_dt(early_init_dt_scan_serial, NULL); | ||
85 | } | ||
86 | |||
87 | /* MS this is Microblaze specifig function */ | ||
88 | static int __init early_init_dt_scan_serial_full(unsigned long node, | ||
89 | const char *uname, int depth, void *data) | 59 | const char *uname, int depth, void *data) |
90 | { | 60 | { |
91 | unsigned long l; | 61 | unsigned long l; |
92 | char *p; | 62 | char *p; |
93 | unsigned int addr; | ||
94 | |||
95 | pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); | ||
96 | |||
97 | /* find all serial nodes */ | ||
98 | if (strncmp(uname, "serial", 6) != 0) | ||
99 | return 0; | ||
100 | 63 | ||
101 | early_init_dt_check_for_initrd(node); | 64 | pr_debug("%s: depth: %d, uname: %s\n", __func__, depth, uname); |
102 | 65 | ||
103 | /* find compatible node with uartlite */ | 66 | if (depth == 1 && (strcmp(uname, "chosen") == 0 || |
104 | p = of_get_flat_dt_prop(node, "compatible", &l); | 67 | strcmp(uname, "chosen@0") == 0)) { |
105 | 68 | p = of_get_flat_dt_prop(node, "linux,stdout-path", &l); | |
106 | if ((strncmp(p, "xlnx,xps-uart16550", 18) != 0) && | 69 | if (p != NULL && l > 0) |
107 | (strncmp(p, "xlnx,axi-uart16550", 18) != 0)) | 70 | stdout = p; /* store pointer to stdout-path */ |
108 | return 0; | 71 | } |
109 | 72 | ||
110 | addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l); | 73 | if (stdout && strstr(stdout, uname)) { |
111 | addr += *(u32 *)of_get_flat_dt_prop(node, "reg-offset", &l); | 74 | p = of_get_flat_dt_prop(node, "compatible", &l); |
112 | return be32_to_cpu(addr); /* return address */ | 75 | pr_debug("Compatible string: %s\n", p); |
76 | |||
77 | if ((strncmp(p, "xlnx,xps-uart16550", 18) == 0) || | ||
78 | (strncmp(p, "xlnx,axi-uart16550", 18) == 0)) { | ||
79 | unsigned int addr; | ||
80 | |||
81 | *(u32 *)data = UART16550; | ||
82 | |||
83 | addr = *(u32 *)of_get_flat_dt_prop(node, "reg", &l); | ||
84 | addr += *(u32 *)of_get_flat_dt_prop(node, | ||
85 | "reg-offset", &l); | ||
86 | /* clear register offset */ | ||
87 | return be32_to_cpu(addr) & ~3; | ||
88 | } | ||
89 | if ((strncmp(p, "xlnx,xps-uartlite", 17) == 0) || | ||
90 | (strncmp(p, "xlnx,opb-uartlite", 17) == 0) || | ||
91 | (strncmp(p, "xlnx,axi-uartlite", 17) == 0) || | ||
92 | (strncmp(p, "xlnx,mdm", 8) == 0)) { | ||
93 | unsigned int *addrp; | ||
94 | |||
95 | *(u32 *)data = UARTLITE; | ||
96 | |||
97 | addrp = of_get_flat_dt_prop(node, "reg", &l); | ||
98 | return be32_to_cpup(addrp); /* return address */ | ||
99 | } | ||
100 | } | ||
101 | return 0; | ||
113 | } | 102 | } |
114 | 103 | ||
115 | /* this function is looking for early uartlite console - Microblaze specific */ | 104 | /* this function is looking for early console - Microblaze specific */ |
116 | int __init early_uart16550_console(void) | 105 | int __init of_early_console(void *version) |
117 | { | 106 | { |
118 | return of_scan_flat_dt(early_init_dt_scan_serial_full, NULL); | 107 | return of_scan_flat_dt(early_init_dt_scan_chosen_serial, version); |
119 | } | 108 | } |
120 | #endif | 109 | #endif |
121 | 110 | ||
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index 8e2c09b7ff26..0e654a12d37e 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c | |||
@@ -59,6 +59,11 @@ void __init setup_arch(char **cmdline_p) | |||
59 | 59 | ||
60 | setup_memory(); | 60 | setup_memory(); |
61 | 61 | ||
62 | #ifdef CONFIG_EARLY_PRINTK | ||
63 | /* remap early console to virtual address */ | ||
64 | remap_early_printk(); | ||
65 | #endif | ||
66 | |||
62 | xilinx_pci_init(); | 67 | xilinx_pci_init(); |
63 | 68 | ||
64 | #if defined(CONFIG_SELFMOD_INTC) || defined(CONFIG_SELFMOD_TIMER) | 69 | #if defined(CONFIG_SELFMOD_INTC) || defined(CONFIG_SELFMOD_TIMER) |