On Thu, Jun 02, 2022 at 02:46:09PM +0000, Hawkins, Nick wrote: > > > > Can we figure any of that out dynamically instead? Since > > CONFIG_SYS_SDRAM_SIZE is only used (for ARM) in board code, I'd rather see > > this handled in there, with SZ_xxx and not use CONFIG_SYS_SDRAM_SIZE at all. > > Hi Tom, > > Would something like this be acceptable? > > int dram_init(void) > { > #ifdef CONFIG_TARGET_GXP > #ifdef CONFIG_GXP_ECC > gd->ram_size = SZ_128M + SZ_64M + SZ_32M + SZ_16M + SZ_8M; > #else > gd->ram_size = SZ_256M + SZ_128M + SZ_64M + SZ_32M + SZ_16M; > #endif > #endif > > #ifdef CONFIG_GXP_VROM_64MB > #ifdef CONFIG_GXP_ECC > gd->ram_size = SZ_128M + SZ_64M; > #else > gd->ram_size = SZ_256M + SZ_128M; > #endif > #endif > return 0; > } > > Thanks for the feedback,
Without indenting the #ifdef's, yes, that's better. Ideally you should just call get_ram_size(base_addr, max-possible-valid-size) and that will return the correct value. -- Tom
signature.asc
Description: PGP signature