aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/kernel/setup.c')
-rw-r--r--arch/xtensa/kernel/setup.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index f38badeb7747..7d12af1317f1 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -212,6 +212,42 @@ static int __init parse_bootparam(const bp_tag_t* tag)
212#ifdef CONFIG_OF 212#ifdef CONFIG_OF
213bool __initdata dt_memory_scan = false; 213bool __initdata dt_memory_scan = false;
214 214
215#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
216unsigned long xtensa_kio_paddr = XCHAL_KIO_DEFAULT_PADDR;
217EXPORT_SYMBOL(xtensa_kio_paddr);
218
219static int __init xtensa_dt_io_area(unsigned long node, const char *uname,
220 int depth, void *data)
221{
222 const __be32 *ranges;
223 unsigned long len;
224
225 if (depth > 1)
226 return 0;
227
228 if (!of_flat_dt_is_compatible(node, "simple-bus"))
229 return 0;
230
231 ranges = of_get_flat_dt_prop(node, "ranges", &len);
232 if (!ranges)
233 return 1;
234 if (len == 0)
235 return 1;
236
237 xtensa_kio_paddr = of_read_ulong(ranges+1, 1);
238 /* round down to nearest 256MB boundary */
239 xtensa_kio_paddr &= 0xf0000000;
240
241 return 1;
242}
243#else
244static int __init xtensa_dt_io_area(unsigned long node, const char *uname,
245 int depth, void *data)
246{
247 return 1;
248}
249#endif
250
215void __init early_init_dt_add_memory_arch(u64 base, u64 size) 251void __init early_init_dt_add_memory_arch(u64 base, u64 size)
216{ 252{
217 if (!dt_memory_scan) 253 if (!dt_memory_scan)
@@ -232,6 +268,7 @@ void __init early_init_devtree(void *params)
232 dt_memory_scan = true; 268 dt_memory_scan = true;
233 269
234 early_init_dt_scan(params); 270 early_init_dt_scan(params);
271 of_scan_flat_dt(xtensa_dt_io_area, NULL);
235 272
236 if (!command_line[0]) 273 if (!command_line[0])
237 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); 274 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);