]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
u-boot: revert rpi boards to distro_bootcmd
authorArne Fitzenreiter <arne_f@ipfire.org>
Fri, 3 Jan 2025 23:44:06 +0000 (23:44 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 3 Jan 2025 23:44:06 +0000 (23:44 +0000)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/u-boot
src/patches/u-boot/u-boot-2024.10-revert_rpi_distro_bootcmd_removal.patch [new file with mode: 0644]

index de95719cbf06688d43b1827fb793615f4a53269b..d686917b2d922b5b083fd51d1485d67d8cdc7a00 100644 (file)
@@ -83,10 +83,16 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
 
+       # distrobootcmd support was removed for raspberry pi boards. Revert.
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/u-boot/u-boot-2024.10-revert_rpi_distro_bootcmd_removal.patch
+
        # Raspberry Pi 3
        -mkdir -pv /usr/share/u-boot/rpi
        cd $(DIR_APP) && make CROSS_COMPILE="" rpi_3_config
        cd $(DIR_APP) && sed -i -e 's!^CONFIG_IDENT_STRING=.*!CONFIG_IDENT_STRING=" RPi3 - IPFire.org"!' .config
+       cd $(DIR_APP) && sed -i -e 's!^.*CONFIG_DISTRO_DEFAULTS.*!CONFIG_DISTRO_DEFAULTS=y!' .config
+       cd $(DIR_APP) && sed -i -e 's!^CONFIG_BOOTCOMMAND=.*!CONFIG_BOOTCOMMAND="run distro_bootcmd"!' .config
+
        cd $(DIR_APP) && make CROSS_COMPILE="" HOSTCC="gcc $(CFLAGS)"
        cd $(DIR_APP) && install -v -m 644 u-boot.bin \
                /usr/share/u-boot/rpi/u-boot-rpi3.bin
@@ -98,6 +104,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        -mkdir -pv /usr/share/u-boot/rpi
        cd $(DIR_APP) && make CROSS_COMPILE="" rpi_4_config
        cd $(DIR_APP) && sed -i -e 's!^CONFIG_IDENT_STRING=.*!CONFIG_IDENT_STRING=" RPi4 - IPFire.org"!' .config
+       cd $(DIR_APP) && sed -i -e 's!^.*CONFIG_DISTRO_DEFAULTS.*!CONFIG_DISTRO_DEFAULTS=y!' .config
+       cd $(DIR_APP) && sed -i -e 's!^CONFIG_BOOTCOMMAND=.*!CONFIG_BOOTCOMMAND="run distro_bootcmd"!' .config
        cd $(DIR_APP) && make CROSS_COMPILE="" HOSTCC="gcc $(CFLAGS)"
        cd $(DIR_APP) && install -v -m 644 u-boot.bin \
                /usr/share/u-boot/rpi/u-boot-rpi4.bin
diff --git a/src/patches/u-boot/u-boot-2024.10-revert_rpi_distro_bootcmd_removal.patch b/src/patches/u-boot/u-boot-2024.10-revert_rpi_distro_bootcmd_removal.patch
new file mode 100644 (file)
index 0000000..5a60285
--- /dev/null
@@ -0,0 +1,89 @@
+diff -Naur u-boot-2024.10.org/include/configs/rpi.h u-boot-2024.10/include/configs/rpi.h
+--- u-boot-2024.10.org/include/configs/rpi.h   2024-10-07 14:54:35.000000000 +0000
++++ u-boot-2024.10/include/configs/rpi.h       2025-01-03 14:15:12.450978450 +0000
+@@ -31,4 +31,85 @@
+  */
+ #define CFG_SYS_SDRAM_SIZE            SZ_128M
++/* DFU over USB/UDC */
++#ifdef CONFIG_CMD_DFU
++#ifdef CONFIG_ARM64
++#define KERNEL_FILENAME               "Image"
++#else
++#define KERNEL_FILENAME               "zImage"
++#endif
++
++#define ENV_DFU_SETTINGS \
++      "dfu_alt_info=u-boot.bin fat 0 1;uboot.env fat 0 1;" \
++                    "config.txt fat 0 1;" \
++                    KERNEL_FILENAME " fat 0 1\0"
++#else
++#define ENV_DFU_SETTINGS ""
++#endif
++
++/* Environment */
++#define ENV_DEVICE_SETTINGS \
++      "stdin=serial,usbkbd\0" \
++      "stdout=serial,vidconsole\0" \
++      "stderr=serial,vidconsole\0"
++
++#ifdef CONFIG_ARM64
++#define FDT_HIGH "ffffffffffffffff"
++#define INITRD_HIGH "ffffffffffffffff"
++#else
++#define FDT_HIGH "ffffffff"
++#define INITRD_HIGH "ffffffff"
++#endif
++
++#define ENV_MEM_LAYOUT_SETTINGS \
++      "fdt_high=" FDT_HIGH "\0" \
++      "initrd_high=" INITRD_HIGH "\0" \
++      "kernel_addr_r=0x00080000\0" \
++      "scriptaddr=0x02400000\0" \
++      "pxefile_addr_r=0x02500000\0" \
++      "fdt_addr_r=0x02600000\0" \
++      "ramdisk_addr_r=0x02700000\0"
++
++#if CONFIG_IS_ENABLED(CMD_MMC)
++      #define BOOT_TARGET_MMC(func) \
++              func(MMC, mmc, 0) \
++              func(MMC, mmc, 1) \
++              func(MMC, mmc, 2)
++#else
++      #define BOOT_TARGET_MMC(func)
++#endif
++
++#if CONFIG_IS_ENABLED(CMD_USB)
++      #define BOOT_TARGET_USB(func) func(USB, usb, 0)
++#else
++      #define BOOT_TARGET_USB(func)
++#endif
++
++#if CONFIG_IS_ENABLED(CMD_PXE)
++      #define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
++#else
++      #define BOOT_TARGET_PXE(func)
++#endif
++
++#if CONFIG_IS_ENABLED(CMD_DHCP)
++      #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
++#else
++      #define BOOT_TARGET_DHCP(func)
++#endif
++
++#define BOOT_TARGET_DEVICES(func) \
++      BOOT_TARGET_MMC(func) \
++      BOOT_TARGET_USB(func) \
++      BOOT_TARGET_PXE(func) \
++      BOOT_TARGET_DHCP(func)
++
++#include <config_distro_bootcmd.h>
++
++#define CFG_EXTRA_ENV_SETTINGS \
++      "dhcpuboot=usb start; dhcp u-boot.uimg; bootm\0" \
++      ENV_DEVICE_SETTINGS \
++      ENV_DFU_SETTINGS \
++      ENV_MEM_LAYOUT_SETTINGS \
++      BOOTENV
++
+ #endif