On 12/06/25 22:43, Tom Rini wrote:
On Thu, Jun 12, 2025 at 02:19:10PM +0530, Hrushikesh Salunke wrote:
Introduce support for Device Firmware Upgrade (DFU) over PCIe in
U-Boot. Traditionally, the DFU protocol is used over USB, where a
device enters DFU mode and allows a host to upload firmware or binary
images directly via the USB interface. This is a widely adopted and
convenient method for updating firmware.
Interesting, glad to see this overall.
@@ -1328,6 +1336,59 @@ config SPL_RAM_DEVICE
be already in memory when SPL takes over, e.g. loaded by the boot
ROM.
+config SPL_PCI_DFU
+ bool "PCIe boot support"
Needs to depend on SPL_PCI_ENDPOINT
Yes, I will update this is V2.
+ help
+ This config enables support to download bootloaders over PCIe
+ when device is acting as an PCI endpoint.
Correct the spacing.
I missed this. Will take care of it in V2.
+config PCI_DFU_SPL_LOAD_FIT_ADDRESS
+ hex "Address to load FIT image when booting via DFU over PCIe"
+ default 0x00
No default, and then for the rest of these options put it under if
SPL_PCI_DFU ... endif please.
+config PCI_DFU_VENDOR_ID
+ hex "PCI Vendor ID for PCI endpoint"
+ default 0xffff
+ help
+ PCI Vendor ID for endpoint device for DFU over PCIe. This should
+ be set to your assigned 16-bit PCI Vendor ID.
+
+config PCI_DFU_DEVICE_ID
+ hex "PCI Vendor ID for PCI endpoint"
+ default 0xffff
+ help
+ A 16-bit PCI Vendor ID for endpoint device for DFU over PCIe.
No defaults here.
+config PCI_DFU_BOOT_PHASE
+ string "Current boot phase for PCI DFU boot"
+ default "none"
Nor here.
diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 71b7a8374bb..5bb94d6b972 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -27,6 +27,9 @@ static ulong spl_ram_load_read(struct spl_load_info *load,
ulong sector,
if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
addr = IF_ENABLED_INT(CONFIG_SPL_LOAD_FIT,
CONFIG_SPL_LOAD_FIT_ADDRESS);
+
+ if (spl_boot_device() == BOOT_DEVICE_PCIE)
+ addr = CONFIG_PCI_DFU_SPL_LOAD_FIT_ADDRESS;
Probably need an IS_ENABLED(..) here first? And possibly a few other
places too.
Thanks for the feedback. I will update the patch based on
comments and post the V2.
Regards,
Hrushikesh.