2 #include <asm/processor.h>
9 DECLARE_GLOBAL_DATA_PTR;
11 #if (CONFIG_NUM_CPUS > 1)
12 void cpu_mp_lmb_reserve(struct lmb *lmb)
16 /* if we have 4G or more of memory, put the boot page at 4Gb-1M */
17 if ((u64)gd->ram_size > 0xfffff000)
20 bootpg = gd->ram_size - (1024 * 1024);
22 /* tell u-boot we stole a page */
23 lmb_reserve(lmb, bootpg, 4096);
27 * Copy the code for other cpus to execute into an
28 * aligned location accessible via BPTR
32 extern ulong __secondary_start_page;
33 ulong fixup = (ulong)&__secondary_start_page;
38 * If we have 4G or more of memory, put the boot page at 4Gb-1M.
39 * Otherwise, put it at the very end of RAM.
41 if (gd->ram_size > 0xfffff000)
44 bootpg = gd->ram_size - (1024 * 1024);
46 if (bootpg >= CONFIG_SYS_MAX_DDR_BAT_SIZE) {
47 /* We're not covered by the DDR mapping, set up BAT */
48 write_bat(DBAT7, CONFIG_SYS_SCRATCH_VA | BATU_BL_128K |
50 bootpg | BATL_PP_RW | BATL_MEMCOHERENCE);
51 bootpg_va = CONFIG_SYS_SCRATCH_VA;
56 memcpy((void *)bootpg_va, (void *)fixup, 4096);
57 flush_cache(bootpg_va, 4096);
59 /* remove the temporary BAT mapping */
60 if (bootpg >= CONFIG_SYS_MAX_DDR_BAT_SIZE)
61 write_bat(DBAT7, 0, 0);
63 /* If the physical location of bootpg is not at fff00000, set BPTR */
64 if (bootpg != 0xfff00000)
65 out_be32((uint *)(CONFIG_SYS_CCSRBAR + 0x20), 0x80000000 |