diff mbox

[v2,1/5] rockchip: rk322x: update dram bank size

Message ID 1502954257-7256-2-git-send-email-kever.yang@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kever Yang Aug. 17, 2017, 7:17 a.m. UTC
The DRAM start address is not 0, so need to update the last bank size
as:
DRAM start addr + DRAM_SIZE - last bank start addr

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 arch/arm/mach-rockchip/rk322x-board.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c
index b6543a5..f93bd33 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -72,11 +72,13 @@  int board_init(void)
 
 int dram_init_banksize(void)
 {
-	/* Reserve 0x200000 for OPTEE */
-	gd->bd->bi_dram[0].start = 0x60000000;
+	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
 	gd->bd->bi_dram[0].size = 0x8400000;
-	gd->bd->bi_dram[1].start = 0x6a400000;
-	gd->bd->bi_dram[1].size = gd->ram_size - gd->bd->bi_dram[1].start;
+	/* Reserve 14M for OPTEE and TA */
+	gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE
+				+ gd->bd->bi_dram[0].size + 0xe00000;
+	gd->bd->bi_dram[1].size = gd->bd->bi_dram[0].start
+				+ gd->ram_size - gd->bd->bi_dram[1].start;
 
 	return 0;
 }