Some clean-up
This commit is contained in:
parent
796e4dd060
commit
42885560ed
@ -5,17 +5,17 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
/**************************AES****************************/
|
/**************************AES****************************/
|
||||||
#define REG_AESCNT ((volatile u32*)0x10009000)
|
#define REG_AESCNT ((vu32 *)0x10009000)
|
||||||
#define REG_AESBLKCNT ((volatile u32*)0x10009004)
|
#define REG_AESBLKCNT ((vu32 *)0x10009004)
|
||||||
#define REG_AESWRFIFO ((volatile u32*)0x10009008)
|
#define REG_AESWRFIFO ((vu32 *)0x10009008)
|
||||||
#define REG_AESRDFIFO ((volatile u32*)0x1000900C)
|
#define REG_AESRDFIFO ((vu32 *)0x1000900C)
|
||||||
#define REG_AESKEYSEL ((volatile u8 *)0x10009010)
|
#define REG_AESKEYSEL ((vu8 *)0x10009010)
|
||||||
#define REG_AESKEYCNT ((volatile u8 *)0x10009011)
|
#define REG_AESKEYCNT ((vu8 *)0x10009011)
|
||||||
#define REG_AESCTR ((volatile u32*)0x10009020)
|
#define REG_AESCTR ((vu32 *)0x10009020)
|
||||||
|
|
||||||
#define REG_AESKEYFIFO ((volatile u32*)0x10009100)
|
#define REG_AESKEYFIFO ((vu32 *)0x10009100)
|
||||||
#define REG_AESKEYXFIFO ((volatile u32*)0x10009104)
|
#define REG_AESKEYXFIFO ((vu32 *)0x10009104)
|
||||||
#define REG_AESKEYYFIFO ((volatile u32*)0x10009108)
|
#define REG_AESKEYYFIFO ((vu32 *)0x10009108)
|
||||||
|
|
||||||
#define AES_CCM_DECRYPT_MODE (0u << 27)
|
#define AES_CCM_DECRYPT_MODE (0u << 27)
|
||||||
#define AES_CCM_ENCRYPT_MODE (1u << 27)
|
#define AES_CCM_ENCRYPT_MODE (1u << 27)
|
||||||
|
@ -27,10 +27,10 @@ static const char *firmPathPatched = NULL;
|
|||||||
|
|
||||||
void setupCFW(void){
|
void setupCFW(void){
|
||||||
|
|
||||||
//Determine if booting with A9LH via PDN_SPI_CNT
|
//Determine if booting with A9LH
|
||||||
u32 a9lhBoot = (*(u8 *)0x101401C0 == 0x0) ? 1 : 0;
|
u32 a9lhBoot = (PDN_SPI_CNT == 0x0) ? 1 : 0;
|
||||||
//Retrieve the last booted FIRM via CFG_BOOTENV
|
//Retrieve the last booted FIRM
|
||||||
u8 previousFirm = *(u8 *)0x10010000;
|
u8 previousFirm = CFG_BOOTENV;
|
||||||
u32 overrideConfig = 0;
|
u32 overrideConfig = 0;
|
||||||
const char lastConfigPath[] = "rei/lastbootcfg";
|
const char lastConfigPath[] = "rei/lastbootcfg";
|
||||||
|
|
||||||
@ -69,8 +69,8 @@ void setupCFW(void){
|
|||||||
//If L and R are pressed, chainload an external payload
|
//If L and R are pressed, chainload an external payload
|
||||||
if(a9lhBoot && (pressed & BUTTON_L1R1) == BUTTON_L1R1) loadPayload();
|
if(a9lhBoot && (pressed & BUTTON_L1R1) == BUTTON_L1R1) loadPayload();
|
||||||
|
|
||||||
//Check if it's a no-screen-init A9LH boot via PDN_GPU_CNT
|
//Check if it's a no-screen-init A9LH boot
|
||||||
if(*(u8 *)0x10141200 != 0x1) loadSplash();
|
if(PDN_GPU_CNT != 0x1) loadSplash();
|
||||||
|
|
||||||
/* If L is pressed, and on an updated SysNAND setup the SAFE MODE combo
|
/* If L is pressed, and on an updated SysNAND setup the SAFE MODE combo
|
||||||
is not pressed, boot 9.0 FIRM */
|
is not pressed, boot 9.0 FIRM */
|
||||||
|
@ -8,8 +8,11 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#define PDN_MPCORE_CFG (*(u8*)0x10140FFC)
|
#define PDN_MPCORE_CFG (*(vu8 *)0x10140FFC)
|
||||||
#define HID_PAD ((~*(u16*)0x10146000) & 0xFFF)
|
#define HID_PAD ((~*(vu16 *)0x10146000) & 0xFFF)
|
||||||
|
#define PDN_SPI_CNT (*(vu8 *)0x101401C0)
|
||||||
|
#define CFG_BOOTENV (*(vu8 *)0x10010000)
|
||||||
|
#define PDN_GPU_CNT (*(vu8 *)0x10141200)
|
||||||
#define BUTTON_R1 (1 << 8)
|
#define BUTTON_R1 (1 << 8)
|
||||||
#define BUTTON_L1 (1 << 9)
|
#define BUTTON_L1 (1 << 9)
|
||||||
#define BUTTON_L1R1 (BUTTON_R1 | BUTTON_L1)
|
#define BUTTON_L1R1 (BUTTON_R1 | BUTTON_L1)
|
||||||
|
Reference in New Issue
Block a user