diff mbox series

[04/13] arm: mach-k3: sysfw-loader: Add support to load SYSFW from USB

Message ID 20200702080233.27582-5-faiz_abbas@ti.com
State Accepted
Commit f5838b1542e5eeaff1ce78ae1f5671f23c07b1ed
Headers show
Series Add support for USB host and peripheral bootmodes on am65x-idk | expand

Commit Message

Faiz Abbas July 2, 2020, 8:02 a.m. UTC
Add support for loading system firmware from a USB mass storage device

Signed-off-by: Faiz Abbas <faiz_abbas at ti.com>
---
 arch/arm/mach-k3/sysfw-loader.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c
index 513be09c68..0ebd8c56a7 100644
--- a/arch/arm/mach-k3/sysfw-loader.c
+++ b/arch/arm/mach-k3/sysfw-loader.c
@@ -299,6 +299,17 @@  void k3_sysfw_loader(void (*config_pm_pre_callback) (void),
 		ret = k3_sysfw_dfu_download(sysfw_load_address);
 		break;
 #endif
+#if CONFIG_IS_ENABLED(USB_STORAGE)
+	case BOOT_DEVICE_USB:
+		ret = spl_usb_load(&spl_image, &bootdev,
+				   CONFIG_SYS_USB_FAT_BOOT_PARTITION,
+#ifdef CONFIG_K3_SYSFW_IMAGE_NAME
+				   CONFIG_K3_SYSFW_IMAGE_NAME);
+#else
+				   NULL);
+#endif
+#endif
+		break;
 	default:
 		panic("Loading SYSFW image from device %u not supported!\n",
 		      bootdev.boot_device);