This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] SK-AM62:如何将 DDR 更改为1G

Guru**** 2331900 points
Other Parts Discussed in Thread: SYSCONFIG
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1247172/sk-am62-how-to-change-ddr-to-1g

器件型号:SK-AM62
主题中讨论的其他器件:SysConfig
 默认的2G 配置如下。 如何将其更改为适合我的板
 内存@8000000
    device_type ="存储器"
    /* 2G RAM */
    REG =<0x00000000 0x80000000 0x00000000 0x80000000>

  };

此外、我在 uboot 下进行了以下更改。 由于 SPL 大小限制非常严格、我编译的 tiboot3.bin tispl.bin 引导文件存在问题并且无法启动、因此我必须单独替换 u-boot.img 才能生效。

因此、我想尝试其他方法来修改 DDR、

From f9ce7cebc203ff33dde6328e547ba5164f48d3c0 Mon Sep 17 00:00:00 2001
From: "sunny.guo" <sunny.guo@myirtech.com>
Date: Fri, 28 Apr 2023 14:57:12 +0800
Subject: [PATCH] FEAT: auto-size DDR

---
 arch/arm/dts/k3-am62x-r5-sk-common.dtsi |  1 +
 arch/arm/dts/k3-am62x-sk-common.dtsi    |  1 +
 lib/fdtdec.c                            | 18 ++++++++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/arch/arm/dts/k3-am62x-r5-sk-common.dtsi b/arch/arm/dts/k3-am62x-r5-sk-common.dtsi
index b4a5e3cfa1..fb56a2601e 100644
--- a/arch/arm/dts/k3-am62x-r5-sk-common.dtsi
+++ b/arch/arm/dts/k3-am62x-r5-sk-common.dtsi
@@ -21,6 +21,7 @@
 		device_type = "memory";
 		/* 2G RAM */
 		reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
+		auto-size;
 
 		u-boot,dm-spl;
 	};
diff --git a/arch/arm/dts/k3-am62x-sk-common.dtsi b/arch/arm/dts/k3-am62x-sk-common.dtsi
index 72ebb1400f..77106b6cdb 100644
--- a/arch/arm/dts/k3-am62x-sk-common.dtsi
+++ b/arch/arm/dts/k3-am62x-sk-common.dtsi
@@ -33,6 +33,7 @@
 		device_type = "memory";
 		/* 2G RAM */
 		reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
+		auto-size;	
 
 	};
 
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 0ab7105fef..ce567730ea 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1097,8 +1097,10 @@ int fdtdec_setup_memory_banksize(void)
 {
 	int bank, ret, reg = 0;
 	struct resource res;
+	bool autosize = false;
 	ofnode mem = ofnode_null();
 
+
 	mem = get_next_memory_node(mem);
 	if (!ofnode_valid(mem)) {
 		debug("%s: Missing /memory node\n", __func__);
@@ -1124,6 +1126,22 @@ int fdtdec_setup_memory_banksize(void)
 		gd->bd->bi_dram[bank].start = (phys_addr_t)res.start;
 		gd->bd->bi_dram[bank].size =
 			(phys_size_t)(res.end - res.start + 1);
+		autosize = ofnode_read_bool(mem, "auto-size");
+		if(autosize){
+			u64 new_size;
+			u64 start = gd->bd->bi_dram[bank].start;
+			u64 size = gd->bd->bi_dram[bank].size;
+
+//			debug("Auto-sizing %llx, size %llx: ", start, size);
+			new_size = get_ram_size((long *)(uintptr_t)start, size);
+			if (new_size == size) {
+				debug("OK\n");
+			} else {
+//				debug("sized to %llx\n", new_size);
+				size = new_size;
+				gd->bd->bi_dram[bank].size = size;
+			}
+		}
 
 		debug("%s: DRAM Bank #%d: start = 0x%llx, size = 0x%llx\n",
 		      __func__, bank,
From 6583669a3cbc3c98e76733b3238fbad2548dd7cc Mon Sep 17 00:00:00 2001
From: "sunny.guo" <sunny.guo@myirtech.com>
Date: Thu, 13 Apr 2023 09:22:23 +0800
Subject: [PATCH] FIX: increase SPL SIZE LIMIT

---
 configs/am62x_evm_r5_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/am62x_evm_r5_defconfig b/configs/am62x_evm_r5_defconfig
index 18a619cdc1..6265b7755c 100644
--- a/configs/am62x_evm_r5_defconfig
+++ b/configs/am62x_evm_r5_defconfig
@@ -18,7 +18,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL_STACK_R_ADDR=0x82000000
-CONFIG_SPL_SIZE_LIMIT=0x3A7F0
+CONFIG_SPL_SIZE_LIMIT=0x3B7F0
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
 CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x3500

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我正在使用 SDK8.6

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我尝试了以下更改无效
      内存@8000000
        device_type ="存储器"
        /* 2G RAM */
        REG =<0x00000000 0x40000000 0x00000000 0x40000000>

      };
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Toby、器件树中的变化应该是:

    REG =<0x00000000  0x80000000 0x00000000   0x40000000>

    它描述了起始地址(0x80000000)和长度(0x40000000)。  SysConfig 中的更改正确。  确保您从 SysConfig 中构建新文件。  查看 SysConfig 中的自述文件以获取说明。

    您不需要进行其他更改。

    此致、

    詹姆斯