summaryrefslogtreecommitdiff
path: root/board/broadcom
diff options
context:
space:
mode:
authorBharat Kumar Reddy Gooty <bharat.gooty@broadcom.com>2020-07-15 22:49:05 +0530
committerTom Rini <trini@konsulko.com>2020-07-29 10:37:11 -0400
commit53a3e8d46926213fea17115dbae035901a13bc05 (patch)
tree38051be633caa89cd0110e1dab4f2002613d6170 /board/broadcom
parentc8b98482d8b320be73f9eb8b8794f09dcb5044bd (diff)
board: ns3: limit U-boot relocation within 16MB memory
By default relocation happens to a higher address of DDR, i.e, DDR start + DDR size. U-Boot shall be used to collect the ramdump. Restrict U-Boot to use only the 16MB memory, so that this memory can be reserved. Limit relocation to happen within 16MB memory, start 0xFF00_0000 and end 0x1_0000_0000 Signed-off-by: Bharat Kumar Reddy Gooty <bharat.gooty@broadcom.com> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/broadcom')
-rw-r--r--board/broadcom/bcmns3/ns3.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/board/broadcom/bcmns3/ns3.c b/board/broadcom/bcmns3/ns3.c
index dcdde408db..0357cd0e32 100644
--- a/board/broadcom/bcmns3/ns3.c
+++ b/board/broadcom/bcmns3/ns3.c
@@ -144,6 +144,11 @@ static int mem_info_parse_fixup(void *fdt)
int board_init(void)
{
+ /* Setup memory using "memory" node from DTB */
+ if (fdtdec_setup_mem_size_base() != 0)
+ return -EINVAL;
+ fdtdec_setup_memory_banksize();
+
if (bl33_info->version != BL33_INFO_VERSION)
printf("*** warning: ATF BL31 and U-Boot not in sync! ***\n");
@@ -157,19 +162,30 @@ int board_late_init(void)
int dram_init(void)
{
- if (fdtdec_setup_mem_size_base() != 0)
- return -EINVAL;
+ /*
+ * Mark ram base as the last 16MB of 2GB DDR, which is 0xFF00_0000.
+ * So that relocation happens with in the last 16MB memory.
+ */
+ gd->ram_base = (phys_size_t)(BCM_NS3_MEM_END - SZ_16M);
+ gd->ram_size = (unsigned long)SZ_16M;
return 0;
}
int dram_init_banksize(void)
{
- fdtdec_setup_memory_banksize();
+ gd->bd->bi_dram[0].start = (BCM_NS3_MEM_END - SZ_16M);
+ gd->bd->bi_dram[0].size = SZ_16M;
return 0;
}
+/* Limit RAM used by U-Boot to the DDR first bank End region */
+ulong board_get_usable_ram_top(ulong total_size)
+{
+ return BCM_NS3_MEM_END;
+}
+
void reset_cpu(ulong level)
{
u32 reset_level, strap_val;