fusee: Implement BootConfig and Boot Reason handling.

This commit is contained in:
hexkyz
2018-08-29 18:28:21 +01:00
parent 1cbbdb43d3
commit 611e85e6ee
19 changed files with 299 additions and 109 deletions

View File

@@ -5,22 +5,26 @@
#define MAILBOX_NX_BOOTLOADER_BASE ((void *)(0x40002000))
#define MAILBOX_NX_BOOTLOADER_BOOT_REASON (MAILBOX_NX_BOOTLOADER_BASE + 0xE10)
#define MAILBOX_NX_BOOTLOADER_SETUP_STATE MAKE_REG32(MAILBOX_NX_BOOTLOADER_BASE + 0xEF8)
#define MAILBOX_NX_BOOTLOADER_IS_SECMON_AWAKE MAKE_REG32(MAILBOX_NX_BOOTLOADER_BASE + 0xEFC)
#define NX_BOOTLOADER_STATE_INIT 0
#define NX_BOOTLOADER_STATE_MOVED_BOOTCONFIG 1
#define NX_BOOTLOADER_STATE_LOADED_PACKAGE2 2
#define NX_BOOTLOADER_STATE_FINISHED 3
#define NX_BOOTLOADER_STATE_DRAM_INITIALIZED_4X 2
#define NX_BOOTLOADER_STATE_LOADED_PACKAGE2_4X 3
#define NX_BOOTLOADER_STATE_FINISHED_4X 4
/* Physaddr 0x40002EFC */
#define MAILBOX_NX_BOOTLOADER_IS_SECMON_AWAKE MAKE_REG32(MAILBOX_NX_BOOTLOADER_BASE + 0xEFC)
#define MAILBOX_NX_BOOTLOADER_BOOT_REASON (MAILBOX_NX_BOOTLOADER_BASE + 0xE10)
typedef struct {
uint32_t bootloader_version;
uint32_t bootloader_start_block;
uint32_t bootloader_start_page;
uint32_t bootloader_attribute;
uint32_t boot_reason_value;
uint32_t boot_reason_state;
} boot_reason_t;
void nxboot_main(void);