diff options
| author | Tom Rini <[email protected]> | 2018-01-09 08:45:02 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2018-01-09 08:45:02 -0500 |
| commit | 8c9e6f28176f85ebf718dfd1f5073f4c0e81a2c5 (patch) | |
| tree | 772d381201ea7d9c451bc5c79eb0a7e102cc6ea9 /arch | |
| parent | f3dd87e0b98999a78e500e8c6d2b063ebadf535a (diff) | |
| parent | a322eb9ff6f4c43d378b683457bdbfc59c1c19a6 (diff) | |
Merge git://git.denx.de/u-boot-uniphier
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm/mach-uniphier/dram_init.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index e9672d2f1bc..f6781142514 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -205,6 +205,7 @@ int dram_init(void) return ret; for (i = 0; i < ARRAY_SIZE(dram_map); i++) { + unsigned long max_size; if (!dram_map[i].size) break; @@ -218,9 +219,32 @@ int dram_init(void) dram_map[i].base) break; + /* + * Do not use memory that exceeds 32bit address range. U-Boot + * relocates itself to the end of the effectively available RAM. + * This could be a problem for DMA engines that do not support + * 64bit address (SDMA of SDHCI, UniPhier AV-ether, etc.) + */ + if (dram_map[i].base >= 1ULL << 32) + break; + + max_size = (1ULL << 32) - dram_map[i].base; + + if (dram_map[i].size > max_size) { + gd->ram_size += max_size; + break; + } + gd->ram_size += dram_map[i].size; } + /* + * LD20 uses the last 64 byte for each channel for dynamic + * DDR PHY training + */ + if (uniphier_get_soc_id() == UNIPHIER_LD20_ID) + gd->ram_size -= 64; + return 0; } |
