Skip to content

Commit 4232f01

Browse files
Merge pull request #2 from N1kroks/main
Add ShellCode for Redmi Note 9S
2 parents 185cd1c + 476aba4 commit 4232f01

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Config/DualBoot.Sm7125.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
StackBase=0x9FC00000
2+
StackSize=0x00300000

ShellCode/ShellCode.Miatoll.S

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.include "DummyHead.S"
2+
3+
/* Shell Code for Redmi Note 9S */
4+
_ShellCodeStart:
5+
movz x4, #0x6000
6+
movk x4, #0xE60, lsl #16 // Store 0xE606000 to x4, which is address of 0xC0 spmi channel
7+
movz x5, #0x0081
8+
movk x5, #0x800, lsl #16 // Store 0x8000081 to x5, which is command to read gpio status
9+
str x5, [x4], 0x8 // Store x5 to cmd reg, then add 0x8 to x4
10+
mov w7, wzr // Set w7 to 0
11+
WaitForDone:
12+
ldr w7, [x4] // Get status value from address stored in x4 and store it to w7
13+
cbz w7, WaitForDone // Compare w7 with 0x0, if w7 == 0x0 goto WaitForDone
14+
add x4, x4, 0x10 // Add 0x10 to x4
15+
mov w6, wzr // Set w6 to 0
16+
WaitForData:
17+
ldr w6, [x4] // Get data value from address stored in x4 and store it to w6
18+
cbz w6, WaitForData // Compare w6 with 0x0, if w6 == 0x0 goto WaitForData
19+
and w6, w6, 0x1 // w6 & 0x1 and save value in w6.
20+
cbz w6, _UEFI // Compare w6 with 0, if w6 == 0 goto _UEFI, else execute next instruction(jmp Linux)
21+
22+
.include "CommonTail.S"
23+
/* Do not remove the last line */

0 commit comments

Comments
 (0)