summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2026-08-09 03:41:42 +0200
committerTom Rini <[email protected]>2026-08-20 12:15:23 -0600
commit17baf93381a410b37083abceaa50ac0967a3568e (patch)
tree0503c66e9558960966d3d4d82f0f7d1117f5c663 /include
parent3511e1e3fbfefa678de083297d8f2a70bab485d2 (diff)
arm64: renesas: r8a779g3: Switch to distro boot command on Retronix R-Car V4H Sparrow Hawk
Switch Retronix R-Car V4H Sparrow Hawk to distro boot command to obtain generic distro boot capability. The boot scripts now search each of the SD, NVMe, USB boot devices for either a fitImage with embedded script, regular boot script, or extlinux.conf, and boot the first one found. This allows for standardized boot of the device, similar to other such devices. There are slight customizations to the distro boot commands, specifically the PCIe controller is started before USB controller, because the USB controller is attached to the PCIe controller. Furthermore, USB ethernet boot is not enabled. Signed-off-by: Marek Vasut <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/configs/sparrowhawk.h70
1 files changed, 69 insertions, 1 deletions
diff --git a/include/configs/sparrowhawk.h b/include/configs/sparrowhawk.h
index e6e18bc97b0..a4309953433 100644
--- a/include/configs/sparrowhawk.h
+++ b/include/configs/sparrowhawk.h
@@ -11,6 +11,35 @@
#include "rcar-gen4-common.h"
+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 0) \
+ func(NVME, nvme, 0) \
+ func(USB, usb, 0) \
+ func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
+/*
+ * Support for USB-ethernet and PCIe-ethernet is disabled, do not
+ * initialize either and directly boot via native ethernet only.
+ */
+#undef BOOTENV_RUN_NET_USB_START
+#define BOOTENV_RUN_NET_USB_START
+#undef BOOTENV_SHARED_USB
+#define BOOTENV_SHARED_USB \
+ "usb_boot=" \
+ "run boot_pci_enum ; usb start ; " \
+ BOOTENV_SHARED_BLKDEV_BODY(usb)
+#undef BOOTENV_DEV_DHCP
+#define BOOTENV_DEV_DHCP(devtypeu, devtypel, instance) \
+ "bootcmd_dhcp=" \
+ "devtype=" #devtypel "; " \
+ "if dhcp ${scriptaddr} ${boot_script_dhcp}; then " \
+ "source ${scriptaddr}; " \
+ "fi;" \
+ BOOTENV_EFI_RUN_DHCP \
+ "\0"
+
/* Environment setting */
#undef CFG_EXTRA_ENV_SETTINGS
#define CFG_EXTRA_ENV_SETTINGS \
@@ -62,6 +91,45 @@
"update_loader_from_usb=" \
"pci enum && usb start && " \
"env set renesas_update_loader_iface usb && " \
- "run update_loader_from_blk01\0"
+ "run update_loader_from_blk01\0" \
+ \
+ BOOTENV \
+ "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+ "scan_dev_for_scripts=" \
+ "if test -e ${devtype} ${devnum}:${distro_bootpart} " \
+ "${prefix}fitImage; then " \
+ "echo Found fitImage ${prefix}fitImage ; " \
+ "if test ${devtype} = \"mmc\" ; then " \
+ "env set bootargs \"${bootargs} " \
+ "root=/dev/mmcblk0p1\" ; " \
+ "elif test ${devtype} = \"nvme\" ; then " \
+ "env set bootargs \"${bootargs} " \
+ "root=/dev/nvme0n1p1\" ; " \
+ "elif test ${devtype} = \"usb\" ; then " \
+ "env set bootargs \"${bootargs} " \
+ "root=/dev/sda1\" ; " \
+ "else " \
+ "part uuid ${devtype} " \
+ "${devnum}:${distro_bootpart} " \
+ "uuid ; " \
+ "env set bootargs \"${bootargs} " \
+ "root=PARTUUID=${uuid}\" ; " \
+ "fi ; " \
+ "env set bootargs \"${bootargs} rw rootwait\" ; " \
+ "load ${devtype} ${devnum}:${distro_bootpart} " \
+ "${scriptaddr} ${prefix}fitImage && " \
+ "source ${scriptaddr}:script ; " \
+ "echo fitImage script FAILED: continuing...; " \
+ "fi; " \
+ "for script in ${boot_scripts}; do " \
+ "if test -e ${devtype} " \
+ "${devnum}:${distro_bootpart} " \
+ "${prefix}${script}; then " \
+ "echo Found U-Boot script " \
+ "${prefix}${script}; " \
+ "run boot_a_script; " \
+ "echo SCRIPT FAILED: continuing...; " \
+ "fi; " \
+ "done\0"
#endif /* __SPARROWHAWK_H */