Finish actual Package2 loading code.

This commit is contained in:
Michael Scire
2018-02-21 13:38:55 -08:00
parent 896d167b64
commit d0e28890b0
4 changed files with 187 additions and 4 deletions

View File

@@ -21,8 +21,25 @@
#define NX_BOOTLOADER_PACKAGE2_LOAD_ADDRESS ((void *)(0xA9800000ULL))
#define DRAM_BASE_PHYSICAL (0x80000000ULL)
#define MAGIC_PK21 (0x31324B50)
#define PACKAGE2_SIZE_MAX 0x7FC000
#define PACKAGE2_SECTION_MAX 0x3
#define PACKAGE2_MINVER_THEORETICAL 0x0
#define PACKAGE2_MAXVER_100 0x2
#define PACKAGE2_MAXVER_200 0x3
#define PACKAGE2_MAXVER_300 0x4
#define PACKAGE2_MAXVER_302 0x5
#define PACKAGE2_MAXVER_400_CURRENT 0x6
#define PACKAGE2_MINVER_100 0x3
#define PACKAGE2_MINVER_200 0x4
#define PACKAGE2_MINVER_300 0x5
#define PACKAGE2_MINVER_302 0x6
#define PACKAGE2_MINVER_400_CURRENT 0x7
#pragma pack(push, 1)
typedef struct {
@@ -32,7 +49,7 @@ typedef struct {
};
uint8_t section_ctrs[4][0x10];
uint32_t magic;
uint32_t base_offset;
uint32_t entrypoint;
uint32_t _0x58;
uint8_t version_max; /* Must be > TZ value. */
uint8_t version_min; /* Must be < TZ value. */