aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 02:52:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 02:52:17 -0500
commit10d0c9705e80bbd3d587c5fad24599aabaca6688 (patch)
tree9456083a1b04b8d98da08d88e937cfeff80e2a7d /arch/xtensa/kernel
parent85b656cf1560e27a89354a23f2c10ba229d2f173 (diff)
parentc11eede69b6ad0ac44ebc1e021a8d2699c5f1f8f (diff)
Merge tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree updates from Rob Herring: "DeviceTree updates for 3.13. This is a bit larger pull request than usual for this cycle with lots of clean-up. - Cross arch clean-up and consolidation of early DT scanning code. - Clean-up and removal of arch prom.h headers. Makes arch specific prom.h optional on all but Sparc. - Addition of interrupts-extended property for devices connected to multiple interrupt controllers. - Refactoring of DT interrupt parsing code in preparation for deferred probe of interrupts. - ARM cpu and cpu topology bindings documentation. - Various DT vendor binding documentation updates" * tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (82 commits) powerpc: add missing explicit OF includes for ppc dt/irq: add empty of_irq_count for !OF_IRQ dt: disable self-tests for !OF_IRQ of: irq: Fix interrupt-map entry matching MIPS: Netlogic: replace early_init_devtree() call of: Add Panasonic Corporation vendor prefix of: Add Chunghwa Picture Tubes Ltd. vendor prefix of: Add AU Optronics Corporation vendor prefix of/irq: Fix potential buffer overflow of/irq: Fix bug in interrupt parsing refactor. of: set dma_mask to point to coherent_dma_mask of: add vendor prefix for PHYTEC Messtechnik GmbH DT: sort vendor-prefixes.txt of: Add vendor prefix for Cadence of: Add empty for_each_available_child_of_node() macro definition arm/versatile: Fix versatile irq specifications. of/irq: create interrupts-extended property microblaze/pci: Drop PowerPC-ism from irq parsing of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code. of/irq: Use irq_of_parse_and_map() ...
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r--arch/xtensa/kernel/setup.c55
1 files changed, 14 insertions, 41 deletions
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 946fb8d06c8b..6e2b6638122d 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -21,11 +21,8 @@
21#include <linux/screen_info.h> 21#include <linux/screen_info.h>
22#include <linux/bootmem.h> 22#include <linux/bootmem.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24
25#ifdef CONFIG_OF
26#include <linux/of_fdt.h> 24#include <linux/of_fdt.h>
27#include <linux/of_platform.h> 25#include <linux/of_platform.h>
28#endif
29 26
30#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) 27#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
31# include <linux/console.h> 28# include <linux/console.h>
@@ -64,8 +61,8 @@ extern struct rtc_ops no_rtc_ops;
64struct rtc_ops *rtc_ops; 61struct rtc_ops *rtc_ops;
65 62
66#ifdef CONFIG_BLK_DEV_INITRD 63#ifdef CONFIG_BLK_DEV_INITRD
67extern void *initrd_start; 64extern unsigned long initrd_start;
68extern void *initrd_end; 65extern unsigned long initrd_end;
69int initrd_is_mapped = 0; 66int initrd_is_mapped = 0;
70extern int initrd_below_start_ok; 67extern int initrd_below_start_ok;
71#endif 68#endif
@@ -152,8 +149,8 @@ static int __init parse_tag_initrd(const bp_tag_t* tag)
152{ 149{
153 meminfo_t* mi; 150 meminfo_t* mi;
154 mi = (meminfo_t*)(tag->data); 151 mi = (meminfo_t*)(tag->data);
155 initrd_start = __va(mi->start); 152 initrd_start = (unsigned long)__va(mi->start);
156 initrd_end = __va(mi->end); 153 initrd_end = (unsigned long)__va(mi->end);
157 154
158 return 0; 155 return 0;
159} 156}
@@ -170,13 +167,6 @@ static int __init parse_tag_fdt(const bp_tag_t *tag)
170 167
171__tagtable(BP_TAG_FDT, parse_tag_fdt); 168__tagtable(BP_TAG_FDT, parse_tag_fdt);
172 169
173void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
174{
175 initrd_start = (void *)__va(start);
176 initrd_end = (void *)__va(end);
177 initrd_below_start_ok = 1;
178}
179
180#endif /* CONFIG_OF */ 170#endif /* CONFIG_OF */
181 171
182#endif /* CONFIG_BLK_DEV_INITRD */ 172#endif /* CONFIG_BLK_DEV_INITRD */
@@ -222,9 +212,13 @@ static int __init parse_bootparam(const bp_tag_t* tag)
222} 212}
223 213
224#ifdef CONFIG_OF 214#ifdef CONFIG_OF
215bool __initdata dt_memory_scan = false;
225 216
226void __init early_init_dt_add_memory_arch(u64 base, u64 size) 217void __init early_init_dt_add_memory_arch(u64 base, u64 size)
227{ 218{
219 if (!dt_memory_scan)
220 return;
221
228 size &= PAGE_MASK; 222 size &= PAGE_MASK;
229 add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size); 223 add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size);
230} 224}
@@ -236,31 +230,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
236 230
237void __init early_init_devtree(void *params) 231void __init early_init_devtree(void *params)
238{ 232{
239 /* Setup flat device-tree pointer */
240 initial_boot_params = params;
241
242 /* Retrieve various informations from the /chosen node of the
243 * device-tree, including the platform type, initrd location and
244 * size, TCE reserve, and more ...
245 */
246 if (!command_line[0])
247 of_scan_flat_dt(early_init_dt_scan_chosen, command_line);
248
249 /* Scan memory nodes and rebuild MEMBLOCKs */
250 of_scan_flat_dt(early_init_dt_scan_root, NULL);
251 if (sysmem.nr_banks == 0) 233 if (sysmem.nr_banks == 0)
252 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 234 dt_memory_scan = true;
253}
254 235
255static void __init copy_devtree(void) 236 early_init_dt_scan(params);
256{ 237
257 void *alloc = early_init_dt_alloc_memory_arch( 238 if (!command_line[0])
258 be32_to_cpu(initial_boot_params->totalsize), 8); 239 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
259 if (alloc) {
260 memcpy(alloc, initial_boot_params,
261 be32_to_cpu(initial_boot_params->totalsize));
262 initial_boot_params = alloc;
263 }
264} 240}
265 241
266static int __init xtensa_device_probe(void) 242static int __init xtensa_device_probe(void)
@@ -525,10 +501,7 @@ void __init setup_arch(char **cmdline_p)
525 501
526 bootmem_init(); 502 bootmem_init();
527 503
528#ifdef CONFIG_OF 504 unflatten_and_copy_device_tree();
529 copy_devtree();
530 unflatten_device_tree();
531#endif
532 505
533 platform_setup(cmdline_p); 506 platform_setup(cmdline_p);
534 507