Commit 66c4095c authored by Thomas Schäfer's avatar Thomas Schäfer
Browse files

pitx-imx8m: enable support for dynamic memory variants



- add 'board_phys_sdram_size' function to calculate the total amount of
  memory appropriately.
- set PHYS_SDRAM_SIZE to the maximum possible value of 0xC0000000 (3 GiB)
- remove 'PHYS_SDRAM_2_SIZE' from board config file.
Signed-off-by: Thomas Schäfer's avatarThomas Schaefer <thomas.schaefer@kontron.com>
parent 2259fde9
......@@ -468,6 +468,18 @@ static int get_hw_rev(void)
gpio_get_value(IMX_GPIO_NR(4, 0)) << 1 ) & 0x3 );
}
int board_phys_sdram_size(phys_size_t *memsize)
{
/*
* Get real memory size by testing available memory in a
* given range starting at i.MX8M DRAM1 base address 0x40000000.
*/
*memsize = get_ram_size((long *)0x40000000, 0x100000000ULL);
debug("Memsize: %d MiB\n", (int)(*memsize >> 20));
return 0;
}
int board_init(void)
{
/*
......
......@@ -216,14 +216,9 @@
#define CONFIG_SYS_MALLOC_LEN ((CONFIG_ENV_SIZE + (2*1024) + (16*1024)) * 1024)
#define PHYS_SDRAM 0x40000000
#if 1
#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 */
#else
#define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR in DRAM1 region */
#endif
#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \
......
Markdown is supported
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