Skip to content

Commit

Permalink
edit post buildroot devicetree boot args
Browse files Browse the repository at this point in the history
  • Loading branch information
ntn888 committed Dec 22, 2023
1 parent ff81ab0 commit 257ccfc
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions content/blog/buildroot-devicetree.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,15 @@ This will (in our case) only compile the dtb file and re-install some modules. T
make
```

>There is one caveat I noticed with build root. You now need to set `CONFIG_DEFAULT_FDT_FILE` in uboot menuconfig to use this custom dtb. But unfortunately buildroot does not honour this setting (atleast for our board) and in boot time, uboot proceeds to fetch the default dtb! The work-around is to manually set the boot arguments at boot time in the uboot prompt.
>There is a caveat I noticed with uboot. You now need to set `CONFIG_DEFAULT_FDT_FILE` in uboot menuconfig to use this custom dtb. But unfortunately our board include files do not honour this setting, and in boot time, uboot proceeds to fetch the default dtb! The work-around is to set the right dtb file on uboot prompt explained below.
Flash the sdcard and boot.

At uboot prompt provide these commands to boot Linux using our custom dtb.

```
setenv bootargs "root=/dev/mmcblk1p1 rootfstype=ext4"
ext4load mmc 0:1 ${kernel_addr_r} boot/Image
ext4load mmc 0:1 ${fdt_addr_r} boot/sun50i-h616-orangepi-zero3-custom.dtb
booti ${kernel_addr_r} - ${fdt_addr_r}
setenv fdtfile sun50i-h616-orangepi-zero3-custom.dtb
boot
```

This is the workaround that worked for me and in the boot log you can see the custom model that we set: `OrangePi Zero3-custom`. You may also cat the following file:
Expand All @@ -77,3 +74,14 @@ This is the workaround that worked for me and in the boot log you can see the cu
cat /sys/firmware/devicetree/base/model
```


If you get any further issues you can also try to manually boot as follows:

```
setenv bootargs "root=/dev/mmcblk1p1 rootfstype=ext4"
ext4load mmc 0:1 ${kernel_addr_r} boot/Image
ext4load mmc 0:1 ${fdt_addr_r} boot/sun50i-h616-orangepi-zero3-custom.dtb
booti ${kernel_addr_r} - ${fdt_addr_r}
```

0 comments on commit 257ccfc

Please sign in to comment.