diff options
author | Tom Rini <trini@konsulko.com> | 2020-02-04 08:16:01 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-02-04 08:16:01 -0500 |
commit | d861183dc531b74479f92bf4c8de8ad60a0a0d56 (patch) | |
tree | 487df3e41a030e9c6e84eade07b61dc0105d39b4 /arch/arm/mach-k3/sysfw-loader.c | |
parent | 31a790bee939e227dfc7e6a6a323b2b13180707f (diff) | |
parent | 4dd05933989f01bb38813f4a5f043b7dfa24e218 (diff) |
Merge tag 'ti-v2020.04-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
- DFU boot support for J721e
- I2C support for J721e
- GPIO support for J721e
- Android boot image updates on AM57XX
- OMAP watchdog fixes
Diffstat (limited to 'arch/arm/mach-k3/sysfw-loader.c')
-rw-r--r-- | arch/arm/mach-k3/sysfw-loader.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c index 5903bbe12a..94dbeb9437 100644 --- a/arch/arm/mach-k3/sysfw-loader.c +++ b/arch/arm/mach-k3/sysfw-loader.c @@ -11,6 +11,10 @@ #include <malloc.h> #include <remoteproc.h> #include <linux/soc/ti/ti_sci_protocol.h> +#include <g_dnl.h> +#include <usb.h> +#include <dfu.h> + #include <asm/arch/sys_proto.h> #include "common.h" @@ -172,6 +176,27 @@ static void k3_sysfw_configure_using_fit(void *fit, ret); } +#if CONFIG_IS_ENABLED(DFU) +static int k3_sysfw_dfu_download(void *addr) +{ + char dfu_str[50]; + int ret; + + sprintf(dfu_str, "sysfw.itb ram 0x%p 0x%x", addr, + CONFIG_K3_SYSFW_IMAGE_SIZE_MAX); + ret = dfu_config_entities(dfu_str, "ram", "0"); + if (ret) { + dfu_free_entities(); + goto exit; + } + + run_usb_dnl_gadget(0, "usb_dnl_dfu"); +exit: + dfu_free_entities(); + return ret; +} +#endif + void k3_sysfw_loader(void (*config_pm_done_callback)(void)) { struct spl_image_info spl_image = { 0 }; @@ -236,6 +261,11 @@ void k3_sysfw_loader(void (*config_pm_done_callback)(void)) ret = spl_ymodem_load_image(&spl_image, &bootdev); break; #endif +#if CONFIG_IS_ENABLED(DFU) + case BOOT_DEVICE_DFU: + ret = k3_sysfw_dfu_download(sysfw_load_address); + break; +#endif default: panic("Loading SYSFW image from device %u not supported!\n", bootdev.boot_device); |