mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
ddr: fsl: Fix checking for maximal mappable memory
Check needs to be done against CONFIG_MAX_MEM_MAPPED macro and not fixed size 4GB (as CONFIG_MAX_MEM_MAPPED can be lower and for example for e500 cores it is just 2GB). Also fix printf re-align, which should be applied only for non-SPL builds, during init_dram() call. Signed-off-by: Pali Rohár <pali@kernel.org>
This commit is contained in:
parent
d92aee57ec
commit
cf4eba4eb6
1 changed files with 14 additions and 5 deletions
|
@ -857,13 +857,22 @@ phys_size_t __fsl_ddr_sdram(fsl_ddr_info_t *pinfo)
|
|||
debug("total_memory by %s = %llu\n", __func__, total_memory);
|
||||
|
||||
#if !defined(CONFIG_PHYS_64BIT)
|
||||
/* Check for 4G or more. Bad. */
|
||||
if ((first_ctrl == 0) && (total_memory >= (1ull << 32))) {
|
||||
/* Check for more than max memory. Bad. */
|
||||
if ((first_ctrl == 0) && (total_memory > CONFIG_MAX_MEM_MAPPED)) {
|
||||
puts("Detected ");
|
||||
print_size(total_memory, " of memory\n");
|
||||
printf(" This U-Boot only supports < 4G of DDR\n");
|
||||
printf(" You could rebuild it with CONFIG_PHYS_64BIT\n");
|
||||
printf(" "); /* re-align to match init_dram print */
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
puts(" "); /* re-align to match init_dram print */
|
||||
#endif
|
||||
puts("This U-Boot only supports <= ");
|
||||
print_size(CONFIG_MAX_MEM_MAPPED, " of DDR\n");
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
puts(" "); /* re-align to match init_dram print */
|
||||
#endif
|
||||
puts("You could rebuild it with CONFIG_PHYS_64BIT\n");
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
puts(" "); /* re-align to match init_dram print */
|
||||
#endif
|
||||
total_memory = CONFIG_MAX_MEM_MAPPED;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue