[PATCH] spl: Add support for Device Firmware Upgrade (DFU) over PCIe
Tom Rini
trini at konsulko.com
Thu Jun 12 19:13:37 CEST 2025
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
> + help
> + This config enables support to download bootloaders over PCIe
> + when device is acting as an PCI endpoint.
Correct the spacing.
> +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.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250612/75512ba7/attachment.sig>
More information about the U-Boot
mailing list