1
0
Fork 0
forked from len0rd/rockbox

Add DeviceData to bootloaders

same vein as bootdata but for devices that need to pass info back to a
running firmware

Change-Id: I0cdcdc0475804dfbbee415ab487104ae8fc8ac69
This commit is contained in:
William Wilgus 2024-08-25 11:37:30 -04:00 committed by William Wilgus
parent c16dbbfd1f
commit a2cc7546d8
11 changed files with 274 additions and 1 deletions

View file

@ -30,6 +30,9 @@
#include "multiboot.h"
#endif
#ifdef HAVE_DEVICEDATA
#include "devicedata.h"
#endif
/* loads a firmware file from supplied filename
* file opened, checks firmware size and checksum
* if no error, firmware loaded to supplied buffer
@ -118,7 +121,6 @@ int load_firmware(unsigned char* buf, const char* firmware, int buffer_size)
/* if ret is valid breaks from loop to continue loading */
}
#endif
if (ret < 0) /* Check default volume, no valid firmware file loaded yet */
{
/* First check in BOOTDIR */
@ -141,5 +143,9 @@ int load_firmware(unsigned char* buf, const char* firmware, int buffer_size)
else /* full path passed ROLO etc.*/
ret = load_firmware_filename(buf, firmware, buffer_size);
#ifdef HAVE_DEVICEDATA
write_devicedata(buf, ret);
#endif
return ret;
}