工具/软件:
您好:
我最近遇到了 am6442 上的内核启动的一个奇怪问题。 我正在使用 Yocto 为 AM6442 构建映像;该构建将 phytec-Linux fork 用于内核源。
我的问题是内核似乎没有消耗正确的设备树 blob。 我不能肯定这其实是根本原因、但我会概述这个问题、也许有人更倾向于做什么。
我正在使用的主设备树源是 /arch/arm64/boot/dts/ti/k3-am642-phyboard-electra-rdk.dts. 我通过 Yocto 中的补丁、对此器件树进行了几次编辑、以满足我的特定需求。 内核编辑是两个额外的保留存储器区域:
From 7058d3dc228615c43bd81bf9f737ada18a93a75b Mon Sep 17 00:00:00 2001
From: jweyer <jweyer@aecontrols.com>
Date: Thu, 12 Jun 2025 13:58:18 -0700
Subject: [PATCH] apc reserved buff
---
.../boot/dts/ti/k3-am64-phycore-som.dtsi | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-am64-phycore-som.dtsi b/arch/arm64/boot/dts/ti/k3-am64-phycore-som.dtsi
index e8d1b88651e7..0e1447b382ee 100644
--- a/arch/arm64/boot/dts/ti/k3-am64-phycore-som.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am64-phycore-som.dtsi
@@ -105,8 +105,37 @@ rtos_ipc_memory_region: ipc-memories@a5000000 {
alignment = <0x1000>;
no-map;
};
+
+ /*
+ * apc reserved memory
+ * desc: contigous buffer for apc buffers.
+ * region: 0xa58000000 - 0xb5800000
+ * size: 100 MiB
+ */
+ apc_memory_region: apc-memory@a5800000 {
+ reg = <0x00 0xa5800000 0x00 0x10000000>;
+ alignment = <0x1000>;
+ no-map;
+ };
+
+ /*
+ * jailhouse reserved memory
+ * desc: memory hypervisor and inmate
+ * region: 0xdfa00000 - 0xeae00000
+ * size: 180 MiB
+ */
+ jailhouse_mem: jailhouse@dfa00000 {
+ reg = <0x0 0xdfa00000 0x0 0x00b400000>;
+ alignment = <0x1000>;
+ no-map;
+ };
};
+ apc {
+ compatible = "apc-memory";
+ memory-region = <&apc_memory_region>;
+ };
+
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
--
2.25.1
这一切都可以正常工作;我已通过对 Yocto 映像部署目录中的设备树 blob 进行解压缩来验证我的补丁是否已应用到设备树。 然后、我在 AM6442 上安装映像、并且未预留存储器。 我通过`dmesg`检查了是否有任何错误、但似乎没有任何创建区域的尝试。 我最初认为 U-boot 和/或内核正在使用错误的设备树 blob;但是、我进行了检查 /boot/ 一切似乎都正确:
root@aec-am6442:boot# ls EFI Image 'System Volume Information' k3-am642-phyboard-electra-gpio-fan.dtbo k3-am642-phyboard-electra-pcie-usb2.dtbo k3-am642-phyboard-electra-rdk.dtb k3-am642-phyboard-electra-x27-gpio1-spi1-uart3.dtbo oftree tiboot3.bin tispl.bin u-boot.img
我解析 oftree 和 k3-am642-phyboard-Electra-RDK.dtb、它们都有我保留的内存节点。 我还在引导期间停止了 U-boot 并确定了这一点 fdtfile=oftree 。 启动后、我进行检查 /proc/device-tree/reserved-memory 并且我的保留内存节点未显示:
root@aec-am6442:reserved-memory# ls '#address-cells' phandle r5f-memory@a1100000 '#size-cells' r5f-dma-memory@a0000000 r5f-memory@a2100000 m4f-dma-memory@a4000000 r5f-dma-memory@a1000000 r5f-memory@a3100000 m4f-memory@a4100000 r5f-dma-memory@a2000000 ranges name r5f-dma-memory@a3000000 optee@9e800000 r5f-memory@a0100000
仔细检查我使用的这些结果 `dtc -i fs`创建 DTS 文件并检查此文件、已验证保留的存储器节点是否不存在。 我还检查了 /proc/device-tree/compatible 看起来正常:
phytec,am642-phyboard-electra-rdkphytec,am64-phycore-somti,am642
因此、似乎内核和 u-boot 使用了正确的器件树;但我的内存节点并不存在。 内存保留是否可能以静默方式失败? 以下是我的相关`dmesg` output:
[ 0.000000] OF: reserved mem: 0x000000009e800000..0x000000009fffffff (24576 KiB) nomap non-reusable optee@9e800000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a0000000..0x00000000a00fffff (1024 KiB) nomap non-reusable r5f-dma-memory@a0000000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB [ 0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a0100000..0x00000000a0ffffff (15360 KiB) nomap non-reusable r5f-memory@a0100000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a1000000..0x00000000a10fffff (1024 KiB) nomap non-reusable r5f-dma-memory@a1000000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB [ 0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a1100000..0x00000000a1ffffff (15360 KiB) nomap non-reusable r5f-memory@a1100000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a2000000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a2000000..0x00000000a20fffff (1024 KiB) nomap non-reusable r5f-dma-memory@a2000000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 15 MiB [ 0.000000] OF: reserved mem: initialized node r5f-memory@a2100000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a2100000..0x00000000a2ffffff (15360 KiB) nomap non-reusable r5f-memory@a2100000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a3000000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@a3000000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a3000000..0x00000000a30fffff (1024 KiB) nomap non-reusable r5f-dma-memory@a3000000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a3100000, size 15 MiB [ 0.000000] OF: reserved mem: initialized node r5f-memory@a3100000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a3100000..0x00000000a3ffffff (15360 KiB) nomap non-reusable r5f-memory@a3100000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a4000000, size 1 MiB [ 0.000000] OF: reserved mem: initialized node m4f-dma-memory@a4000000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a4000000..0x00000000a40fffff (1024 KiB) nomap non-reusable m4f-dma-memory@a4000000 [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a4100000, size 15 MiB [ 0.000000] OF: reserved mem: initialized node m4f-memory@a4100000, compatible id shared-dma-pool [ 0.000000] OF: reserved mem: 0x00000000a4100000..0x00000000a4ffffff (15360 KiB) nomap non-reusable m4f-memory@a4100000
我以前有内存保留失败了,通常`dmesg`表示此失败,所以似乎内核甚至没有尝试。 我以前使用过这个精确的过程、一切都按预期运行。
对我在这里可能出错的地方有什么想法吗? 此外、任何关于如何进一步调试此问题的想法都将非常感谢!
感谢您的帮助、
- Jared