From 3b747549b8085a6fe075ea53d1afe30c7d4a89d7 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Tue, 12 Sep 2023 16:09:01 -0500 Subject: [PATCH] u-boot: we need to load uboot-env.txt Signed-off-by: Robert Nelson --- 01_git_sync.sh | 11 +++++++ 04_build_linux.sh | 6 ++++ deploy/genimage.cfg | 1 + patches/linux/beaglev_fire.its | 56 ++++++++++++++++++++++++++++++++++ patches/u-boot/uboot-env.txt | 17 +++++++++++ 5 files changed, 91 insertions(+) create mode 100644 patches/linux/beaglev_fire.its create mode 100644 patches/u-boot/uboot-env.txt diff --git a/01_git_sync.sh b/01_git_sync.sh index c66d5d4..05a415a 100755 --- a/01_git_sync.sh +++ b/01_git_sync.sh @@ -51,4 +51,15 @@ fi echo "git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}" git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH} + +#BUILDROOT_BRANCH="bvf" +#BUILDROOT_REPO="https://git.beagleboard.org/beaglev-fire/buildroot-external-microchip.git" +# +#if [ -d ./buildroot ] ; then + #rm -rf ./buildroot || true +#fi # +#echo "git clone -b ${BUILDROOT_BRANCH} ${BUILDROOT_REPO} ./buildroot/ --depth=${GIT_DEPTH}" +#git clone -b ${BUILDROOT_BRANCH} ${BUILDROOT_REPO} ./buildroot/ --depth=${GIT_DEPTH} + +# \ No newline at end of file diff --git a/04_build_linux.sh b/04_build_linux.sh index d3c60e1..bebf9d0 100755 --- a/04_build_linux.sh +++ b/04_build_linux.sh @@ -272,4 +272,10 @@ cp -v ./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dtb ../deploy/input/ cd ../ +cp -v ./patches/linux/beaglev_fire.its ./deploy/input/ +cd ./deploy/input/ +gzip -9 Image -c > Image.gz +if [ -f ../../u-boot/tools/mkimage ] ; then + ../../u-boot/tools/mkimage -f beaglev_fire.its beaglev_fire.itb +fi # diff --git a/deploy/genimage.cfg b/deploy/genimage.cfg index 093e13c..3998e29 100644 --- a/deploy/genimage.cfg +++ b/deploy/genimage.cfg @@ -3,6 +3,7 @@ image boot.vfat { vfat { files = { + "beaglev_fire.itb", "mpfs-beaglev-fire.dtb", "Image" } diff --git a/patches/linux/beaglev_fire.its b/patches/linux/beaglev_fire.its new file mode 100644 index 0000000..b1591c5 --- /dev/null +++ b/patches/linux/beaglev_fire.its @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Flattened Image Tree file for BVF + * + * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries. + * Author: Conor Dooley + * + */ + +/dts-v1/; + +/ { + description = "U-Boot fitImage for the BeagleV-Fire"; + #address-cells = <2>; + + images { + kernel { + description = "Linux kernel"; + data = /incbin/("./Image.gz"); + type = "kernel"; + arch = "riscv"; + os = "linux"; + compression = "gzip"; + load = <0x80200000>; + entry = <0x80200000>; + hash-1 { + algo = "sha256"; + }; + }; + base_fdt { + description = "Flattened Device Tree blob"; + data = /incbin/("./mpfs-beaglev-fire.dtb"); + type = "flat_dt"; + arch = "riscv"; + compression = "none"; + load = <0x8a000000>; + hash-1 { + algo = "sha256"; + }; + }; + }; + + configurations { + default = "kernel_dtb"; + kernel_dtb { + description = "1 Linux kernel, FDT blob"; + kernel = "kernel"; + fdt = "base_fdt"; + }; + + base_dtb { + description = "Base FDT blob for BeagleV-Fire board"; + fdt = "base_fdt"; + }; + }; +}; diff --git a/patches/u-boot/uboot-env.txt b/patches/u-boot/uboot-env.txt new file mode 100644 index 0000000..06147b3 --- /dev/null +++ b/patches/u-boot/uboot-env.txt @@ -0,0 +1,17 @@ +# this assumes ${scriptaddr} is already set!! + +# Try to boot a fitImage from eMMC/SD + +setenv fdt_high 0xffffffffffffffff +setenv initrd_high 0xffffffffffffffff + +load mmc 0:${distro_bootpart} ${scriptaddr} beaglev_fire.itb; +bootm start ${scriptaddr}#kernel_dtb; +bootm loados ${scriptaddr}; +# Try to load a ramdisk if available inside fitImage +bootm ramdisk; +bootm prep; +fdt set /soc/ethernet@20112000 mac-address ${icicle_mac_addr0}; +fdt set /soc/ethernet@20110000 mac-address ${icicle_mac_addr1}; +run design_overlays; +bootm go;