mirror of https://github.com/wolfSSL/wolfBoot.git
Fixes for Cortex R5 self-update
- load `f021_lookup_bank()` into RAM - `arch_reboot()` for TMS570pull/168/head
parent
777f25e31e
commit
78ace2ee17
|
@ -77,7 +77,7 @@ void hal_prepare_boot(void)
|
|||
{
|
||||
}
|
||||
|
||||
static inline Fapi_FlashBankType f021_lookup_bank(uint32_t address) {
|
||||
static inline Fapi_FlashBankType RAMFUNCTION f021_lookup_bank(uint32_t address) {
|
||||
Fapi_FlashBankType bank = Fapi_FlashBank0;
|
||||
|
||||
if (address >= 0x200000) {
|
||||
|
|
|
@ -500,15 +500,24 @@ void (* const IV[])(void) =
|
|||
|
||||
#ifdef RAM_CODE
|
||||
|
||||
#define AIRCR *(volatile uint32_t *)(0xE000ED0C)
|
||||
#define AIRCR_VKEY (0x05FA << 16)
|
||||
#define AIRCR_SYSRESETREQ (1 << 2)
|
||||
#ifdef CORTEX_R5
|
||||
// Section 2.5.1.45 of spnu563A
|
||||
# define SYSECR *((volatile uint32_t *)0xFFFFFFE0)
|
||||
# define ECR_RESET (1 << 15)
|
||||
#else
|
||||
# define AIRCR *(volatile uint32_t *)(0xE000ED0C)
|
||||
# define AIRCR_VKEY (0x05FA << 16)
|
||||
# define AIRCR_SYSRESETREQ (1 << 2)
|
||||
#endif
|
||||
|
||||
void RAMFUNCTION arch_reboot(void)
|
||||
{
|
||||
#ifdef CORTEX_R5
|
||||
SYSECR = ECR_RESET;
|
||||
#else
|
||||
AIRCR = AIRCR_SYSRESETREQ | AIRCR_VKEY;
|
||||
#endif
|
||||
while(1)
|
||||
;
|
||||
|
||||
}
|
||||
#endif /* RAM_CODE */
|
||||
|
|
Loading…
Reference in New Issue