Skip to content
Permalink
Browse files

Partial 8.0 support

  • Loading branch information...
EliseZeroTwo committed Apr 17, 2019
1 parent 2b3559d commit fe94f6a516e6983f9850627ac21d5764d4e7f672
Showing with 23 additions and 3 deletions.
  1. +1 −1 Makefile
  2. +1 −0 src/bootloader.h
  3. +19 −1 src/firmware.c
  4. +2 −1 src/hwinit/types.h
@@ -10,7 +10,7 @@ OBJCOPY = $(DEVKITARM)/bin/arm-none-eabi-objcopy

name := ReiNX
ver_major := 2
ver_minor := 1
ver_minor := 2

dir_source := src
dir_data := data
@@ -29,6 +29,7 @@ static const pk11_offs _pk11_offs[] = {
{ KB_FIRMWARE_VERSION_600, 0x1900, 0x3FE0, { 1, 2, 0 }, 0x4002B000, 0x4003D800 }, //6.0.0
{ KB_FIRMWARE_VERSION_620, 0x0E00, 0x6FE0, { 1, 2, 0 }, 0x4002B000, 0x4003D800 }, //6.2.0
{ KB_FIRMWARE_VERSION_700, 0x0F00, 0x6FE0, { 1, 2, 0 }, 0x40030000, 0x4003E000 }, //7.0.0
{ KB_FIRMWARE_VERSION_800, 0x0E00, 0x6FE0, { 1, 2, 0 }, 0x40030000, 0x4003E000 },
{ NULL } // End.
};

@@ -49,6 +49,22 @@ int drawSplash() {
return 0;
}

pk11_offs *distinguishVersions(u32 kb) {
if (kb == KB_FIRMWARE_VERSION_200) {
if (strcmp(id, "20161121183008")) {
return &_pk11_offs[1];
} else {
return &_pk11_offs[0];
}
} else if ((kb == KB_FIRMWARE_VERSION_700)) {
if (strcmp(id, "20181218175730")) {
return &_pk11_offs[9];
} else {
return &_pk11_offs[8];
}
}
}

u8 loadFirm() {
print("%k\nSetting up HOS:\n%k", WHITE, DEFAULT_TEXT_COL);
sdmmc_storage_t storage;
@@ -74,7 +90,9 @@ u8 loadFirm() {
// Read package1.
u8 *pkg1ldr = ReadPackage1Ldr(&storage);
memcpy(id, pkg1ldr + 0x10, 14);

if (pk11Offs->kb == KB_FIRMWARE_VERSION_100 || pk11Offs->kb == KB_FIRMWARE_VERSION_700)
pk11Offs = distinguishVersions(pk11Offs->kb);

// Decrypt package1 and setup warmboot.
print("Decrypting Package1...\n");
u8 *pkg11 = pkg1ldr + pk11Offs->pkg11_off;
@@ -56,7 +56,8 @@ enum KB_FIRMWARE_VERSION {
KB_FIRMWARE_VERSION_500 = 4,
KB_FIRMWARE_VERSION_600 = 5,
KB_FIRMWARE_VERSION_620 = 6,
KB_FIRMWARE_VERSION_700 = 7
KB_FIRMWARE_VERSION_700 = 7,
KB_FIRMWARE_VERSION_800 = 7,
};

#endif

0 comments on commit fe94f6a

Please sign in to comment.
You can’t perform that action at this time.