Commit 1616db09 authored by Thomas Schäfer's avatar Thomas Schäfer
Browse files

pitx-imx8m: enable 4GB support



- setup DRAM1 and DRAM2 memory region size correctly
- add functionality to populate bi_dram[].start and
  bi_dram[].size struct variables appropriately.
Signed-off-by: Thomas Schäfer's avatarThomas Schaefer <thomas.schaefer@kontron.com>
parent 6ecf6bc1
......@@ -93,13 +93,35 @@ int board_postclk_init(void)
}
#endif
int dram_init(void)
phys_size_t get_effective_memsize(void)
{
/* rom_pointer[1] contains the size of TEE occupies */
if (rom_pointer[1])
gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
return (PHYS_SDRAM_SIZE - rom_pointer[1]);
else
gd->ram_size = PHYS_SDRAM_SIZE;
return PHYS_SDRAM_SIZE;
}
int dram_init(void)
{
gd->ram_size = get_effective_memsize();
#if CONFIG_NR_DRAM_BANKS > 1
gd->ram_size += PHYS_SDRAM_2_SIZE;
#endif
return 0;
}
int dram_init_banksize(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM;
gd->bd->bi_dram[0].size = get_effective_memsize();
#if CONFIG_NR_DRAM_BANKS > 1
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
#endif
return 0;
}
......
......@@ -225,9 +225,10 @@
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN ((CONFIG_ENV_SIZE + (2*1024) + (16*1024)) * 1024)
#define CONFIG_SYS_SDRAM_BASE 0x40000000
#define PHYS_SDRAM 0x40000000
#define PHYS_SDRAM_SIZE 0xC0000000 /* 3GB DDR */
#define PHYS_SDRAM_SIZE 0xC0000000 /* 3GB DDR in DRAM1 region */
#define PHYS_SDRAM_2 0x100000000UL
#define PHYS_SDRAM_2_SIZE 0x40000000 /* 1GB DDR in DRAM2 region */
#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + (PHYS_SDRAM_SIZE >> 1))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment