0
votes

I have my custom image for beaglebone created with linux-yocto-tiny. In order to make my cape work, i've created a custom .dts file. Everything compiles successfully, .dtb is created and placed inside boot directory. However, upon boot linux is trying to load am335x-boneblack.dtb. I am certain that my custom device-tree is working, because when i re-name it to am335x*** everything is working as intended.

Now, i've made few patches that i thought will make linux load my device tree: 1) In my machine configuration file my-yocto.conf i have the following lines (pasting relevant, in my opinion lines):

KERNEL_DEVICETREE = "my-cape.dtb"
IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO zImage my-cape.dtb"
UBOOT_MACHINE = "am335x_evm_defconfig"

2) I've patched 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) Made patches in u-boot:

Here i wasn't sure what to place in CONFIG_OF_LIST, a name of machine or device-tree, so i placed both:

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

Changes in 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

and

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=" \

Did i miss something? I can load my dtb with a uEnv file (which i did, and it's working). But i would like my device-tree to be loaded without it. Upon loading the system i see this:

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

How do i make u-boot to look for my-cape.dtb instead of am335x-boneblack.dtb ?

EDIT

I found this when doing printenv:

findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi

Why is it still looking for am335x-bone.dtb ? I think something is overwriting my patches.

1

1 Answers

0
votes

Well, this depends on the uboot configuration. From what I can tell, the latest uboot recipe in the meta-beagleboard layer (specifially this patch) configures the default boot command to load am335x-boneblack.dtb.

Most uboot configs allow you to specify your own boot command in your uEnv.txt (maybe just try to set the fdtfile variable there fdtfile=mydevicetree.dtb). Otherwise you could provide your own uboot configuration or patch the existing one to load your dtb file.