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

@ -23,6 +23,10 @@
#include "mips.h"
#include "bootdata.h"
#if defined(HAVE_DEVICEDATA) && !defined(BOOTLOADER)
#include "devicedata.h"
#endif
.text
.extern main
.extern system_early_init
@ -52,6 +56,9 @@ _header:
#ifndef BOOTLOADER
/* Multiboot support header; this is not part of the above header. */
put_boot_data_here
#ifdef HAVE_DEVICEDATA
put_device_data_here
#endif
#endif
_realstart:

View file

@ -81,6 +81,20 @@ void system_early_init(void)
clk_init();
}
#if defined (HAVE_DEVICEDATA) && defined(EROS_QN)
void fill_devicedata(struct device_data_t *data)
{
#ifdef BOOTLOADER
memset(data->payload, 0xff, data->length);
data->lcd_version = EROSQN_VER;
#else
uint8_t lcd_version = data->lcd_version;
memset(data->payload, 0xff, data->length);
data->lcd_version = lcd_version;
#endif
}
#endif
/* First thing called from Rockbox main() */
void system_init(void)
{