]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: sandbox: initialise the ram banksize in spl
authorSughosh Ganu <sughosh.ganu@linaro.org>
Mon, 26 Aug 2024 11:59:34 +0000 (17:29 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 3 Sep 2024 20:08:50 +0000 (14:08 -0600)
Initialise the ram bank information for sandbox in SPL. The ram bank
information gets initialised as part of the SPL initialisation
sequence in board_init_r(), which is then used for adding available
memory to the LMB memory map.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/spl.c

index cc46965b73b06226320fe39e17448307c859ddc4..1c33a520c6492e1438badcb5f7611205029d0234 100644 (file)
@@ -127,6 +127,15 @@ static int load_from_image(struct spl_image_info *spl_image,
 }
 SPL_LOAD_IMAGE_METHOD("sandbox_image", 7, BOOT_DEVICE_BOARD, load_from_image);
 
+int dram_init_banksize(void)
+{
+       /* These are necessary so TFTP can use LMBs to check its load address */
+       gd->bd->bi_dram[0].start = gd->ram_base;
+       gd->bd->bi_dram[0].size = get_effective_memsize();
+
+       return 0;
+}
+
 void spl_board_init(void)
 {
        struct sandbox_state *state = state_get_current();
@@ -134,10 +143,6 @@ void spl_board_init(void)
        if (!CONFIG_IS_ENABLED(UNIT_TEST))
                return;
 
-       /* These are necessary so TFTP can use LMBs to check its load address */
-       gd->bd->bi_dram[0].start = gd->ram_base;
-       gd->bd->bi_dram[0].size = get_effective_memsize();
-
        if (state->run_unittests) {
                struct unit_test *tests = UNIT_TEST_ALL_START();
                const int count = UNIT_TEST_ALL_COUNT();