diff options
author | Dave Kleikamp <shaggy@linux.vnet.ibm.com> | 2011-07-04 14:38:17 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2011-07-12 09:34:41 -0400 |
commit | e817513b1b3399f7fe0b1d77046a71b845114378 (patch) | |
tree | 0d3caae6a7435c5ee7445cbd8f3cea070d65ae3b /arch/powerpc/boot | |
parent | 91b191c71eae79c0e652c52a968d06cd96b539c5 (diff) |
powerpc/44x: boot wrapper: allow kernel to load into non-zero address
For AMP, different kernel instances load into separate memory regions.
Read the start of memory from the device tree and limit the memory to what's
specified in the device tree.
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r-- | arch/powerpc/boot/treeboot-iss4xx.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/boot/treeboot-iss4xx.c b/arch/powerpc/boot/treeboot-iss4xx.c index fcc44952874e..329e710feda2 100644 --- a/arch/powerpc/boot/treeboot-iss4xx.c +++ b/arch/powerpc/boot/treeboot-iss4xx.c | |||
@@ -34,9 +34,29 @@ | |||
34 | 34 | ||
35 | BSS_STACK(4096); | 35 | BSS_STACK(4096); |
36 | 36 | ||
37 | static u32 ibm4xx_memstart; | ||
38 | |||
37 | static void iss_4xx_fixups(void) | 39 | static void iss_4xx_fixups(void) |
38 | { | 40 | { |
39 | ibm4xx_sdram_fixup_memsize(); | 41 | void *memory; |
42 | u32 reg[3]; | ||
43 | |||
44 | memory = finddevice("/memory"); | ||
45 | if (!memory) | ||
46 | fatal("Can't find memory node\n"); | ||
47 | /* This assumes #address-cells = 2, #size-cells =1 and that */ | ||
48 | getprop(memory, "reg", reg, sizeof(reg)); | ||
49 | if (reg[2]) | ||
50 | /* If the device tree specifies the memory range, use it */ | ||
51 | ibm4xx_memstart = reg[1]; | ||
52 | else | ||
53 | /* othersize, read it from the SDRAM controller */ | ||
54 | ibm4xx_sdram_fixup_memsize(); | ||
55 | } | ||
56 | |||
57 | static void *iss_4xx_vmlinux_alloc(unsigned long size) | ||
58 | { | ||
59 | return (void *)ibm4xx_memstart; | ||
40 | } | 60 | } |
41 | 61 | ||
42 | #define SPRN_PIR 0x11E /* Processor Indentification Register */ | 62 | #define SPRN_PIR 0x11E /* Processor Indentification Register */ |
@@ -48,6 +68,7 @@ void platform_init(void) | |||
48 | 68 | ||
49 | simple_alloc_init(_end, avail_ram, 128, 64); | 69 | simple_alloc_init(_end, avail_ram, 128, 64); |
50 | platform_ops.fixups = iss_4xx_fixups; | 70 | platform_ops.fixups = iss_4xx_fixups; |
71 | platform_ops.vmlinux_alloc = iss_4xx_vmlinux_alloc; | ||
51 | platform_ops.exit = ibm44x_dbcr_reset; | 72 | platform_ops.exit = ibm44x_dbcr_reset; |
52 | pir_reg = mfspr(SPRN_PIR); | 73 | pir_reg = mfspr(SPRN_PIR); |
53 | fdt_set_boot_cpuid_phys(_dtb_start, pir_reg); | 74 | fdt_set_boot_cpuid_phys(_dtb_start, pir_reg); |