Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed May 5, 2024
1 parent dd22c35 commit c1ae2c0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions libs/iplsdk/comms.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ enum SysconCommand {
SYSCON_CTRL_POWER = 0x45,
SYSCON_GET_POWER_STATUS = 0x46,
SYSCON_CTRL_LED = 0x47,
SYSCON_CTRL_MS_POWER = 0x4C,
};

int syscon_issue_command_write(enum SysconCommand cmd, const unsigned char *data, unsigned int length);
Expand Down
8 changes: 8 additions & 0 deletions libs/iplsdk/syscon.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ int syscon_ctrl_hr_power(unsigned int on)
return syscon_issue_command_write(SYSCON_CTRL_HR_POWER, &on_val, 1);
}

int syscon_ctrl_ms_power(unsigned int on)
{
unsigned char on_val = on;

// write message directly to syscon
return syscon_issue_command_write(SYSCON_CTRL_MS_POWER, &on_val, 1);
}

int syscon_get_pommel_version(unsigned int *version)
{
return syscon_issue_command_read(SYSCON_GET_POMMEL_VERSION, (unsigned char *)version);
Expand Down
5 changes: 2 additions & 3 deletions loader/perma/cipl/new/ipl_stage1_payload/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,10 @@ int main()

#ifndef MSIPL
uint32_t keys = -1;
syscon_issue_command_read(0x07, &keys);
syscon_get_digital_key(&keys);
if ((keys & SYSCON_CTRL_LTRIGGER) == 0)
{
u32 ms_on = 1;
syscon_issue_command_write(0x4c, &ms_on, 3);
syscon_ctrl_ms_power(1);

MsFatMount();

Expand Down
3 changes: 1 addition & 2 deletions loader/perma/cipl/new/ipl_stage2_payload/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ int main()
memcpy((u8 *) 0x8FC0000, &payloadex, size_payloadex);

#ifdef MSIPL
u32 ms_on = 1;
syscon_issue_command_write(0x4c, &ms_on, 3);
syscon_ctrl_ms_power(1);
#endif

*(u32 *) 0x8FB0000 = -1;
Expand Down
3 changes: 1 addition & 2 deletions loader/rebootex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ int _arkReboot(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int a

syscon_init();

u32 ms_on = 1;
syscon_issue_command_write(0x4c, &ms_on, 3);
syscon_ctrl_ms_power(1);
#endif

#ifdef PAYLOADEX
Expand Down

0 comments on commit c1ae2c0

Please sign in to comment.