【发布时间】:2020-04-01 16:28:40
【问题描述】:
我有使用 linux-yocto-tiny 创建的 beaglebone 自定义图像。为了使我的斗篷工作,我创建了一个自定义 .dts 文件。一切编译成功,.dtb 被创建并放置在引导目录中。但是,在启动时,linux 会尝试加载 am335x-boneblack.dtb。我确信我的自定义设备树正在工作,因为当我将其重命名为 am335x*** 时,一切都按预期工作。
现在,我做了一些我认为可以让 linux 加载我的设备树的补丁: 1)在我的机器配置文件 my-yocto.conf 我有以下几行(粘贴相关,在我看来行):
KERNEL_DEVICETREE = "my-cape.dtb"
IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO zImage my-cape.dtb"
UBOOT_MACHINE = "am335x_evm_defconfig"
2) 我已经修补了 makefile:
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index dab2914fa..6f9892643 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -730,6 +730,7 @@ dtb-$(CONFIG_SOC_AM33XX) += \
am335x-base0033.dtb \
am335x-bone.dtb \
am335x-boneblack.dtb \
+ my-cape.dtb \
am335x-boneblack-wireless.dtb \
am335x-boneblue.dtb \
am335x-bonegreen.dtb \
3) 在u-boot中做了补丁:
这里我不确定在 CONFIG_OF_LIST 中放置什么,机器或设备树的名称,所以我把两者都放了:
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 3457c1fc34..cc260ccedf 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -32,7 +32,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),1
# CONFIG_SPL_EFI_PARTITION is not set
CONFIG_OF_CONTROL=y
CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
-CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle"
+CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle my-cape my-yocto"
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_SPL_ENV_IS_NOWHERE=y
CONFIG_BOOTCOUNT_LIMIT=y
--
2.17.1
am335x_evm.h 的变化:
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index c2b2d8dc..e0c1a160 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -139,7 +139,7 @@
"if test $board_name = A335BONE; then " \
"setenv fdtfile my-cape.dtb; fi; " \
"if test $board_name = A335BNLT; then " \
- "setenv fdtfile am335x-boneblack.dtb; fi; " \
+ "setenv fdtfile my-cape.dtb; fi; " \
"if test $board_name = A335PBGL; then " \
"setenv fdtfile am335x-pocketbeagle.dtb; fi; " \
"if test $board_name = BBBW; then " \
--
2.17.1
和
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index b5fba0a8b0..c2b2d8dc90 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -103,7 +103,7 @@
"bootpart=0:2\0" \
"bootdir=/boot\0" \
"bootfile=zImage\0" \
- "fdtfile=undefined\0" \
+ "fdtfile=my-cape.dtb\0" \
"console=ttyO0,115200n8\0" \
"partitions=" \
我错过了什么吗?我可以用 uEnv 文件加载我的 dtb(我这样做了,而且它正在工作)。但我希望在没有它的情况下加载我的设备树。加载系统后,我看到:
witch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
** Unrecognized filesystem type **
** Unrecognized filesystem type **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
119 bytes read in 5 ms (22.5 KiB/s)
1: Yocto
Retrieving file: /zImage
8905216 bytes read in 574 ms (14.8 MiB/s)
append: root=PARTUUID=0b6a9c67-02 rootwait console=ttyS0,115200
Retrieving file: /am335x-boneblack.dtb
Skipping Yocto for failure retrieving fdt
如何让 u-boot 寻找 my-cape.dtb 而不是 am335x-boneblack.dtb?
编辑
我在做 printenv 时发现了这个:
findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi
为什么它还在寻找 am335x-bone.dtb ?我认为有些东西正在覆盖我的补丁。
【问题讨论】:
标签: embedded-linux yocto beagleboneblack