From 9df731a176aab8e03b984b681b1bea01ccff6644 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 06 Nov 2023 07:23:06 +0000
Subject: [PATCH] rk3568 rt uboot init

---
 u-boot/cmd/ddr_tool/ddr_tool_common.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/u-boot/cmd/memtester/ddr_tester_common.c b/u-boot/cmd/ddr_tool/ddr_tool_common.c
similarity index 92%
rename from u-boot/cmd/memtester/ddr_tester_common.c
rename to u-boot/cmd/ddr_tool/ddr_tool_common.c
index 713d1a9..e2faf6a 100644
--- a/u-boot/cmd/memtester/ddr_tester_common.c
+++ b/u-boot/cmd/ddr_tool/ddr_tool_common.c
@@ -5,7 +5,7 @@
 
 #include <common.h>
 #include <power/regulator.h>
-#include "ddr_tester_common.h"
+#include "ddr_tool_common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -84,6 +84,13 @@
 	for (i = 0; i < max_bank; i++) {
 		start_adr[i] = gd->bd->bi_dram[i].start;
 		length[i] = gd->bd->bi_dram[i].size;
+#if defined(CONFIG_ROCKCHIP_RV1126)
+		/* On RV1126, writing data to 0x00600000 will cause a crash. */
+		if (start_adr[i] == 0 && length[i] > 0x00700000) {
+			start_adr[i] = 0x00700000;
+			length[i] -= 0x00700000;
+		}
+#endif
 	}
 
 	length[max_bank - 1] = (gd->start_addr_sp - RESERVED_SP_SIZE -

--
Gitblit v1.6.2