aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r--arch/xtensa/kernel/setup.c46
-rw-r--r--arch/xtensa/kernel/smp.c15
-rw-r--r--arch/xtensa/kernel/xtensa_ksyms.c7
3 files changed, 33 insertions, 35 deletions
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 84fe931bb60e..9757bb74e532 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -50,6 +50,7 @@
50#include <asm/param.h> 50#include <asm/param.h>
51#include <asm/traps.h> 51#include <asm/traps.h>
52#include <asm/smp.h> 52#include <asm/smp.h>
53#include <asm/sysmem.h>
53 54
54#include <platform/hardware.h> 55#include <platform/hardware.h>
55 56
@@ -88,12 +89,6 @@ static char __initdata command_line[COMMAND_LINE_SIZE];
88static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; 89static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
89#endif 90#endif
90 91
91sysmem_info_t __initdata sysmem;
92
93extern int mem_reserve(unsigned long, unsigned long, int);
94extern void bootmem_init(void);
95extern void zones_init(void);
96
97/* 92/*
98 * Boot parameter parsing. 93 * Boot parameter parsing.
99 * 94 *
@@ -113,31 +108,14 @@ typedef struct tagtable {
113 108
114/* parse current tag */ 109/* parse current tag */
115 110
116static int __init add_sysmem_bank(unsigned long type, unsigned long start,
117 unsigned long end)
118{
119 if (sysmem.nr_banks >= SYSMEM_BANKS_MAX) {
120 printk(KERN_WARNING
121 "Ignoring memory bank 0x%08lx size %ldKB\n",
122 start, end - start);
123 return -EINVAL;
124 }
125 sysmem.bank[sysmem.nr_banks].type = type;
126 sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(start);
127 sysmem.bank[sysmem.nr_banks].end = end & PAGE_MASK;
128 sysmem.nr_banks++;
129
130 return 0;
131}
132
133static int __init parse_tag_mem(const bp_tag_t *tag) 111static int __init parse_tag_mem(const bp_tag_t *tag)
134{ 112{
135 meminfo_t *mi = (meminfo_t *)(tag->data); 113 struct bp_meminfo *mi = (struct bp_meminfo *)(tag->data);
136 114
137 if (mi->type != MEMORY_TYPE_CONVENTIONAL) 115 if (mi->type != MEMORY_TYPE_CONVENTIONAL)
138 return -1; 116 return -1;
139 117
140 return add_sysmem_bank(mi->type, mi->start, mi->end); 118 return add_sysmem_bank(mi->start, mi->end);
141} 119}
142 120
143__tagtable(BP_TAG_MEMORY, parse_tag_mem); 121__tagtable(BP_TAG_MEMORY, parse_tag_mem);
@@ -146,8 +124,8 @@ __tagtable(BP_TAG_MEMORY, parse_tag_mem);
146 124
147static int __init parse_tag_initrd(const bp_tag_t* tag) 125static int __init parse_tag_initrd(const bp_tag_t* tag)
148{ 126{
149 meminfo_t* mi; 127 struct bp_meminfo *mi = (struct bp_meminfo *)(tag->data);
150 mi = (meminfo_t*)(tag->data); 128
151 initrd_start = (unsigned long)__va(mi->start); 129 initrd_start = (unsigned long)__va(mi->start);
152 initrd_end = (unsigned long)__va(mi->end); 130 initrd_end = (unsigned long)__va(mi->end);
153 131
@@ -255,7 +233,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
255 return; 233 return;
256 234
257 size &= PAGE_MASK; 235 size &= PAGE_MASK;
258 add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size); 236 add_sysmem_bank(base, base + size);
259} 237}
260 238
261void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 239void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
@@ -292,8 +270,6 @@ device_initcall(xtensa_device_probe);
292 270
293void __init init_arch(bp_tag_t *bp_start) 271void __init init_arch(bp_tag_t *bp_start)
294{ 272{
295 sysmem.nr_banks = 0;
296
297 /* Parse boot parameters */ 273 /* Parse boot parameters */
298 274
299 if (bp_start) 275 if (bp_start)
@@ -304,10 +280,9 @@ void __init init_arch(bp_tag_t *bp_start)
304#endif 280#endif
305 281
306 if (sysmem.nr_banks == 0) { 282 if (sysmem.nr_banks == 0) {
307 sysmem.nr_banks = 1; 283 add_sysmem_bank(PLATFORM_DEFAULT_MEM_START,
308 sysmem.bank[0].start = PLATFORM_DEFAULT_MEM_START; 284 PLATFORM_DEFAULT_MEM_START +
309 sysmem.bank[0].end = PLATFORM_DEFAULT_MEM_START 285 PLATFORM_DEFAULT_MEM_SIZE);
310 + PLATFORM_DEFAULT_MEM_SIZE;
311 } 286 }
312 287
313#ifdef CONFIG_CMDLINE_BOOL 288#ifdef CONFIG_CMDLINE_BOOL
@@ -487,7 +462,7 @@ void __init setup_arch(char **cmdline_p)
487#ifdef CONFIG_BLK_DEV_INITRD 462#ifdef CONFIG_BLK_DEV_INITRD
488 if (initrd_start < initrd_end) { 463 if (initrd_start < initrd_end) {
489 initrd_is_mapped = mem_reserve(__pa(initrd_start), 464 initrd_is_mapped = mem_reserve(__pa(initrd_start),
490 __pa(initrd_end), 0); 465 __pa(initrd_end), 0) == 0;
491 initrd_below_start_ok = 1; 466 initrd_below_start_ok = 1;
492 } else { 467 } else {
493 initrd_start = 0; 468 initrd_start = 0;
@@ -532,6 +507,7 @@ void __init setup_arch(char **cmdline_p)
532 __pa(&_Level6InterruptVector_text_end), 0); 507 __pa(&_Level6InterruptVector_text_end), 0);
533#endif 508#endif
534 509
510 parse_early_param();
535 bootmem_init(); 511 bootmem_init();
536 512
537 unflatten_and_copy_device_tree(); 513 unflatten_and_copy_device_tree();
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
index aa8bd8717927..40b5a3771fb0 100644
--- a/arch/xtensa/kernel/smp.c
+++ b/arch/xtensa/kernel/smp.c
@@ -496,6 +496,21 @@ void flush_tlb_range(struct vm_area_struct *vma,
496 on_each_cpu(ipi_flush_tlb_range, &fd, 1); 496 on_each_cpu(ipi_flush_tlb_range, &fd, 1);
497} 497}
498 498
499static void ipi_flush_tlb_kernel_range(void *arg)
500{
501 struct flush_data *fd = arg;
502 local_flush_tlb_kernel_range(fd->addr1, fd->addr2);
503}
504
505void flush_tlb_kernel_range(unsigned long start, unsigned long end)
506{
507 struct flush_data fd = {
508 .addr1 = start,
509 .addr2 = end,
510 };
511 on_each_cpu(ipi_flush_tlb_kernel_range, &fd, 1);
512}
513
499/* Cache flush functions */ 514/* Cache flush functions */
500 515
501static void ipi_flush_cache_all(void *arg) 516static void ipi_flush_cache_all(void *arg)
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c
index 80b33ed51f31..4d2872fd9bb5 100644
--- a/arch/xtensa/kernel/xtensa_ksyms.c
+++ b/arch/xtensa/kernel/xtensa_ksyms.c
@@ -20,6 +20,7 @@
20#include <linux/in6.h> 20#include <linux/in6.h>
21 21
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include <asm/cacheflush.h>
23#include <asm/checksum.h> 24#include <asm/checksum.h>
24#include <asm/dma.h> 25#include <asm/dma.h>
25#include <asm/io.h> 26#include <asm/io.h>
@@ -105,6 +106,7 @@ EXPORT_SYMBOL(csum_partial_copy_generic);
105 * Architecture-specific symbols 106 * Architecture-specific symbols
106 */ 107 */
107EXPORT_SYMBOL(__xtensa_copy_user); 108EXPORT_SYMBOL(__xtensa_copy_user);
109EXPORT_SYMBOL(__invalidate_icache_range);
108 110
109/* 111/*
110 * Kernel hacking ... 112 * Kernel hacking ...
@@ -127,3 +129,8 @@ EXPORT_SYMBOL(common_exception_return);
127#ifdef CONFIG_FUNCTION_TRACER 129#ifdef CONFIG_FUNCTION_TRACER
128EXPORT_SYMBOL(_mcount); 130EXPORT_SYMBOL(_mcount);
129#endif 131#endif
132
133EXPORT_SYMBOL(__invalidate_dcache_range);
134#if XCHAL_DCACHE_IS_WRITEBACK
135EXPORT_SYMBOL(__flush_dcache_range);
136#endif