fusee_cpp: implement SDRAM initialization
This commit is contained in:
@@ -52,3 +52,23 @@ __gnu_thumb1_case_uhi:
|
||||
bx lr
|
||||
.type __gnu_thumb1_case_uhi, %function
|
||||
.size __gnu_thumb1_case_uhi, .-__gnu_thumb1_case_uhi
|
||||
|
||||
.section .text.__gnu_thumb1_case_si, "ax", %progbits
|
||||
.globl __gnu_thumb1_case_si
|
||||
.align 0
|
||||
.thumb_func
|
||||
.syntax unified
|
||||
__gnu_thumb1_case_si:
|
||||
push {r0, r1}
|
||||
mov r1, lr
|
||||
adds.n r1, r1, #2
|
||||
lsrs r1, r1, #2
|
||||
lsls r0, r0, #2
|
||||
lsls r1, r1, #2
|
||||
ldr r0, [r1, r0]
|
||||
adds r0, r0, r1
|
||||
mov lr, r0
|
||||
pop {r0, r1}
|
||||
bx lr
|
||||
.type __gnu_thumb1_case_si, %function
|
||||
.size __gnu_thumb1_case_si, .-__gnu_thumb1_case_si
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace ams::pmic {
|
||||
constexpr inline int Max77620RegisterCnfgBbc = 0x04;
|
||||
constexpr inline int Max77620RegisterOnOffStat = 0x15;
|
||||
constexpr inline int Max77620RegisterSd0 = 0x16;
|
||||
constexpr inline int Max77620RegisterSd1 = 0x17;
|
||||
constexpr inline int Max77620RegisterCnfg2Sd = 0x22;
|
||||
constexpr inline int Max77620RegisterCnfg1Ldo8 = 0x33;
|
||||
constexpr inline int Max77620RegisterGpio0 = 0x36;
|
||||
constexpr inline int Max77620RegisterAmeGpio = 0x40;
|
||||
@@ -276,4 +278,14 @@ namespace ams::pmic {
|
||||
i2c::SendByte(i2c::Port_5, I2cAddressMax77620Pmic, Max77620RegisterCnfg1Ldo8, 0xE8);
|
||||
}
|
||||
|
||||
void EnableVddMemory(fuse::SocType soc_type) {
|
||||
/* Disable remote sense for Sd1. */
|
||||
i2c::SendByte(i2c::Port_5, I2cAddressMax77620Pmic, Max77620RegisterCnfg2Sd, 0x05);
|
||||
|
||||
/* On Erista, set Sd1 voltage. */
|
||||
if (soc_type == fuse::SocType_Erista) {
|
||||
SetVoltage(Max77620RegisterSd1, 1100);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user