[PATCH 2/3] arm64: renesas: r8a779g3: Add bootloader update environment on Retronix R-Car V4H Sparrow Hawk

Marek Vasut via U-Boot <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>
Add bootloader update environment to Retronix R-Car V4H Sparrow Hawk.
The "update_loader_from_{mmc,nvme,usb}" script updates U-Boot "flash.bin"
in SPI NOR at offset 0x0 from SD card, NVMe SSD and USB mass storage
device respectively. Each script sets up parameters for the generic
update script "update_loader_from_blk", which can be used to update
the "flash.bin" from any block device. The parameters are these:
- renesas_update_loader_iface ....... Update block device (mmc, nvme, usb, ...)
- renesas_update_loader_dev ......... Update block device number (0, 1, ...)
- renesas_update_loader_part ........ Update block device partition (1, 2, ...)
- renesas_update_loader_filename .... Update file name (flash.bin)
- renesas_update_loader_sf_offset ... SPI NOR target offset (0x0)

Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
---
 include/configs/sparrowhawk.h | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/include/configs/sparrowhawk.h b/include/configs/sparrowhawk.h
index 731455c9d8e..e6e18bc97b0 100644
--- a/include/configs/sparrowhawk.h
+++ b/include/configs/sparrowhawk.h
@@ -31,6 +31,37 @@
 		"sf probe && "						\
 		"sf update ${loadaddr} "				\
 			"${renesas_rcar_gen4_pcie_firmware_sf_offset} "	\
-			"${filesize}\0"
+			"${filesize}\0" \
+	\
+	"renesas_update_loader_iface=mmc\0"				\
+	"renesas_update_loader_dev=0\0"					\
+	"renesas_update_loader_part=1\0"				\
+	"renesas_update_loader_sf_offset=0x0\0"				\
+	"renesas_update_loader_filename=flash.bin\0"			\
+	"update_loader_from_blk="					\
+		"load ${renesas_update_loader_iface} "			\
+			"${renesas_update_loader_dev}:${renesas_update_loader_part} "  \
+			"${loadaddr} "					\
+			"${renesas_update_loader_filename} && "		\
+		"sf probe && "						\
+		"sf update ${loadaddr} "				\
+			"${renesas_update_loader_sf_offset} "		\
+			"${filesize} && "				\
+		"reset\0"						\
+	"update_loader_from_blk01="					\
+		"env set renesas_update_loader_dev 0 && "		\
+		"env set renesas_update_loader_part 1 && "		\
+		"run update_loader_from_blk\0"				\
+	"update_loader_from_mmc="					\
+		"env set renesas_update_loader_iface mmc && "		\
+		"run update_loader_from_blk01\0"			\
+	"update_loader_from_nvme="					\
+		"pci enum && nvme scan && "				\
+		"env set renesas_update_loader_iface nvme && "		\
+		"run update_loader_from_blk01\0"			\
+	"update_loader_from_usb="					\
+		"pci enum && usb start && "				\
+		"env set renesas_update_loader_iface usb && "		\
+		"run update_loader_from_blk01\0"
 
 #endif /* __SPARROWHAWK_H */
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.