diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-03-31 23:11:05 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-04-01 15:29:49 -0500 |
commit | c840d26c752141b94bbc24ac748ddd45752a955a (patch) | |
tree | 2782cd8b9721c9706495e782b363f29dc01c6453 | |
parent | 7649a590b53ee548f41428bf20780f74ce9fc099 (diff) | |
download | bootable_bootloader_goldelico_gta04-c840d26c752141b94bbc24ac748ddd45752a955a.zip bootable_bootloader_goldelico_gta04-c840d26c752141b94bbc24ac748ddd45752a955a.tar.gz bootable_bootloader_goldelico_gta04-c840d26c752141b94bbc24ac748ddd45752a955a.tar.bz2 |
85xx: Introduce determine_mp_bootpg() helper.
Match determine_mp_bootpg() that was added for 86xx. We need this to
address a bug introduced in v2009.03 with 86xx MP booting. We have to
make sure to reserve the region of memory used for the MP bootpg() so
other u-boot code doesn't use it.
Also added a comment about how cpu_reset() is dealing w/an errata on
early 85xx MP HW.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | cpu/mpc85xx/fdt.c | 9 | ||||
-rw-r--r-- | cpu/mpc85xx/mp.c | 26 | ||||
-rw-r--r-- | cpu/mpc85xx/mp.h | 4 |
3 files changed, 16 insertions, 23 deletions
diff --git a/cpu/mpc85xx/fdt.c b/cpu/mpc85xx/fdt.c index 2d36c24..26a8f48 100644 --- a/cpu/mpc85xx/fdt.c +++ b/cpu/mpc85xx/fdt.c @@ -39,13 +39,8 @@ void ft_fixup_cpu(void *blob, u64 memory_limit) { int off; ulong spin_tbl_addr = get_spin_addr(); - u32 bootpg, id = get_my_id(); - - /* if we have 4G or more of memory, put the boot page at 4Gb-4k */ - if ((u64)gd->ram_size > 0xfffff000) - bootpg = 0xfffff000; - else - bootpg = gd->ram_size - 4096; + u32 bootpg = determine_mp_bootpg(); + u32 id = get_my_id(); off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); while (off != -FDT_ERR_NOTFOUND) { diff --git a/cpu/mpc85xx/mp.c b/cpu/mpc85xx/mp.c index 3338c1a..76f02a4 100644 --- a/cpu/mpc85xx/mp.c +++ b/cpu/mpc85xx/mp.c @@ -38,6 +38,7 @@ int cpu_reset(int nr) { volatile ccsr_pic_t *pic = (void *)(CONFIG_SYS_MPC85xx_PIC_ADDR); out_be32(&pic->pir, 1 << nr); + /* the dummy read works around an errata on early 85xx MP PICs */ (void)in_be32(&pic->pir); out_be32(&pic->pir, 0x0); @@ -112,6 +113,15 @@ int cpu_release(int nr, int argc, char *argv[]) return 0; } +u32 determine_mp_bootpg(void) +{ + /* if we have 4G or more of memory, put the boot page at 4Gb-4k */ + if ((u64)gd->ram_size > 0xfffff000) + return (0xfffff000); + + return (gd->ram_size - 4096); +} + ulong get_spin_addr(void) { extern ulong __secondary_start_page; @@ -188,13 +198,7 @@ static void pq3_mp_up(unsigned long bootpg) void cpu_mp_lmb_reserve(struct lmb *lmb) { - u32 bootpg; - - /* if we have 4G or more of memory, put the boot page at 4Gb-4k */ - if ((u64)gd->ram_size > 0xfffff000) - bootpg = 0xfffff000; - else - bootpg = gd->ram_size - 4096; + u32 bootpg = determine_mp_bootpg(); lmb_reserve(lmb, bootpg, 4096); } @@ -203,13 +207,7 @@ void setup_mp(void) { extern ulong __secondary_start_page; ulong fixup = (ulong)&__secondary_start_page; - u32 bootpg; - - /* if we have 4G or more of memory, put the boot page at 4Gb-4k */ - if ((u64)gd->ram_size > 0xfffff000) - bootpg = 0xfffff000; - else - bootpg = gd->ram_size - 4096; + u32 bootpg = determine_mp_bootpg(); memcpy((void *)bootpg, (void *)fixup, 4096); flush_cache(bootpg, 4096); diff --git a/cpu/mpc85xx/mp.h b/cpu/mpc85xx/mp.h index 4329286..2c2929e 100644 --- a/cpu/mpc85xx/mp.h +++ b/cpu/mpc85xx/mp.h @@ -1,10 +1,10 @@ #ifndef __MPC85XX_MP_H_ #define __MPC85XX_MP_H_ +#include <asm/mp.h> + ulong get_spin_addr(void); -void setup_mp(void); u32 get_my_id(void); -void cpu_mp_lmb_reserve(struct lmb *lmb); #define BOOT_ENTRY_ADDR_UPPER 0 #define BOOT_ENTRY_ADDR_LOWER 1 |