mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-24 03:36:52 -04:00
fusee-cpp: implement SecureInitialize besides InitializeClock()
This commit is contained in:
parent
c9bd97192f
commit
669564b022
10 changed files with 314 additions and 115 deletions
|
@ -21,108 +21,112 @@
|
|||
#include <vapours/results.hpp>
|
||||
#include <vapours/reg.hpp>
|
||||
|
||||
#define APBDEV_PMC_CNTRL (0x000)
|
||||
#define APBDEV_PMC_WAKE_MASK (0x00C)
|
||||
#define APBDEV_PMC_WAKE_LVL (0x010)
|
||||
#define APBDEV_PMC_WAKE_STATUS (0x014)
|
||||
#define APBDEV_PMC_DPD_PADS_ORIDE (0x01C)
|
||||
#define APBDEV_PMC_DPD_SAMPLE (0x020)
|
||||
#define APBDEV_PMC_DPD_ENABLE (0x024)
|
||||
#define APBDEV_PMC_CLAMP_STATUS (0x02C)
|
||||
#define APBDEV_PMC_PWRGATE_TOGGLE (0x030)
|
||||
#define APBDEV_PMC_REMOVE_CLAMPING_CMD (0x034)
|
||||
#define APBDEV_PMC_PWRGATE_STATUS (0x038)
|
||||
#define APBDEV_PMC_PWRGOOD_TIMER (0x03C)
|
||||
#define APBDEV_PMC_BLINK_TIMER (0x040)
|
||||
#define APBDEV_PMC_NO_IOPOWER (0x044)
|
||||
#define APBDEV_PMC_PWR_DET (0x048)
|
||||
#define APBDEV_PMC_SCRATCH0 (0x050)
|
||||
#define APBDEV_PMC_SCRATCH1 (0x054)
|
||||
#define APBDEV_PMC_SCRATCH4 (0x060)
|
||||
#define APBDEV_PMC_SCRATCH12 (0x080)
|
||||
#define APBDEV_PMC_SCRATCH13 (0x084)
|
||||
#define APBDEV_PMC_SCRATCH18 (0x098)
|
||||
#define APBDEV_PMC_SCRATCH20 (0x0A0)
|
||||
#define APBDEV_PMC_AUTO_WAKE_LVL_MASK (0x0DC)
|
||||
#define APBDEV_PMC_WAKE_DELAY (0x0E0)
|
||||
#define APBDEV_PMC_PWR_DET_VAL (0x0E4)
|
||||
#define APBDEV_PMC_CRYPTO_OP (0x0F4)
|
||||
#define APBDEV_PMC_SCRATCH31 (0x118)
|
||||
#define APBDEV_PMC_SCRATCH32 (0x11C)
|
||||
#define APBDEV_PMC_SCRATCH33 (0x120)
|
||||
#define APBDEV_PMC_SCRATCH39 (0x138)
|
||||
#define APBDEV_PMC_SCRATCH40 (0x13C)
|
||||
#define APBDEV_PMC_WAKE2_MASK (0x160)
|
||||
#define APBDEV_PMC_WAKE2_LVL (0x164)
|
||||
#define APBDEV_PMC_WAKE2_STATUS (0x168)
|
||||
#define APBDEV_PMC_AUTO_WAKE2_LVL_MASK (0x170)
|
||||
#define APBDEV_PMC_OSC_EDPD_OVER (0x1A4)
|
||||
#define APBDEV_PMC_CLK_OUT_CNTRL (0x1A8)
|
||||
#define APBDEV_PMC_RST_STATUS (0x1B4)
|
||||
#define APBDEV_PMC_IO_DPD_REQ (0x1B8)
|
||||
#define APBDEV_PMC_IO_DPD_STATUS (0x1BC)
|
||||
#define APBDEV_PMC_IO_DPD2_REQ (0x1C0)
|
||||
#define APBDEV_PMC_IO_DPD2_STATUS (0x1C4)
|
||||
#define APBDEV_PMC_SEL_DPD_TIM (0x1C8)
|
||||
#define APBDEV_PMC_SCRATCH45 (0x234)
|
||||
#define APBDEV_PMC_SCRATCH46 (0x238)
|
||||
#define APBDEV_PMC_SCRATCH49 (0x244)
|
||||
#define APBDEV_PMC_TSC_MULT (0x2B4)
|
||||
#define APBDEV_PMC_STICKY_BITS (0x2C0)
|
||||
#define APBDEV_PMC_WEAK_BIAS (0x2C8)
|
||||
#define APBDEV_PMC_GPU_RG_CNTRL (0x2D4)
|
||||
#define APBDEV_PMC_CNTRL2 (0x440)
|
||||
#define APBDEV_PMC_FUSE_CTRL (0x450)
|
||||
#define APBDEV_PMC_IO_DPD3_REQ (0x45C)
|
||||
#define APBDEV_PMC_IO_DPD3_STATUS (0x460)
|
||||
#define APBDEV_PMC_IO_DPD4_REQ (0x464)
|
||||
#define APBDEV_PMC_IO_DPD4_STATUS (0x468)
|
||||
#define APBDEV_PMC_SET_SW_CLAMP (0x47C)
|
||||
#define APBDEV_PMC_WAKE_DEBOUNCE_EN (0x4D8)
|
||||
#define APBDEV_PMC_DDR_CNTRL (0x4E4)
|
||||
#define APBDEV_PMC_SEC_DISABLE (0x004)
|
||||
#define APBDEV_PMC_SEC_DISABLE2 (0x2C4)
|
||||
#define APBDEV_PMC_SEC_DISABLE3 (0x2D8)
|
||||
#define APBDEV_PMC_SEC_DISABLE4 (0x5B0)
|
||||
#define APBDEV_PMC_SEC_DISABLE5 (0x5B4)
|
||||
#define APBDEV_PMC_SEC_DISABLE6 (0x5B8)
|
||||
#define APBDEV_PMC_SEC_DISABLE7 (0x5BC)
|
||||
#define APBDEV_PMC_SEC_DISABLE8 (0x5C0)
|
||||
#define APBDEV_PMC_SCRATCH43 (0x22C)
|
||||
#define APBDEV_PMC_SCRATCH190 (0x818)
|
||||
#define APBDEV_PMC_SCRATCH200 (0x840)
|
||||
#define APBDEV_PMC_SEC_DISABLE3 (0x2D8)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH4 (0x0C0)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH5 (0x0C4)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH6 (0x224)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH7 (0x228)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH16 (0x320)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH21 (0x334)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH24 (0x340)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH25 (0x344)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH26 (0x348)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH27 (0x34C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH32 (0x360)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH34 (0x368)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH35 (0x36C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH39 (0x37C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH51 (0x3AC)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH55 (0x3BC)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH74 (0x408)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH75 (0x40C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH76 (0x410)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH77 (0x414)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH78 (0x418)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH99 (0xAE4)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH100 (0xAE8)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH101 (0xAEC)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH102 (0xAF0)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH103 (0xAF4)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH112 (0xB18)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH113 (0xB1C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH114 (0xB20)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH115 (0xB24)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH119 (0xB34)
|
||||
#define APBDEV_PMC_CNTRL (0x000)
|
||||
#define APBDEV_PMC_WAKE_MASK (0x00C)
|
||||
#define APBDEV_PMC_WAKE_LVL (0x010)
|
||||
#define APBDEV_PMC_WAKE_STATUS (0x014)
|
||||
#define APBDEV_PMC_DPD_PADS_ORIDE (0x01C)
|
||||
#define APBDEV_PMC_DPD_SAMPLE (0x020)
|
||||
#define APBDEV_PMC_DPD_ENABLE (0x024)
|
||||
#define APBDEV_PMC_CLAMP_STATUS (0x02C)
|
||||
#define APBDEV_PMC_PWRGATE_TOGGLE (0x030)
|
||||
#define APBDEV_PMC_REMOVE_CLAMPING_CMD (0x034)
|
||||
#define APBDEV_PMC_PWRGATE_STATUS (0x038)
|
||||
#define APBDEV_PMC_PWRGOOD_TIMER (0x03C)
|
||||
#define APBDEV_PMC_BLINK_TIMER (0x040)
|
||||
#define APBDEV_PMC_NO_IOPOWER (0x044)
|
||||
#define APBDEV_PMC_PWR_DET (0x048)
|
||||
#define APBDEV_PMC_SCRATCH0 (0x050)
|
||||
#define APBDEV_PMC_SCRATCH1 (0x054)
|
||||
#define APBDEV_PMC_SCRATCH4 (0x060)
|
||||
#define APBDEV_PMC_SCRATCH12 (0x080)
|
||||
#define APBDEV_PMC_SCRATCH13 (0x084)
|
||||
#define APBDEV_PMC_SCRATCH18 (0x098)
|
||||
#define APBDEV_PMC_SCRATCH20 (0x0A0)
|
||||
#define APBDEV_PMC_AUTO_WAKE_LVL_MASK (0x0DC)
|
||||
#define APBDEV_PMC_WAKE_DELAY (0x0E0)
|
||||
#define APBDEV_PMC_PWR_DET_VAL (0x0E4)
|
||||
#define APBDEV_PMC_CRYPTO_OP (0x0F4)
|
||||
#define APBDEV_PMC_SCRATCH31 (0x118)
|
||||
#define APBDEV_PMC_SCRATCH32 (0x11C)
|
||||
#define APBDEV_PMC_SCRATCH33 (0x120)
|
||||
#define APBDEV_PMC_SCRATCH39 (0x138)
|
||||
#define APBDEV_PMC_SCRATCH40 (0x13C)
|
||||
#define APBDEV_PMC_WAKE2_MASK (0x160)
|
||||
#define APBDEV_PMC_WAKE2_LVL (0x164)
|
||||
#define APBDEV_PMC_WAKE2_STATUS (0x168)
|
||||
#define APBDEV_PMC_AUTO_WAKE2_LVL_MASK (0x170)
|
||||
#define APBDEV_PMC_OSC_EDPD_OVER (0x1A4)
|
||||
#define APBDEV_PMC_CLK_OUT_CNTRL (0x1A8)
|
||||
#define APBDEV_PMC_RST_STATUS (0x1B4)
|
||||
#define APBDEV_PMC_IO_DPD_REQ (0x1B8)
|
||||
#define APBDEV_PMC_IO_DPD_STATUS (0x1BC)
|
||||
#define APBDEV_PMC_IO_DPD2_REQ (0x1C0)
|
||||
#define APBDEV_PMC_IO_DPD2_STATUS (0x1C4)
|
||||
#define APBDEV_PMC_SEL_DPD_TIM (0x1C8)
|
||||
#define APBDEV_PMC_SCRATCH45 (0x234)
|
||||
#define APBDEV_PMC_SCRATCH46 (0x238)
|
||||
#define APBDEV_PMC_SCRATCH49 (0x244)
|
||||
#define APBDEV_PMC_TSC_MULT (0x2B4)
|
||||
#define APBDEV_PMC_STICKY_BITS (0x2C0)
|
||||
#define APBDEV_PMC_WEAK_BIAS (0x2C8)
|
||||
#define APBDEV_PMC_GPU_RG_CNTRL (0x2D4)
|
||||
#define APBDEV_PMC_CNTRL2 (0x440)
|
||||
#define APBDEV_PMC_FUSE_CTRL (0x450)
|
||||
#define APBDEV_PMC_IO_DPD3_REQ (0x45C)
|
||||
#define APBDEV_PMC_IO_DPD3_STATUS (0x460)
|
||||
#define APBDEV_PMC_IO_DPD4_REQ (0x464)
|
||||
#define APBDEV_PMC_IO_DPD4_STATUS (0x468)
|
||||
#define APBDEV_PMC_SET_SW_CLAMP (0x47C)
|
||||
#define APBDEV_PMC_WAKE_DEBOUNCE_EN (0x4D8)
|
||||
#define APBDEV_PMC_DDR_CNTRL (0x4E4)
|
||||
#define APBDEV_PMC_SEC_DISABLE (0x004)
|
||||
#define APBDEV_PMC_SEC_DISABLE2 (0x2C4)
|
||||
#define APBDEV_PMC_SEC_DISABLE3 (0x2D8)
|
||||
#define APBDEV_PMC_SEC_DISABLE4 (0x5B0)
|
||||
#define APBDEV_PMC_SEC_DISABLE5 (0x5B4)
|
||||
#define APBDEV_PMC_SEC_DISABLE6 (0x5B8)
|
||||
#define APBDEV_PMC_SEC_DISABLE7 (0x5BC)
|
||||
#define APBDEV_PMC_SEC_DISABLE8 (0x5C0)
|
||||
#define APBDEV_PMC_SCRATCH43 (0x22C)
|
||||
#define APBDEV_PMC_SCRATCH190 (0x818)
|
||||
#define APBDEV_PMC_SCRATCH200 (0x840)
|
||||
#define APBDEV_PMC_SEC_DISABLE3 (0x2D8)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH4 (0x0C0)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH5 (0x0C4)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH6 (0x224)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH7 (0x228)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH16 (0x320)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH21 (0x334)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH24 (0x340)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH25 (0x344)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH26 (0x348)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH27 (0x34C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH32 (0x360)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH34 (0x368)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH35 (0x36C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH39 (0x37C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH51 (0x3AC)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH55 (0x3BC)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH74 (0x408)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH75 (0x40C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH76 (0x410)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH77 (0x414)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH78 (0x418)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH99 (0xAE4)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH100 (0xAE8)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH101 (0xAEC)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH102 (0xAF0)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH103 (0xAF4)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH112 (0xB18)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH113 (0xB1C)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH114 (0xB20)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH115 (0xB24)
|
||||
#define APBDEV_PMC_SECURE_SCRATCH119 (0xB34)
|
||||
|
||||
#define APBDEV_PMC_TZRAM_PWR_CNTRL (0xBE8)
|
||||
#define APBDEV_PMC_TZRAM_SEC_DISABLE (0xBEC)
|
||||
#define APBDEV_PMC_TZRAM_NON_SEC_DISABLE (0xBF0)
|
||||
|
||||
|
||||
#define PMC_REG_BITS_MASK(NAME) REG_NAMED_BITS_MASK (APBDEV_PMC, NAME)
|
||||
|
@ -247,3 +251,12 @@ DEFINE_PMC_REG_BIT_ENUM(STICKY_BITS_JTAG_STS, 6, ENABLE, DISABLE);
|
|||
DEFINE_PMC_REG_BIT_ENUM(CNTRL2_WAKE_DET_EN, 9, DISABLE, ENABLE);
|
||||
|
||||
DEFINE_PMC_REG_BIT_ENUM(SEC_DISABLE2_WRITE21, 26, OFF, ON);
|
||||
|
||||
DEFINE_PMC_REG(TZRAM_PWR_CNTRL_TZRAM_SD, 0, 1);
|
||||
DEFINE_PMC_REG(TZRAM_PWR_CNTRL_TZRAM_SLCG_OVR, 1, 1);
|
||||
|
||||
DEFINE_PMC_REG_BIT_ENUM(TZRAM_SEC_DISABLE_SD_WRITE, 0, OFF, ON);
|
||||
DEFINE_PMC_REG_BIT_ENUM(TZRAM_SEC_DISABLE_SD_READ, 1, OFF, ON);
|
||||
|
||||
DEFINE_PMC_REG_BIT_ENUM(TZRAM_NON_SEC_DISABLE_SD_WRITE, 0, OFF, ON);
|
||||
DEFINE_PMC_REG_BIT_ENUM(TZRAM_NON_SEC_DISABLE_SD_READ, 1, OFF, ON);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue