fusee/exo2: more fixes to boot lower firmwares

This commit is contained in:
Michael Scire 2020-06-12 00:46:21 -07:00 committed by SciresM
parent 47512cc8a2
commit 597bdded69
4 changed files with 8 additions and 10 deletions

View file

@ -14,11 +14,13 @@ exosphere.bin: program.lz4 boot_code.lz4
@printf LENY >> exosphere.bin
@echo "Built exosphere.bin..."
program.lz4:
$(MAKE) -C program
program.lz4: build_program
@cp program/program.lz4 program.lz4
@cp program/boot_code.lz4 boot_code.lz4
build_program:
$(MAKE) -C program
warmboot.bin:
$(MAKE) -C warmboot
@cp warmboot/warmboot.bin warmboot.bin
@ -40,4 +42,4 @@ warmboot-clean:
boot_code-clean:
@rm -f boot_code.lz4
.PHONY: all clean $(CLEAN_TARGETS)
.PHONY: all clean build_program $(CLEAN_TARGETS)

View file

@ -572,7 +572,7 @@ namespace ams::secmon::smc {
const u8 * const seal_key_source = SealKeySources[seal_key_type];
/* Decrypt the data. */
if (!DecryptDeviceUniqueData(work_buffer, data_size, nullptr, seal_key_source, se::AesBlockSize, access_key, sizeof(access_key), key_source, sizeof(key_source), work_buffer, data_size, enforce_device_unique)) {
if (!DecryptDeviceUniqueData(work_buffer, data_size, nullptr, seal_key_source, se::AesBlockSize, access_key, se::AesBlockSize, key_source, se::AesBlockSize, work_buffer, data_size, enforce_device_unique)) {
return SmcResult::InvalidArgument;
}

View file

@ -954,11 +954,7 @@ uint32_t nxboot_main(void) {
print(SCREEN_LOG_LEVEL_INFO, u8"[NXBOOT] Reading Exosphère...\n");
/* Select the right address for Exosphère. */
if (MAILBOX_EXOSPHERE_CONFIGURATION->target_firmware < ATMOSPHERE_TARGET_FIRMWARE_4_0_0) {
exosphere_memaddr = (void *)0x4002D000;
} else {
exosphere_memaddr = (void *)0x40030000;
}
/* Copy Exosphère to a good location or read it directly to it. */
if (loader_ctx->exosphere_path[0] != '\0') {

View file

@ -35,7 +35,7 @@ typedef struct {
#define MAILBOX_NX_BOOTLOADER_BASE_100_620 0x40002E00
#define MAILBOX_NX_BOOTLOADER_BASE_700 0x40000000
#define MAILBOX_NX_BOOTLOADER_BASE(targetfw) ((targetfw >= ATMOSPHERE_TARGET_FIRMWARE_7_0_0) ? (MAILBOX_NX_BOOTLOADER_BASE_700) : (MAILBOX_NX_BOOTLOADER_BASE_100_620))
#define MAILBOX_NX_BOOTLOADER_BASE(targetfw) (MAILBOX_NX_BOOTLOADER_BASE_700)
#define MAKE_MAILBOX_NX_BOOTLOADER_REG(targetfw, n) MAKE_REG32(MAILBOX_NX_BOOTLOADER_BASE(targetfw) + n)
#define MAILBOX_NX_BOOTLOADER_BOOT_REASON_BASE(targetfw) (MAILBOX_NX_BOOTLOADER_BASE(targetfw) + 0x10)