Skip to contentSkip to conversation

arm: mvebu: armada8k: make DRAM bank 0 above 2 GiB usable

PATCH New Imre Kaloz 1 participant 1 message Nov 12

Subsystems (3)
lore
Share & tools
lore

Imre Kaloz

author
#0 lore raw

PATCH 1/1 arm: mvebu: armada8k: make DRAM bank 0 above 2 GiB usable

LMB_LIMIT_DMA_BELOW_RAM_TOP, now enabled for mvebu, reserves DRAM above gd->ram_top, which is capped at 2 GiB. Bank 0 can reach 3 GiB, so bootm refuses kernels loaded at 0x80080000, the ONIE default on arm64.

Map bank 0 up to its end and reserve only DRAM from 4 GiB up, which stays unmapped.

Fixes f9c2898c9b35 ("lmb: enable LMB_LIMIT_DMA_BELOW_RAM_TOP for ARCH_MVEBU")
---
 arch/arm/mach-mvebu/arm64-common.c     |  2 +-
 arch/arm/mach-mvebu/armada8k/cpu.c     | 48 ++++++++++++--------------
 arch/arm/mach-mvebu/armada8k/dram.c    |  2 ++
 arch/arm/mach-mvebu/include/mach/cpu.h |  1 +
 4 files changed, 27 insertions(+), 26 deletions(-)
arch/arm/mach-mvebu/arm64-common.c +1 -1
index 63a12f7d77..81b19b0c80 100644
@@ -25,7 +25,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * Not all memory is mapped in the MMU. So we need to restrict the
  * memory size so that U-Boot does not try to access it. Also, the
  * internal registers are located at 0xf000.0000 - 0xffff.ffff.
- * Currently only 2GiB are mapped for system memory. This is what
+ * U-Boot restricts itself to the first 2GiB of system memory. This is what
  * we pass to the U-Boot subsystem here.
  */
 #define USABLE_RAM_SIZE		0x80000000ULL
arch/arm/mach-mvebu/armada8k/cpu.c +23 -25

95 lines not on this page · raw message

arch/arm/mach-mvebu/armada8k/dram.c +2 -0
index af37dfa225..f5f3895d67 100644
@@ -41,10 +41,12 @@ int a8k_dram_init_banksize(void)
 	gd->dram[0].start = CFG_SYS_SDRAM_BASE;
 	if (gd->ram_size <= max_bank0_size) {
 		gd->dram[0].size = gd->ram_size;
+		a8k_mem_map_bank0();
 		return 0;
 	}
 
 	gd->dram[0].size = max_bank0_size;
+	a8k_mem_map_bank0();
 	if (CONFIG_NR_DRAM_BANKS > 1) {
 		gd->dram[1].start = SZ_4G;
 		gd->dram[1].size = gd->ram_size - max_bank0_size;
arch/arm/mach-mvebu/include/mach/cpu.h +1 -0
index 37a0050121..3585cb2ba3 100644
@@ -188,6 +188,7 @@ static inline void mv_rtc_config(void) {}
 /* A8K dram functions */
 u64 a8k_dram_scan_ap_sz(void);
 int a8k_dram_init_banksize(void);
+void a8k_mem_map_bank0(void);
 
 /* A3700 dram functions */
 int a3700_dram_init(void);
Signature · 1 line
2.47.3