diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index fbfbf6cbbc6..8f7c1901587 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -255,6 +255,21 @@ static struct mm_region bcm2837_mem_map[] = { struct mm_region *mem_map = bcm2837_mem_map; #endif +static uint32_t boot_r0 __attribute__ ((section(".data"))); +static uint32_t boot_r1 __attribute__ ((section(".data"))); +static uint32_t boot_r2 __attribute__ ((section(".data"))); +static uint32_t boot_r3 __attribute__ ((section(".data"))); + +void save_boot_params_ret(void); +void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) +{ + boot_r0 = r0; + boot_r1 = r1; + boot_r2 = r2; + boot_r3 = r3; + save_boot_params_ret(); +} + int dram_init(void) { ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_arm_mem, msg, 1); @@ -274,6 +289,13 @@ int dram_init(void) return 0; } +ulong board_get_usable_ram_top(ulong total_size) +{ + if ((gd->ram_top - boot_r2) > SZ_64M) + return gd->ram_top; + return boot_r2 & 0xffff0000; +} + static void set_fdtfile(void) { const char *fdtfile; @@ -441,6 +463,7 @@ static void get_board_rev(void) } printf("RPI %s (0x%x)\n", model->name, revision); + printf("boot regs: 0x%08x 0x%08x 0x%08x 0x%08x\n", boot_r0, boot_r1, boot_r2, boot_r3); } int board_init(void)