Compare commits
535 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2421ba6c96 | ||
|
|
db55e9f6b1 | ||
|
|
469e3290f6 | ||
|
|
cfe0597385 | ||
|
|
3b639b604d | ||
|
|
810b094dc7 | ||
|
|
c2bf630c40 | ||
|
|
25c392676b | ||
|
|
48f7697784 | ||
|
|
e4653eeaef | ||
|
|
e53a592f72 | ||
|
|
6ce038acad | ||
|
|
b1aee64b81 | ||
|
|
1f9cb90923 | ||
|
|
eca2b453ae | ||
|
|
e14dc18bd3 | ||
|
|
c7743c6098 | ||
|
|
d81a3bdc36 | ||
|
|
32e5283ac2 | ||
|
|
1d9a4f47fd | ||
|
|
3f5f9b60ea | ||
|
|
08e1b4d116 | ||
|
|
683580861f | ||
|
|
7d30460214 | ||
|
|
d7ba3291ed | ||
|
|
c07f54f370 | ||
|
|
6fe8ada37a | ||
|
|
94b10b5779 | ||
|
|
9b677c81a5 | ||
|
|
a25be61e94 | ||
|
|
116e00c21c | ||
|
|
122b0775f1 | ||
|
|
11f840b1e3 | ||
|
|
36039ddbb7 | ||
|
|
5347f0d583 | ||
|
|
408dde533f | ||
|
|
b15b46a68e | ||
|
|
ba6f298618 | ||
|
|
c6424921a6 | ||
|
|
8547802904 | ||
|
|
353e27b9e2 | ||
|
|
4a38a36036 | ||
|
|
200d2df785 | ||
|
|
73552c86c3 | ||
|
|
dd80e1f463 | ||
|
|
15c929a0e4 | ||
|
|
aa4c79cd9c | ||
|
|
6719abec65 | ||
|
|
79b9e07ee9 | ||
|
|
eca5ac01b8 | ||
|
|
50ea19e7a2 | ||
|
|
823a1f3ea3 | ||
|
|
b73895df0a | ||
|
|
5062329979 | ||
|
|
065485b971 | ||
|
|
6193283f03 | ||
|
|
eb48e7cc59 | ||
|
|
d98490d339 | ||
|
|
b2e86f5a1b | ||
|
|
0e9974e7b3 | ||
|
|
496be5ecd4 | ||
|
|
50a91b1d6e | ||
|
|
f872be67eb | ||
|
|
e04679f05a | ||
|
|
8d1ada2a1b | ||
|
|
a50d6a2696 | ||
|
|
76d72fa946 | ||
|
|
8b19fdfd51 | ||
|
|
612d846132 | ||
|
|
816ce605d3 | ||
|
|
07c95662b1 | ||
|
|
2b930d21fd | ||
|
|
0b52596087 | ||
|
|
e9134d8044 | ||
|
|
33d6dfb6b3 | ||
|
|
6096fa0e45 | ||
|
|
058f265bd6 | ||
|
|
bd4c608b08 | ||
|
|
7fc1e86bf5 | ||
|
|
87ec045a98 | ||
|
|
7502e2174f | ||
|
|
0545eb18c0 | ||
|
|
0c161a4c1b | ||
|
|
3d518759da | ||
|
|
0af2758fde | ||
|
|
9bb5af9823 | ||
|
|
82eab9c8d0 | ||
|
|
3cca3801ca | ||
|
|
03408f404a | ||
|
|
92e7a3ca08 | ||
|
|
b27c7552d2 | ||
|
|
426257d4ae | ||
|
|
7d34d599bb | ||
|
|
067fe2d10f | ||
|
|
4759c2f92c | ||
|
|
ca26d8ce27 | ||
|
|
6c52cc3e26 | ||
|
|
e42d3a3abf | ||
|
|
884844bc23 | ||
|
|
f556db8c89 | ||
|
|
96d15b28c6 | ||
|
|
37f7afb426 | ||
|
|
7dd4e76c1d | ||
|
|
daa0deb1bf | ||
|
|
43bd733f0a | ||
|
|
70367e3e7c | ||
|
|
45f8343659 | ||
|
|
e8dfe04701 | ||
|
|
95d5375158 | ||
|
|
b735bc53c4 | ||
|
|
b4856a2d07 | ||
|
|
ed4491a24f | ||
|
|
93004be59e | ||
|
|
237b513408 | ||
|
|
4c5e980e07 | ||
|
|
08d9de6907 | ||
|
|
6eee3f5fe7 | ||
|
|
4eb3109c93 | ||
|
|
f7fb689412 | ||
|
|
2181adb82b | ||
|
|
40c6733de3 | ||
|
|
c703be86fc | ||
|
|
f3732c72dc | ||
|
|
c7026b9094 | ||
|
|
f9403201f0 | ||
|
|
fd34e2342a | ||
|
|
0e5ade727c | ||
|
|
c4065c976c | ||
|
|
392c9c3a0b | ||
|
|
4f33afe0ee | ||
|
|
dc1404061c | ||
|
|
8da705d40b | ||
|
|
4f34a38a97 | ||
|
|
799f94958c | ||
|
|
c17b6d0d44 | ||
|
|
5a8aebf74d | ||
|
|
191414c832 | ||
|
|
a429c61f33 | ||
|
|
ad1158b30a | ||
|
|
ba8c77fec6 | ||
|
|
f427c3d7a5 | ||
|
|
05a24b5726 | ||
|
|
8306464758 | ||
|
|
4a30437e80 | ||
|
|
80e1847534 | ||
|
|
8ccac1d18a | ||
|
|
c3656aae30 | ||
|
|
5fa534fb71 | ||
|
|
f3629f863d | ||
|
|
d675aa3414 | ||
|
|
981166783b | ||
|
|
c0f7cd95b9 | ||
|
|
40400aee1f | ||
|
|
9572fb2ce3 | ||
|
|
eb75d54b2b | ||
|
|
081bd0aefc | ||
|
|
fa4a96d021 | ||
|
|
3c5efefb15 | ||
|
|
3e4c962bbb | ||
|
|
34fb48b412 | ||
|
|
40980904f7 | ||
|
|
5055bdb23e | ||
|
|
d2a888d9e8 | ||
|
|
bb3f7c8ab9 | ||
|
|
efae01c165 | ||
|
|
9f9593e05f | ||
|
|
80b115ef57 | ||
|
|
560c340c96 | ||
|
|
aae3c789f2 | ||
|
|
c568788609 | ||
|
|
28ea0b12a8 | ||
|
|
b857153964 | ||
|
|
d9c3908caf | ||
|
|
b99bcbc619 | ||
|
|
905ce0eeea | ||
|
|
0534ddd37a | ||
|
|
30b3825f5c | ||
|
|
05a3e95834 | ||
|
|
fba8fb539d | ||
|
|
772e1f1c4f | ||
|
|
154422562a | ||
|
|
25b0baae59 | ||
|
|
92521eed2a | ||
|
|
cbc73f4407 | ||
|
|
30d6b359f9 | ||
|
|
2c496e94d5 | ||
|
|
20b5268e90 | ||
|
|
11f70759ce | ||
|
|
b3e6571586 | ||
|
|
5b98426171 | ||
|
|
c91386b0fa | ||
|
|
19e6d2e1c0 | ||
|
|
ea0011d572 | ||
|
|
364b04b68a | ||
|
|
8c93eb5712 | ||
|
|
c6d1579265 | ||
|
|
34bb800440 | ||
|
|
ef3da6cb51 | ||
|
|
3bcc4adb5c | ||
|
|
3c78bc4dbf | ||
|
|
fdd7b1db15 | ||
|
|
50b8189e7f | ||
|
|
3284656aad | ||
|
|
1d65352167 | ||
|
|
d8e94996ad | ||
|
|
5dae43b192 | ||
|
|
4b6b06fcaa | ||
|
|
919b8124dc | ||
|
|
e330b6187f | ||
|
|
1224ed8abe | ||
|
|
e9e949ec36 | ||
|
|
8cfffc69d5 | ||
|
|
cb6af379d8 | ||
|
|
d9e6771e63 | ||
|
|
f7d3d50f33 | ||
|
|
9dc7a4dc18 | ||
|
|
1de607c183 | ||
|
|
23f5d77f37 | ||
|
|
5961151a92 | ||
|
|
323858cf96 | ||
|
|
5f857cb079 | ||
|
|
62de3322ff | ||
|
|
1309e93e26 | ||
|
|
c6a736a6f6 | ||
|
|
30e39e60f7 | ||
|
|
108b997ef2 | ||
|
|
877b2cf790 | ||
|
|
5e4307046a | ||
|
|
2355047715 | ||
|
|
57222e8301 | ||
|
|
797c04d19f | ||
|
|
9accbcf8e1 | ||
|
|
86eea62cd8 | ||
|
|
00b093ec62 | ||
|
|
b2b1129cc0 | ||
|
|
d9db723bc8 | ||
|
|
08cb370a45 | ||
|
|
d262ff92cc | ||
|
|
e1adbb6dba | ||
|
|
e25a4ca8d7 | ||
|
|
059c706f19 | ||
|
|
484f132651 | ||
|
|
d5a4c17ee7 | ||
|
|
7d6b16d7fb | ||
|
|
2faf3d33b5 | ||
|
|
bb4ade30e4 | ||
|
|
981bb1f15d | ||
|
|
ad0d2faa6c | ||
|
|
507ab46709 | ||
|
|
7820e5b759 | ||
|
|
7c703903ea | ||
|
|
e7dee2a9fc | ||
|
|
b2e522c0a0 | ||
|
|
875b62f06a | ||
|
|
32fb22e361 | ||
|
|
b3bfd6c4c9 | ||
|
|
866771fdae | ||
|
|
308ddecc9c | ||
|
|
24d41ce55e | ||
|
|
bce7133128 | ||
|
|
3982afdd6b | ||
|
|
6ee305464a | ||
|
|
6ecf04c3b7 | ||
|
|
471bc7cc92 | ||
|
|
9df7f0aada | ||
|
|
3a91a6b786 | ||
|
|
7806766a59 | ||
|
|
11d4e74620 | ||
|
|
9068e2071c | ||
|
|
769a57526c | ||
|
|
0751db5d12 | ||
|
|
d1fbd64235 | ||
|
|
da59334c5e | ||
|
|
f3fa680d5d | ||
|
|
5b1060b30e | ||
|
|
d5458960d5 | ||
|
|
4d5cde3f7b | ||
|
|
8528248d2b | ||
|
|
814c9d1cfb | ||
|
|
9d7b548ce0 | ||
|
|
d779eea009 | ||
|
|
3038612774 | ||
|
|
59be817bb8 | ||
|
|
b965e3f335 | ||
|
|
43c0e39c34 | ||
|
|
0d8bde6079 | ||
|
|
38f942adf5 | ||
|
|
145ee8fcc8 | ||
|
|
48772307bf | ||
|
|
2619ccad0c | ||
|
|
6d5d97cfcd | ||
|
|
846f610fff | ||
|
|
2e8f06ef44 | ||
|
|
5fbd728962 | ||
|
|
11ec6a6912 | ||
|
|
b89f0e45ec | ||
|
|
18d998034d | ||
|
|
27994bb306 | ||
|
|
3e2ec256ab | ||
|
|
bf5bbfbcef | ||
|
|
d10621e832 | ||
|
|
d3b697fd1d | ||
|
|
daa7f5db79 | ||
|
|
4adc0e4096 | ||
|
|
8e3c34ea89 | ||
|
|
a85e20bcea | ||
|
|
879f8a5147 | ||
|
|
f78653d815 | ||
|
|
3c7c1fbd8a | ||
|
|
8efdd04fcd | ||
|
|
623b5f4eb9 | ||
|
|
af352e4f7f | ||
|
|
2866cb5fe6 | ||
|
|
b5becba8ff | ||
|
|
36c47a0014 | ||
|
|
0b0fdc5c58 | ||
|
|
5a15d62b8b | ||
|
|
d0404f3cc9 | ||
|
|
2ae298de24 | ||
|
|
a2d2b1b346 | ||
|
|
06e4b94674 | ||
|
|
f1a9dd8a98 | ||
|
|
0a18c63f24 | ||
|
|
f9a199557c | ||
|
|
0fdbdb1f4d | ||
|
|
e734b23f11 | ||
|
|
de1e6c9705 | ||
|
|
71b220a4e9 | ||
|
|
5448332009 | ||
|
|
d3bafc5b3b | ||
|
|
2c9e1a814c | ||
|
|
df012e6e21 | ||
|
|
2420b26981 | ||
|
|
c1d68d7f0d | ||
|
|
7cead4b620 | ||
|
|
27202b2fab | ||
|
|
1556a92a38 | ||
|
|
206b1a1b57 | ||
|
|
a26e157579 | ||
|
|
9578622abf | ||
|
|
d4f99ddb4d | ||
|
|
0105455086 | ||
|
|
28717bfd27 | ||
|
|
71fd69eb5a | ||
|
|
9d7b52e2d4 | ||
|
|
255e46e6d2 | ||
|
|
7472bc1c7f | ||
|
|
3c7ece2f8b | ||
|
|
a7e89c6dbb | ||
|
|
b0cae74bb9 | ||
|
|
889ea5e5aa | ||
|
|
7e6ff1f327 | ||
|
|
ea49c2ccd1 | ||
|
|
d484872a73 | ||
|
|
6ee525201c | ||
|
|
5ac7ae7edb | ||
|
|
0c590eb768 | ||
|
|
bd40d4f237 | ||
|
|
788436b4a3 | ||
|
|
2bb77237bc | ||
|
|
33827fe3a3 | ||
|
|
48b0b2fc46 | ||
|
|
4f29eedfe9 | ||
|
|
66372e2b2e | ||
|
|
2bae1ad116 | ||
|
|
bbdc643b6d | ||
|
|
a66fcde0ee | ||
|
|
7835486a4d | ||
|
|
90367aea0d | ||
|
|
16c638756c | ||
|
|
b08a97d883 | ||
|
|
746dbfe018 | ||
|
|
733f2b3cdd | ||
|
|
ad64cb5212 | ||
|
|
b1a9e8d0df | ||
|
|
4f9838df3c | ||
|
|
f4ca2c02a7 | ||
|
|
e1391d4162 | ||
|
|
8d9c51f204 | ||
|
|
c10ba67973 | ||
|
|
55610694c8 | ||
|
|
8764d94fd9 | ||
|
|
5228768841 | ||
|
|
9c68bea16c | ||
|
|
5484740cab | ||
|
|
421324b498 | ||
|
|
37e065fa2d | ||
|
|
b758e3fc55 | ||
|
|
393596ef9a | ||
|
|
02d4c97c6d | ||
|
|
2c5ef434f0 | ||
|
|
122f3e4403 | ||
|
|
ea3ebbaa7d | ||
|
|
1636668762 | ||
|
|
c6b9a0c4bf | ||
|
|
93a218abeb | ||
|
|
d7a06057eb | ||
|
|
8cb77ac136 | ||
|
|
4059dc6187 | ||
|
|
15773e4755 | ||
|
|
4f455dacf4 | ||
|
|
0b22af1206 | ||
|
|
ae2fa2fa60 | ||
|
|
6abd756e0c | ||
|
|
535e49a38d | ||
|
|
fbb5730369 | ||
|
|
e5d62025d3 | ||
|
|
89c6fc6437 | ||
|
|
799c158b86 | ||
|
|
8d16d2152b | ||
|
|
635ae4e3da | ||
|
|
59140d8dfa | ||
|
|
2cb8aadafc | ||
|
|
aa0826bb70 | ||
|
|
8bd2a9a23b | ||
|
|
2f959785e1 | ||
|
|
88a86a3363 | ||
|
|
0c7827104f | ||
|
|
c8ed190e5c | ||
|
|
f4dcd1db9b | ||
|
|
bd341d5c00 | ||
|
|
add18d868f | ||
|
|
609a302e16 | ||
|
|
e07011be32 | ||
|
|
bb223eb5ae | ||
|
|
73d904036d | ||
|
|
542833866e | ||
|
|
89c484414b | ||
|
|
fe2dd671fb | ||
|
|
8abee1bdaa | ||
|
|
78a730ddf6 | ||
|
|
a750e55f75 | ||
|
|
c62c4846fc | ||
|
|
8db5b01507 | ||
|
|
a6e405c988 | ||
|
|
6613fda4b1 | ||
|
|
a18a6e87df | ||
|
|
93d83c5bb9 | ||
|
|
6ee8720028 | ||
|
|
600d68bd1a | ||
|
|
0c3a294cbe | ||
|
|
25218795b4 | ||
|
|
a65ec67128 | ||
|
|
5d753f2384 | ||
|
|
1f2de35f94 | ||
|
|
5c140b4f35 | ||
|
|
362ee3cdb0 | ||
|
|
215f1bc8ee | ||
|
|
4d72c2b37a | ||
|
|
dc4dbe29ae | ||
|
|
72dd25a99e | ||
|
|
39d041466d | ||
|
|
442ebff829 | ||
|
|
7e169bc7df | ||
|
|
00f4e5158f | ||
|
|
0c688189f6 | ||
|
|
7cee36544c | ||
|
|
f9c1d5fc1b | ||
|
|
d95e20952c | ||
|
|
32a90334bb | ||
|
|
f534d3498e | ||
|
|
3ea9f444db | ||
|
|
5672c935ed | ||
|
|
4cc2b5c38a | ||
|
|
00e3d874e3 | ||
|
|
803e91a8c4 | ||
|
|
227a1d938d | ||
|
|
fc7f06dc78 | ||
|
|
6777dd9b38 | ||
|
|
4db212ea7b | ||
|
|
8177a27db9 | ||
|
|
27ff119ba6 | ||
|
|
c20774ff5d | ||
|
|
a9f5b7728b | ||
|
|
08ad48fbf3 | ||
|
|
2d0c881ffe | ||
|
|
c916a7db88 | ||
|
|
a5da286351 | ||
|
|
20a48c3a26 | ||
|
|
5bba0f47ff | ||
|
|
bfc987abcd | ||
|
|
85bf7c86e0 | ||
|
|
2225b86eea | ||
|
|
d09be18359 | ||
|
|
09ab3efddd | ||
|
|
382a0192f9 | ||
|
|
e3b968fa80 | ||
|
|
6f85b11fcc | ||
|
|
e561919a52 | ||
|
|
b0a66a63ba | ||
|
|
0d840e199d | ||
|
|
3a2bceef8d | ||
|
|
e871a754a8 | ||
|
|
6333327b81 | ||
|
|
18ca8aaf5b | ||
|
|
67c0f4527e | ||
|
|
e5c5101e8a | ||
|
|
934ff7bbde | ||
|
|
014f08f6b4 | ||
|
|
6ba2090c01 | ||
|
|
61fcf5e0f4 | ||
|
|
9217e4c5f9 | ||
|
|
3ccbb34c62 | ||
|
|
9baa4a17ed | ||
|
|
6bbece39bc | ||
|
|
729447eab0 | ||
|
|
1e7f41ea9f | ||
|
|
d0d4888184 | ||
|
|
804e5d49bb | ||
|
|
6d1d226842 | ||
|
|
06416aeded | ||
|
|
4fbae9e5a4 | ||
|
|
c87be7cd69 | ||
|
|
e62754ed56 | ||
|
|
53d7281e66 | ||
|
|
731a2c11a4 | ||
|
|
ec4d078d6d | ||
|
|
f9b48f06a3 | ||
|
|
d986ffa153 | ||
|
|
2357bc70a7 | ||
|
|
e86e1588e3 | ||
|
|
4be88c7180 | ||
|
|
8e8daa64ba | ||
|
|
1671c04e24 | ||
|
|
d3d6c552b7 | ||
|
|
8d9336f561 | ||
|
|
169ec9c12e | ||
|
|
60b831f369 | ||
|
|
4191dcee75 | ||
|
|
44725c8910 | ||
|
|
cead8a36ea | ||
|
|
7b6050a0cb | ||
|
|
491383c637 | ||
|
|
d7a3645f7f | ||
|
|
241b8f4627 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
config_templates/hbl_html/accessible-urls/accessible-urls.txt text eol=lf
|
||||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: ReSwitched Discord
|
||||||
|
url: https://discordapp.com/invite/DThbZ7z
|
||||||
|
about: Please ask questions here, instead of making GitHub issues.
|
||||||
7
.github/ISSUE_TEMPLATE/question.md
vendored
7
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
name: Question
|
|
||||||
about: Please ask questions in the ReSwitched discord, instead of making issues.
|
|
||||||
---
|
|
||||||
We would like to use GitHub to keep track of problems/feature requests.
|
|
||||||
If you have a question, please join the ReSwitched discord for help.
|
|
||||||
- Discord link: https://discordapp.com/invite/DThbZ7z
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -64,6 +64,7 @@ dkms.conf
|
|||||||
# Distribution files
|
# Distribution files
|
||||||
*.tgz
|
*.tgz
|
||||||
*.zip
|
*.zip
|
||||||
|
*.bz2
|
||||||
|
|
||||||
# IDA binaries
|
# IDA binaries
|
||||||
*.id0
|
*.id0
|
||||||
|
|||||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,6 +0,0 @@
|
|||||||
[submodule "common/include/boost"]
|
|
||||||
path = common/include/boost
|
|
||||||
url = https://github.com/Atmosphere-NX/ext-boost.git
|
|
||||||
[submodule "stratosphere/libstratosphere"]
|
|
||||||
path = stratosphere/libstratosphere
|
|
||||||
url = https://github.com/Atmosphere-NX/libstratosphere.git
|
|
||||||
|
|||||||
110
Makefile
110
Makefile
@@ -1,4 +1,4 @@
|
|||||||
TOPTARGETS := all clean dist
|
TOPTARGETS := all clean dist-no-debug dist
|
||||||
AMSBRANCH := $(shell git symbolic-ref --short HEAD)
|
AMSBRANCH := $(shell git symbolic-ref --short HEAD)
|
||||||
AMSHASH := $(shell git rev-parse --short HEAD)
|
AMSHASH := $(shell git rev-parse --short HEAD)
|
||||||
AMSREV := $(AMSBRANCH)-$(AMSHASH)
|
AMSREV := $(AMSBRANCH)-$(AMSHASH)
|
||||||
@@ -7,7 +7,7 @@ ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
|
|||||||
AMSREV := $(AMSREV)-dirty
|
AMSREV := $(AMSREV)-dirty
|
||||||
endif
|
endif
|
||||||
|
|
||||||
COMPONENTS := fusee stratosphere exosphere thermosphere troposphere
|
COMPONENTS := fusee stratosphere mesosphere exosphere thermosphere troposphere libraries
|
||||||
|
|
||||||
all: $(COMPONENTS)
|
all: $(COMPONENTS)
|
||||||
|
|
||||||
@@ -17,30 +17,36 @@ thermosphere:
|
|||||||
exosphere: thermosphere
|
exosphere: thermosphere
|
||||||
$(MAKE) -C exosphere all
|
$(MAKE) -C exosphere all
|
||||||
|
|
||||||
stratosphere: exosphere
|
stratosphere: exosphere libraries
|
||||||
$(MAKE) -C stratosphere all
|
$(MAKE) -C stratosphere all
|
||||||
|
|
||||||
|
mesosphere: exosphere libraries
|
||||||
|
$(MAKE) -C mesosphere all
|
||||||
|
|
||||||
troposphere: stratosphere
|
troposphere: stratosphere
|
||||||
$(MAKE) -C troposphere all
|
$(MAKE) -C troposphere all
|
||||||
|
|
||||||
sept: exosphere
|
sept: exosphere
|
||||||
$(MAKE) -C sept all
|
$(MAKE) -C sept all
|
||||||
|
|
||||||
fusee: exosphere stratosphere sept
|
fusee: exosphere mesosphere stratosphere sept
|
||||||
$(MAKE) -C $@ all
|
$(MAKE) -C $@ all
|
||||||
|
|
||||||
|
libraries:
|
||||||
|
$(MAKE) -C libraries all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C fusee clean
|
$(MAKE) -C fusee clean
|
||||||
rm -rf out
|
rm -rf out
|
||||||
|
|
||||||
dist: all
|
dist-no-debug: all
|
||||||
$(eval MAJORVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MAJOR\b' common/include/atmosphere/version.h \
|
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||||
| tr -s [:blank:] \
|
| tr -s [:blank:] \
|
||||||
| cut -d' ' -f3))
|
| cut -d' ' -f3))
|
||||||
$(eval MINORVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MINOR\b' common/include/atmosphere/version.h \
|
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||||
| tr -s [:blank:] \
|
| tr -s [:blank:] \
|
||||||
| cut -d' ' -f3))
|
| cut -d' ' -f3))
|
||||||
$(eval MICROVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MICRO\b' common/include/atmosphere/version.h \
|
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||||
| tr -s [:blank:] \
|
| tr -s [:blank:] \
|
||||||
| cut -d' ' -f3))
|
| cut -d' ' -f3))
|
||||||
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
|
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
|
||||||
@@ -50,33 +56,42 @@ dist: all
|
|||||||
mkdir atmosphere-$(AMSVER)/atmosphere
|
mkdir atmosphere-$(AMSVER)/atmosphere
|
||||||
mkdir atmosphere-$(AMSVER)/sept
|
mkdir atmosphere-$(AMSVER)/sept
|
||||||
mkdir atmosphere-$(AMSVER)/switch
|
mkdir atmosphere-$(AMSVER)/switch
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/010000000000000D
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000008
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/0100000000000032
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/010000000000000D
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/0100000000000034
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/010000000000002B
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/0100000000000036
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/0100000000000037
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000034
|
||||||
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000036
|
||||||
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/fatal_errors
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/fatal_errors
|
||||||
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/config_templates
|
||||||
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/config
|
||||||
cp fusee/fusee-primary/fusee-primary.bin atmosphere-$(AMSVER)/atmosphere/reboot_payload.bin
|
cp fusee/fusee-primary/fusee-primary.bin atmosphere-$(AMSVER)/atmosphere/reboot_payload.bin
|
||||||
|
cp fusee/fusee-mtc/fusee-mtc.bin atmosphere-$(AMSVER)/atmosphere/fusee-mtc.bin
|
||||||
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin
|
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin
|
||||||
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/sept/payload.bin
|
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/sept/payload.bin
|
||||||
cp sept/sept-primary/sept-primary.bin atmosphere-$(AMSVER)/sept/sept-primary.bin
|
cp sept/sept-primary/sept-primary.bin atmosphere-$(AMSVER)/sept/sept-primary.bin
|
||||||
cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin
|
cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin
|
||||||
cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_00.enc
|
cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_00.enc
|
||||||
cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc
|
cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc
|
||||||
cp common/defaults/BCT.ini atmosphere-$(AMSVER)/atmosphere/BCT.ini
|
cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_00.enc
|
||||||
cp common/defaults/loader.ini atmosphere-$(AMSVER)/atmosphere/loader.ini
|
cp sept/sept-secondary/sept-secondary_dev_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_01.enc
|
||||||
cp common/defaults/system_settings.ini atmosphere-$(AMSVER)/atmosphere/system_settings.ini
|
cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config/BCT.ini
|
||||||
cp -r common/defaults/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
|
cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini
|
||||||
cp -r common/defaults/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html
|
cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
|
||||||
cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/atmosphere/titles/010000000000000D/exefs.nsp
|
cp -r config_templates/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
|
||||||
cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/atmosphere/titles/0100000000000032/exefs.nsp
|
cp -r config_templates/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html
|
||||||
cp stratosphere/fatal/fatal.nsp atmosphere-$(AMSVER)/atmosphere/titles/0100000000000034/exefs.nsp
|
cp stratosphere/boot2/boot2.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000008/exefs.nsp
|
||||||
cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/atmosphere/titles/0100000000000036/exefs.nsp
|
cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/atmosphere/contents/010000000000000D/exefs.nsp
|
||||||
cp stratosphere/ro/ro.nsp atmosphere-$(AMSVER)/atmosphere/titles/0100000000000037/exefs.nsp
|
cp stratosphere/erpt/erpt.nsp atmosphere-$(AMSVER)/atmosphere/contents/010000000000002B/exefs.nsp
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/0100000000000032/flags
|
cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/exefs.nsp
|
||||||
touch atmosphere-$(AMSVER)/atmosphere/titles/0100000000000032/flags/boot2.flag
|
cp stratosphere/fatal/fatal.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000034/exefs.nsp
|
||||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/0100000000000037/flags
|
cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000036/exefs.nsp
|
||||||
touch atmosphere-$(AMSVER)/atmosphere/titles/0100000000000037/flags/boot2.flag
|
cp stratosphere/ro/ro.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/exefs.nsp
|
||||||
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/flags
|
||||||
|
touch atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/flags/boot2.flag
|
||||||
|
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/flags
|
||||||
|
touch atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/flags/boot2.flag
|
||||||
cp troposphere/reboot_to_payload/reboot_to_payload.nro atmosphere-$(AMSVER)/switch/reboot_to_payload.nro
|
cp troposphere/reboot_to_payload/reboot_to_payload.nro atmosphere-$(AMSVER)/switch/reboot_to_payload.nro
|
||||||
cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER).zip ./*; cd ../;
|
cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER).zip ./*; cd ../;
|
||||||
rm -r atmosphere-$(AMSVER)
|
rm -r atmosphere-$(AMSVER)
|
||||||
@@ -84,5 +99,46 @@ dist: all
|
|||||||
mv atmosphere-$(AMSVER).zip out/atmosphere-$(AMSVER).zip
|
mv atmosphere-$(AMSVER).zip out/atmosphere-$(AMSVER).zip
|
||||||
cp fusee/fusee-primary/fusee-primary.bin out/fusee-primary.bin
|
cp fusee/fusee-primary/fusee-primary.bin out/fusee-primary.bin
|
||||||
|
|
||||||
|
dist: dist-no-debug
|
||||||
|
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||||
|
| tr -s [:blank:] \
|
||||||
|
| cut -d' ' -f3))
|
||||||
|
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||||
|
| tr -s [:blank:] \
|
||||||
|
| cut -d' ' -f3))
|
||||||
|
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||||
|
| tr -s [:blank:] \
|
||||||
|
| cut -d' ' -f3))
|
||||||
|
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
|
||||||
|
rm -rf atmosphere-$(AMSVER)-debug
|
||||||
|
mkdir atmosphere-$(AMSVER)-debug
|
||||||
|
cp fusee/fusee-primary/fusee-primary.elf atmosphere-$(AMSVER)-debug/fusee-primary.elf
|
||||||
|
cp fusee/fusee-mtc/fusee-mtc.elf atmosphere-$(AMSVER)-debug/fusee-mtc.elf
|
||||||
|
cp fusee/fusee-secondary/fusee-secondary.elf atmosphere-$(AMSVER)-debug/fusee-secondary.elf
|
||||||
|
cp sept/sept-primary/sept-primary.elf atmosphere-$(AMSVER)-debug/sept-primary.elf
|
||||||
|
cp sept/sept-secondary/sept-secondary.elf atmosphere-$(AMSVER)-debug/sept-secondary.elf
|
||||||
|
cp sept/sept-secondary/key_derivation/key_derivation.elf atmosphere-$(AMSVER)-debug/sept-secondary-key-derivation.elf
|
||||||
|
cp exosphere/exosphere.elf atmosphere-$(AMSVER)-debug/exosphere.elf
|
||||||
|
cp exosphere/lp0fw/lp0fw.elf atmosphere-$(AMSVER)-debug/lp0fw.elf
|
||||||
|
cp exosphere/sc7fw/sc7fw.elf atmosphere-$(AMSVER)-debug/sc7fw.elf
|
||||||
|
cp exosphere/rebootstub/rebootstub.elf atmosphere-$(AMSVER)-debug/rebootstub.elf
|
||||||
|
cp mesosphere/kernel_ldr/kernel_ldr.elf atmosphere-$(AMSVER)-debug/kernel_ldr.elf
|
||||||
|
cp stratosphere/ams_mitm/ams_mitm.elf atmosphere-$(AMSVER)-debug/ams_mitm.elf
|
||||||
|
cp stratosphere/boot/boot.elf atmosphere-$(AMSVER)-debug/boot.elf
|
||||||
|
cp stratosphere/boot2/boot2.elf atmosphere-$(AMSVER)-debug/boot2.elf
|
||||||
|
cp stratosphere/creport/creport.elf atmosphere-$(AMSVER)-debug/creport.elf
|
||||||
|
cp stratosphere/dmnt/dmnt.elf atmosphere-$(AMSVER)-debug/dmnt.elf
|
||||||
|
cp stratosphere/eclct.stub/eclct.stub.elf atmosphere-$(AMSVER)-debug/eclct.stub.elf
|
||||||
|
cp stratosphere/fatal/fatal.elf atmosphere-$(AMSVER)-debug/fatal.elf
|
||||||
|
cp stratosphere/loader/loader.elf atmosphere-$(AMSVER)-debug/loader.elf
|
||||||
|
cp stratosphere/pm/pm.elf atmosphere-$(AMSVER)-debug/pm.elf
|
||||||
|
cp stratosphere/ro/ro.elf atmosphere-$(AMSVER)-debug/ro.elf
|
||||||
|
cp stratosphere/sm/sm.elf atmosphere-$(AMSVER)-debug/sm.elf
|
||||||
|
cp stratosphere/spl/spl.elf atmosphere-$(AMSVER)-debug/spl.elf
|
||||||
|
cp stratosphere/erpt/erpt.elf atmosphere-$(AMSVER)-debug/erpt.elf
|
||||||
|
cd atmosphere-$(AMSVER)-debug; zip -r ../atmosphere-$(AMSVER)-debug.zip ./*; cd ../;
|
||||||
|
rm -r atmosphere-$(AMSVER)-debug
|
||||||
|
mv atmosphere-$(AMSVER)-debug.zip out/atmosphere-$(AMSVER)-debug.zip
|
||||||
|
|
||||||
|
|
||||||
.PHONY: $(TOPTARGETS) $(COMPONENTS)
|
.PHONY: $(TOPTARGETS) $(COMPONENTS)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ You can find a copy of the license in the [LICENSE file](LICENSE).
|
|||||||
|
|
||||||
Exemptions:
|
Exemptions:
|
||||||
* The [yuzu emulator project](https://github.com/yuzu-emu/yuzu) is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the Atmosphère project as GPLv2 or later.
|
* The [yuzu emulator project](https://github.com/yuzu-emu/yuzu) is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the Atmosphère project as GPLv2 or later.
|
||||||
|
* [Nintendo](https://github.com/Nintendo) is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the Atmosphère project under the Zero-Clause BSD license.
|
||||||
|
|
||||||
Credits
|
Credits
|
||||||
=====
|
=====
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
[hbl_config]
|
|
||||||
title_id=010000000000100D
|
|
||||||
override_any_app=true
|
|
||||||
path=atmosphere/hbl.nsp
|
|
||||||
override_key=R
|
|
||||||
|
|
||||||
[default_config]
|
|
||||||
override_key=!L
|
|
||||||
cheat_enable_key=!L
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
; Disable uploading error reports to Nintendo
|
|
||||||
[eupld]
|
|
||||||
upload_enabled = u8!0x0
|
|
||||||
; Enable USB 3.0 superspeed for homebrew
|
|
||||||
[usb]
|
|
||||||
usb30_force_enabled = u8!0x0
|
|
||||||
; Control whether RO should ease its validation of NROs.
|
|
||||||
; (note: this is normally not necessary, and ips patches can be used.)
|
|
||||||
[ro]
|
|
||||||
ease_nro_restriction = u8!0x0
|
|
||||||
; Atmosphere custom settings
|
|
||||||
[atmosphere]
|
|
||||||
; Reboot from fatal automatically after some number of milliseconds.
|
|
||||||
; If field is not present or 0, fatal will wait indefinitely for user input.
|
|
||||||
fatal_auto_reboot_interval = u64!0x0
|
|
||||||
; Make the power menu's "reboot" button reboot to payload.
|
|
||||||
; Set to "normal" for normal reboot, "rcm" for rcm reboot.
|
|
||||||
power_menu_reboot_function = str!payload
|
|
||||||
; Controls whether dmnt cheats should be toggled on or off by
|
|
||||||
; default. 1 = toggled on by default, 0 = toggled off by default.
|
|
||||||
dmnt_cheats_enabled_by_default = u8!0x1
|
|
||||||
; Controls whether dmnt should always save cheat toggle state
|
|
||||||
; for restoration on new game launch. 1 = always save toggles,
|
|
||||||
; 0 = only save toggles if toggle file exists.
|
|
||||||
dmnt_always_save_cheat_toggles = u8!0x0
|
|
||||||
; Controls whether fs.mitm should redirect save files
|
|
||||||
; to directories on the sd card.
|
|
||||||
; 0 = Do not redirect, 1 = Redirect.
|
|
||||||
; NOTE: EXPERIMENTAL
|
|
||||||
; If you do not know what you are doing, do not touch this yet.
|
|
||||||
fsmitm_redirect_saves_to_sd = u8!0x0
|
|
||||||
Submodule common/include/boost deleted from fc6429e463
@@ -1,17 +1,22 @@
|
|||||||
BCT0
|
BCT0
|
||||||
[stage1]
|
[stage1]
|
||||||
stage2_path = atmosphere/fusee-secondary.bin
|
stage2_path = atmosphere/fusee-secondary.bin
|
||||||
|
stage2_mtc_path = atmosphere/fusee-mtc.bin
|
||||||
stage2_addr = 0xF0000000
|
stage2_addr = 0xF0000000
|
||||||
stage2_entrypoint = 0xF0000000
|
stage2_entrypoint = 0xF0000000
|
||||||
|
|
||||||
[exosphere]
|
[exosphere]
|
||||||
; Note: Disabling debugmode will cause parts of ams.tma to not work, in the future.
|
; Note: Disabling debugmode will cause parts of ams.tma to not work, in the future.
|
||||||
debugmode = 1
|
debugmode = 1
|
||||||
debugmode_user = 0
|
debugmode_user = 0
|
||||||
; Note: Disabling usermode exception handlers will cause atmosphere to not fail gracefully under error conditions.
|
; Note: Disabling usermode exception handlers will cause atmosphere to not fail gracefully under error conditions.
|
||||||
; Support will not be provided to users who disable these. If you do not know what you are doing, leave them on.
|
; Support will not be provided to users who disable these. If you do not know what you are doing, leave them on.
|
||||||
disable_user_exception_handlers = 0
|
disable_user_exception_handlers = 0
|
||||||
|
; Note: It's currently unknown what effects enabling the usermode PMU register access may have on official code.
|
||||||
|
enable_user_pmu_access = 0
|
||||||
|
|
||||||
[stratosphere]
|
[stratosphere]
|
||||||
; To force-enable nogc, add nogc = 1
|
; To force-enable nogc, add nogc = 1
|
||||||
; To force-disable nogc, add nogc = 0
|
; To force-disable nogc, add nogc = 0
|
||||||
|
|
||||||
|
; To opt in to using Atmosphere's NCM reimplementation, add enable_ncm = 1
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19
config_templates/override_config.ini
Normal file
19
config_templates/override_config.ini
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[hbl_config]
|
||||||
|
; Program Specific Config
|
||||||
|
; Up to 8 program-specific configurations can be set.
|
||||||
|
; These use `program_id_#` and `override_key_#`
|
||||||
|
; where # is in range [0,7].
|
||||||
|
; program_id_0=010000000000100D
|
||||||
|
; override_key_0=!R
|
||||||
|
|
||||||
|
; Any Application Config
|
||||||
|
; Note that this will only apply to program IDs that
|
||||||
|
; are both applications and not specified above
|
||||||
|
; by a program specific config.
|
||||||
|
; override_any_app=true
|
||||||
|
; override_any_app_key=R
|
||||||
|
; path=atmosphere/hbl.nsp
|
||||||
|
|
||||||
|
[default_config]
|
||||||
|
; override_key=!L
|
||||||
|
; cheat_enable_key=!L
|
||||||
49
config_templates/system_settings.ini
Normal file
49
config_templates/system_settings.ini
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
; Disable uploading error reports to Nintendo
|
||||||
|
[eupld]
|
||||||
|
; upload_enabled = u8!0x0
|
||||||
|
; Control whether RO should ease its validation of NROs.
|
||||||
|
; (note: this is normally not necessary, and ips patches can be used.)
|
||||||
|
[ro]
|
||||||
|
; ease_nro_restriction = u8!0x0
|
||||||
|
; Atmosphere custom settings
|
||||||
|
[atmosphere]
|
||||||
|
; Reboot from fatal automatically after some number of milliseconds.
|
||||||
|
; If field is not present or 0, fatal will wait indefinitely for user input.
|
||||||
|
; fatal_auto_reboot_interval = u64!0x0
|
||||||
|
; Make the power menu's "reboot" button reboot to payload.
|
||||||
|
; Set to "normal" for normal reboot, "rcm" for rcm reboot.
|
||||||
|
; power_menu_reboot_function = str!payload
|
||||||
|
; Controls whether dmnt cheats should be toggled on or off by
|
||||||
|
; default. 1 = toggled on by default, 0 = toggled off by default.
|
||||||
|
; dmnt_cheats_enabled_by_default = u8!0x1
|
||||||
|
; Controls whether dmnt should always save cheat toggle state
|
||||||
|
; for restoration on new game launch. 1 = always save toggles,
|
||||||
|
; 0 = only save toggles if toggle file exists.
|
||||||
|
; dmnt_always_save_cheat_toggles = u8!0x0
|
||||||
|
; Enable writing to BIS partitions for HBL.
|
||||||
|
; This is probably undesirable for normal usage.
|
||||||
|
; enable_hbl_bis_write = u8!0x0
|
||||||
|
; Enable reading the CAL0 partition for HBL.
|
||||||
|
; This is probably undesirable for normal usage.
|
||||||
|
; enable_hbl_cal_read = u8!0x0
|
||||||
|
; Controls whether fs.mitm should redirect save files
|
||||||
|
; to directories on the sd card.
|
||||||
|
; 0 = Do not redirect, 1 = Redirect.
|
||||||
|
; NOTE: EXPERIMENTAL
|
||||||
|
; If you do not know what you are doing, do not touch this yet.
|
||||||
|
; fsmitm_redirect_saves_to_sd = u8!0x0
|
||||||
|
; Controls whether to enable the deprecated hid mitm
|
||||||
|
; to fix compatibility with old homebrew.
|
||||||
|
; 0 = Do not enable, 1 = Enable.
|
||||||
|
; Please note this setting may be removed in a
|
||||||
|
; future release of Atmosphere.
|
||||||
|
; enable_deprecated_hid_mitm = u8!0x0
|
||||||
|
[hbloader]
|
||||||
|
; Controls the size of the homebrew heap when running as applet.
|
||||||
|
; If set to zero, all available applet memory is used as heap.
|
||||||
|
; The default is zero.
|
||||||
|
; applet_heap_size = u64!0x0
|
||||||
|
; Controls the amount of memory to reserve when running as applet
|
||||||
|
; for usage by other applets. This setting has no effect if
|
||||||
|
; applet_heap_size is non-zero. The default is 0x8600000.
|
||||||
|
; applet_heap_reservation_size = u64!0x8600000
|
||||||
@@ -1,4 +1,273 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
## 0.11.1
|
||||||
|
+ A bug was fixed that could cause owls to flicker under certain circumstances.
|
||||||
|
+ For those interested in technical details, in 10.0.0 kernelldr/kernel no longer set cpuactlr_el1, assuming that it was set correctly by the secure monitor.
|
||||||
|
+ However, exosphere did not set cpuactlr_el1. This meant that the register held the reset value going into boot.
|
||||||
|
+ This caused a variety of highly erratic symptoms, including causing basically any game to crash seemingly randomly.
|
||||||
|
+ A number of other major inaccuracies in exosphere were corrected.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.11.0
|
||||||
|
+ Support was added for 10.0.0.
|
||||||
|
+ Exosphere has been updated to reflect the new key import semantics in 10.0.0.
|
||||||
|
+ kernel_ldr now implements physical ASLR for the kernel's backing pages.
|
||||||
|
+ Loader, NCM, and PM have been updated to reflect the changes Nintendo made in 10.0.0.
|
||||||
|
+ Creport was updated to use the new `pgl` service to terminate processes instead of `ns:dev`.
|
||||||
|
+ A reimplementation of the `erpt` (error reports) system module was added.
|
||||||
|
+ In previous versions of Atmosphere, a majority of error reports were prevented via a combination of custom creport, fatal, and stubbed eclct.
|
||||||
|
+ However, error reports were still generated via some system actions.
|
||||||
|
+ Most notably, any time the error applet appeared, an error report was generated.
|
||||||
|
+ By default, atmosphere disabled the *uploading* of error reports, but going online in OFW after an error report occurred in Atmosphere could lead to undesirable telemetry.
|
||||||
|
+ Atmosphere's `erpt` reimplementation allows the system to interact with existing error reports as expected.
|
||||||
|
+ However, all new error reports are instead saved to the sd card (`/atmosphere/erpt_reports`), and are not committed to the system savegame.
|
||||||
|
+ Users curious about what kind of telemetry is being prevented can view the reports as they're generated in there.
|
||||||
|
+ Reports are saved as msgpack (as this is what Nintendo uses).
|
||||||
|
+ Please note, not all telemetry is disabled. Play reports and System reports will continue to function unmodified.
|
||||||
|
+ With atmosphere's `erpt` implementation, homebrew can now use the native error applet to display errors without worrying about generating undesirable telemetry.
|
||||||
|
+ libstratosphere and libvapours received a number of improvements.
|
||||||
|
+ With thanks to @Adubbz for his work, the NCM namespace now has client code.
|
||||||
|
+ This lays the groundwork for first-class system update/downgrade homebrew support in the near future.
|
||||||
|
+ In particular, code implementing the os namespace is significantly more accurate.
|
||||||
|
+ In addition, Nintendo's allocators were implemented, allowing for identical memory efficiency versus Nintendo's implementations.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.10.5
|
||||||
|
+ Changes were made to the way fs.mitm builds images when providing a layeredfs romfs.
|
||||||
|
+ Building romfs metadata previously had a memory cost of about ~4-5x the file table size.
|
||||||
|
+ This caused games that have particularly enormous file metadata tables (> 4 MB) to exhaust fs.mitm's 16 MB memory pool.
|
||||||
|
+ The code that creates romfs images was thus changed to be significantly more memory efficient, again.
|
||||||
|
+ Memory requirements have been lowered from ~4x file table size to ~2x file table size + 0.5 MB.
|
||||||
|
+ There is a slight speed penalty to this, but testing on Football Manager 2020 only took an extra ~1.5 seconds for the game to boot with many modded files.
|
||||||
|
+ This shouldn't be noticeable thanks to the async changes made in 0.10.2.
|
||||||
|
+ If you encounter a game that exhausts ams.mitm's memory (crashing it) when loading layeredfs mods, please contact SciresM.
|
||||||
|
+ Romfs building can be made even more memory efficient, but unless games show up with even more absurdly huge file tables it seems not worth the speed trade-off.
|
||||||
|
+ A bug was fixed that caused Atmosphere's fatal error context to not dump TLS for certain processes.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.10.4
|
||||||
|
+ With major thanks to @Adubbz for his work, the NCM system module has now been re-implemented.
|
||||||
|
+ This was a major stepping stone towards the goal of having implementations everything in the Switch's package1/package2 firmware.
|
||||||
|
+ This also lays the groundwork for libstratosphere providing bindings for changing the installed version of the Switch's OS.
|
||||||
|
+ **Please Note**: The NCM implementation will initially be opt-in.
|
||||||
|
+ The Atmosphere team is confident in our NCM implementation (and we have tested it on every firmware version).
|
||||||
|
+ That said, this is our first system module that manages NAND savegames -- and caution is a habit.
|
||||||
|
+ We do not anticipate any issues that didn't come up in testing, so this is just our being particularly careful.
|
||||||
|
+ Users interested in opting in to using our implementation should set `stratosphere!ncm_enabled = 1` in BCT.ini.
|
||||||
|
+ In the unlikely event that any issues are encountered, please report them to @SciresM.
|
||||||
|
+ The NCM implementation will stop being opt-in in a future update, after thorough testing has been done in practice.
|
||||||
|
+ A bug was fixed in emummc that caused Nintendo path to be corrupted on 1.0.0.
|
||||||
|
+ This manifested as the emummc folder being created inside the virtual NAND instead of the SD card.
|
||||||
|
+ It's unlikely there are any negative consequences to this in practice.
|
||||||
|
+ If you want to be truly sure, you can re-clone sysmmc before updating a 1.0.0 emummc to latest firmware.
|
||||||
|
+ Stratosphere system modules now use new Nintendo-style FS bindings instead of stdio.
|
||||||
|
+ This saves a modest amount of memory due to leaner code, and greatly increases the accuracy of several components.
|
||||||
|
+ These bindings will make it easier for other system modules using libstratosphere to interact with the filesystem.
|
||||||
|
+ This also lays the groundwork for changes necessary to support per-emummc Atmosphere folders in a future update.
|
||||||
|
+ Atmosphere's fatal error context now dumps 0x100 of TLS.
|
||||||
|
+ This will make it much easier to fix bugs when an error report is dumped for whatever caused the crash.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.10.3
|
||||||
|
+ Support was added for 9.2.0.
|
||||||
|
+ Support was added for redirecting manual html content for games.
|
||||||
|
+ This works like normal layeredfs, replacing content placed in `/atmosphere/contents/<program id>/manual_html/`.
|
||||||
|
+ This allows for game mods/translations to provide custom manual content, if they so choose.
|
||||||
|
+ A number of improvements were made to Atmosphere's memory usage, including:
|
||||||
|
+ `fatal` now uses STB instead of freetype for rendering.
|
||||||
|
+ This saves around 1 MB of memory, and makes our fatal substantially leaner than Nintendo's.
|
||||||
|
+ `sm` no longer wastes 2 MiB unnecessarily.
|
||||||
|
+ fusee/sept's sdmmc access now better matches official behavior.
|
||||||
|
+ This improves compatibility with some SD cards.
|
||||||
|
+ `ro` has been updated to reflect changes made in 9.1.0.
|
||||||
|
+ The temporary auto-migration added in 0.10.0 has been removed, since the transitionary period is well over.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.10.2
|
||||||
|
+ hbl configuration was made more flexible.
|
||||||
|
+ Up to eight specific program ids can now be specified to have their own override keys.
|
||||||
|
+ This allows designating both the album applet and a specific game as hbl by default as desired.
|
||||||
|
+ Configuration targeting a specific program is now mutually exclusive with override-any-app for that program.
|
||||||
|
+ This fixes unintuitive behavior when override key differed for an application specific program.
|
||||||
|
+ Loader's external content fileystem support was fixed (thanks @misson20000!).
|
||||||
|
+ KernelLdr was reimplemented.
|
||||||
|
+ This is the first step towards developing mesosphere, Atmosphere's planned reimplementation of the Switch's Kernel.
|
||||||
|
+ The typical user won't notice anything different, as there are no extensions, but a lot of groundwork was laid for future development.
|
||||||
|
+ Improvements were made to the way Atmosphere's buildsystem detects source code files.
|
||||||
|
+ This significantly reduces compilation time (saving >30 seconds) on the machine that builds official releases.
|
||||||
|
+ Certain device code was cleaned up and made more correct in fusee/sept/exosphere (thanks @hexkyz!).
|
||||||
|
+ A number of changes were made to the way fs.mitm builds images when providing a layeredfs romfs.
|
||||||
|
+ Some games (Resident Evil 6, Football Manager 2020 Touch, possibly others) have enormous numbers of files.
|
||||||
|
+ Attempting to create a layeredfs mod for these games actually caused fs.mitm to run out of memory, causing a fatal error.
|
||||||
|
+ The code that creates these images was changed to be significantly more memory efficient.
|
||||||
|
+ However, these changes also cause a significant slowdown in the romfs building code (~2-5x).
|
||||||
|
+ This introduced a noticeable stutter when launching a game, because the UI thread would block on the romfs creation.
|
||||||
|
+ To solve this, fs.mitm now lazily initializes the image in a background thread.
|
||||||
|
+ This fixes stutter issues, however some games may be slightly slower (~1-2s in the worst cases) to transition from the "loading" GIF to gameplay now.
|
||||||
|
+ Please note: the slowdown is not noticeable in the common case where games don't have tons of files (typical is ~0.1-0.2 seconds).
|
||||||
|
+ Once the image has been built, there is no further speed penalty at runtime -- only when the game is launched.
|
||||||
|
+ A number of other bugs were fixed, including:
|
||||||
|
+ Several minor logic inversions that could have caused fatal errors when modding games.
|
||||||
|
+ Atmosphere's new-ipc code did not handle "automatic" recvlist buffers correctly, so some non-libnx homebrew could crash.
|
||||||
|
+ fs.mitm now correctly mitms sdb, which makes redirection of certain system data archives work again.
|
||||||
|
+ In 0.10.0/0.10.1, changing the system font/language did not work correctly due to this.
|
||||||
|
+ A bug was fixed in process cleanup that caused the system to hang on < 5.0.0.
|
||||||
|
+ The temporary hid-mitm added in Atmosphere 0.9.0 was disabled by default.
|
||||||
|
+ Please ensure your homebrew is updated.
|
||||||
|
+ For now, users may re-enable this mitm by use of a custom setting (`atmosphere!enable_deprecated_hid_mitm`) to ease the transition process some.
|
||||||
|
+ Please note: support for this setting may be removed to save memory in a future atmosphere release.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.10.1
|
||||||
|
+ A bug was fixed that caused memory reallocation to the system pool to work improperly on firmware 5.0.0 and above.
|
||||||
|
+ Atmosphere was always trying to deallocate memory away from the applet pool and towards the system pool.
|
||||||
|
+ The intent of this is to facilitate running more custom sysmodules/atmosphere binaries.
|
||||||
|
+ However, while memory was always successfully taken away from the applet pool, on 5.0.0+ granting it to the system pool did not work for technical reasons.
|
||||||
|
+ If you are interested in the technical details, talk to SciresM.
|
||||||
|
+ This has now been fixed by adding new kernel patches, and memory is correctly granted to the system pool as intended.
|
||||||
|
+ Atmosphere's library system has been overhauled:
|
||||||
|
+ libstratosphere's repository has been rebranded, more generally, to "Atmosphere-libs".
|
||||||
|
+ In addition to libstratosphere, a new general library for not-stratosphere-specific code has been added.
|
||||||
|
+ This is currently named `libvapours`.
|
||||||
|
+ In the future, kernel functionality will be available as `libmesosphere`.
|
||||||
|
+ The build system for stratosphere system modules has been similarly overhauled.
|
||||||
|
+ A number of other bugs were fixed, including:
|
||||||
|
+ A bug was fixed that could cause memory corruption when redirecting certain Romfs content.
|
||||||
|
+ A bug was fixed that could cause an infinite loop when redirecting certain Romfs content.
|
||||||
|
+ A bug was fixed that could cause certain NROs to fail to load.
|
||||||
|
+ This caused the latest version of Super Smash Bros to display "An error has occurred" on launch.
|
||||||
|
+ A bug was fixed that caused input/output array sizes for certain circumstances to be calculated incorrectly.
|
||||||
|
+ This caused cheats to fail to function properly.
|
||||||
|
+ C++ exception code is now more thoroughly removed from stratosphere executables.
|
||||||
|
+ This saves a minor amount of memory.
|
||||||
|
+ A number of minor logic inversions were fixed in libstratosphere.
|
||||||
|
+ These did not affect any code currently used by released Atmosphere binaries.
|
||||||
|
+ *Please note**: Because this update is releasing so soon after 0.10.0, the removal of the temporary hid-mitm has been postponed to 0.10.2.
|
||||||
|
+ Please ensure your homebrew is updated.
|
||||||
|
+ Random number generation now uses TinyMT instead of XorShift.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.10.0
|
||||||
|
+ Support was added for 9.1.0
|
||||||
|
+ **Please note**: The temporary hid-mitm added in Atmosphere 0.9.0 will be removed in Atmosphere 0.10.1.
|
||||||
|
+ Please ensure your homebrew is updated.
|
||||||
|
+ The Stratosphere rewrite was completed.
|
||||||
|
+ libstratosphere was rewritten as part of Stratosphere's refactor.
|
||||||
|
+ Code responsible for providing and managing IPC services was greatly improved.
|
||||||
|
+ The new code is significantly more accurate (it is bug-for-bug compatible with Nintendo's code), and significantly faster.
|
||||||
|
+ ams.mitm was rewritten as part of Stratosphere's refactor.
|
||||||
|
+ Saves redirected to the SD card are now separated for sysmmc vs emummc.
|
||||||
|
+ **Please note**: If you find any bugs, please report them so they can be fixed.
|
||||||
|
+ Thanks to the rewrite, Atmosphere now uses significantly less memory.
|
||||||
|
+ Roughly 10 additional megabytes are now available for custom system modules to use.
|
||||||
|
+ This means you can potentially run more custom system modules simultaneously.
|
||||||
|
+ If system modules are incompatible, please ask their authors to reduce their memory footprints.
|
||||||
|
+ Atmosphere's configuration layout has had major changes.
|
||||||
|
+ Configuration now lives inside /atmosphere/config/.
|
||||||
|
+ Atmosphere code now knows what default values should be, and includes them in code.
|
||||||
|
+ It is no longer an error if configuration inis are not present.
|
||||||
|
+ Correspondingly, Atmosphere no longer distributes default configuration inis.
|
||||||
|
+ Templates are provided in /atmosphere/config_templates.
|
||||||
|
+ loader.ini was renamed to override_config.ini.
|
||||||
|
+ This fixes the longstanding problem that atmosphere updates overwrote user configuration when extracted.
|
||||||
|
+ Atmosphere's process override layout was changed.
|
||||||
|
+ Atmosphere now uses the /atmosphere/contents directory, instead of /atmosphere/titles.
|
||||||
|
+ This goes along with a refactoring to remove all reference to "title id" from code, as Nintendo does not use the term.
|
||||||
|
+ To make this transition easier, a temporary functionality has been added that migrates folders to the new directory.
|
||||||
|
+ When booting into 0.10.0, Atmosphere will rename /atmosphere/titles/`<program id>` to /atmosphere/contents/`<program id>`.
|
||||||
|
+ This functionality may or may not be removed in some future update.
|
||||||
|
+ This should solve any transition difficulties for the typical user.
|
||||||
|
+ Please make sure that any future mods you install extract to the correct directory.
|
||||||
|
+ Support for configuring override keys for hbl was improved.
|
||||||
|
+ The key used to override applications versus a specific program can now be different.
|
||||||
|
+ The key to override a specific program can be managed via override_key.
|
||||||
|
+ The key to override any app can be managed via override_any_app_key.
|
||||||
|
+ Default override behavior was changed.
|
||||||
|
+ By default, atmosphere will now override the album applet with hbl unless R is held.
|
||||||
|
+ By default, atmosphere will now override any application with hbl only if R is held.
|
||||||
|
+ The default amount of applet memory reserved has been slightly increased.
|
||||||
|
+ This allows the profile selector applet to work by default in applet mode.
|
||||||
|
+ The way process override status is captured was changed.
|
||||||
|
+ Process override keys are now captured exactly once, when the process is created.
|
||||||
|
+ This fixes the longstanding issue where letting go of the override button partway into the process launch could cause problems.
|
||||||
|
+ The Mitm API was changed to pass around override status.
|
||||||
|
+ Mitm services now know what keys were held when the client was created, as well as whether the client is HBL/should override contents.
|
||||||
|
+ An extension was added to pm:info to allow querying a process's override status.
|
||||||
|
+ Thanks to process override capture improvements, hbl html behavior has been greatly improved.
|
||||||
|
+ Web applets launched by hbl will now always see the /atmosphere/hbl_html filesystem
|
||||||
|
+ Support was added to exosphere for enabling usermode access to the PMU registers.
|
||||||
|
+ This can be controlled via exosphere!enable_user_pmu_access in BCT.ini.
|
||||||
|
+ An enormous number of minor bugs were fixed.
|
||||||
|
+ dmnt's cheat VM had a fix for an inversion in opcode behavior.
|
||||||
|
+ An issue was fixed in fs.mitm's management of domain object IDs that could lead to system corruption in rare cases.
|
||||||
|
+ The Mitm API no longer silently fails when attempting to handle commands passing C descriptors.
|
||||||
|
+ On previous atmosphere versions, certain commands to FS would silently fail due to this...
|
||||||
|
+ No users reported any visible errors, but it was definitely a problem behind the scenes.
|
||||||
|
+ These commands are now handled correctly.
|
||||||
|
+ Atmosphere can now display a fatal error screen significantly earlier in the boot process, if things go wrong early on.
|
||||||
|
+ The temporary hid mitm will no longer sometimes cause games to fail to detect input.
|
||||||
|
+ Mitm Domain object ID management no longer desynchronizes from the host process.
|
||||||
|
+ An issue was fixed that could cause service acquisition to hang forever if certain sm commands were called in a precise order.
|
||||||
|
+ An off-by-one was fixed that could cause memory corruption in server memory management.
|
||||||
|
+ ... and too many more bugs fixed to reasonably list them all :)
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.9.4
|
||||||
|
+ Support was added for 9.0.0.
|
||||||
|
+ **Please note**: 9.0.0 made a number of changes that may cause some issues with homebrew. Details:
|
||||||
|
+ 9.0.0 changed HID in a way that causes libnx to be unable to detect button input.
|
||||||
|
+ Homebrew should be recompiled with newest libnx to fix this.
|
||||||
|
+ Atmosphere now provides a temporary hid-mitm that will cause homebrew to continue to work as expected.
|
||||||
|
+ This mitm will be removed in a future Atmosphere revision once homebrew has been updated, to allow users to use a custom hid mitm again if they desire.
|
||||||
|
+ 9.0.0 introduced an dependency in FS on the USB system module in order to launch the SD card.
|
||||||
|
+ This means the USB system module must now be launched before the SD card is initialized.
|
||||||
|
+ Correspondingly, the USB system module can no longer be IPS patched, and its settings cannot be reliably mitm'd.
|
||||||
|
+ We know this is frustrating, so we'll be looking into whether there is some way of addressing this in the future.
|
||||||
|
+ An off-by-one error was fixed in `boot` system module's pinmux initialization.
|
||||||
|
+ This could theoretically have caused issues with HdmiCec communication.
|
||||||
|
+ No users reported issues, so it's unclear if this was a problem in practice.
|
||||||
|
+ A bug was fixed that could cause webapplet launching homebrew to improperly set the accessible url whitelist.
|
||||||
|
+ BIS key generation has been fixed for newer hardware.
|
||||||
|
+ Newer hardware uses new, per-firmware device key to generate BIS keys instead of the first device key, so previously the wrong keys were generated as backup.
|
||||||
|
+ This only affects units manufactured after ~5.0.0.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.9.3
|
||||||
|
+ Thanks to hexkyz, fusee's boot sequence has been greatly optimized.
|
||||||
|
+ Memory training is now managed by a separate binary (`fusee-mtc`, loaded by fusee-primary before fusee-secondary).
|
||||||
|
+ Unnecessarily long splash screen display times were reduced.
|
||||||
|
+ The end result is that Atmosphere now boots *significantly* faster. :)
|
||||||
|
+ **Note:** This means fusee-primary must be updated for Atmosphere to boot successfully.
|
||||||
|
+ The version string was adjusted, and now informs users whether or not they are using emummc.
|
||||||
|
+ Atmosphere now automatically backs up the user's BIS keys on boot.
|
||||||
|
+ This should prevent a user from corrupting nand without access to a copy of the keys needed to fix it.
|
||||||
|
+ This is especially relevant on ipatched units, where the RCM vulnerability is not an option for addressing bricks.
|
||||||
|
+ The `pm` system module was rewritten as part of Stratosphere's ongoing refactor.
|
||||||
|
+ Support was added for forward-declaring a mitm'd service before a custom user sysmodule is launched.
|
||||||
|
+ This should help resolve dependency issues with service registration times.
|
||||||
|
+ SM is now informed of every process's title id, including built-in system modules.
|
||||||
|
+ The `creport` system module was rewritten as part of Stratosphere's ongoing refactor.
|
||||||
|
+ creport now dumps up to 0x100 of stack from each thread in the target process.
|
||||||
|
+ A few bugs were fixed, including one that caused creport to incorrectly dump process dying messages.
|
||||||
|
+ Defaults were added to `system_settings.ini` for controlling hbloader's memory usage in applet mode.
|
||||||
|
+ These defaults reserve enough memory so that homebrew can launch swkbd while in applet mode.
|
||||||
|
+ The `fatal` system module was rewritten as part of Stratosphere's ongoing refactor.
|
||||||
|
+ Incorrect display output ("2000-0000") has been fixed. Fatal will now correctly show 2162-0002 when this occurs.
|
||||||
|
+ A longstanding bug in how fatal manages the displays has been fixed, and official display init behavior is now matched precisely.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
## 0.9.2
|
||||||
|
+ A number of emummc bugfixes were added (all thanks to @m4xw's hard work). The following is a summary of emummc changes:
|
||||||
|
+ Support for file-based emummc instances was fixed.
|
||||||
|
+ Please note: file-based emummc is still unoptimized, and so may be much slower than partition-based.
|
||||||
|
+ This speed differential should hopefully be made better in a future emummc update.
|
||||||
|
+ The way emummc handles power management was completely overhauled.
|
||||||
|
+ Emummc now properly handles init/de-init, and now supports low voltage mode.
|
||||||
|
+ Much better support for shutdown was added, which should assuage corruption/synchronization problems.
|
||||||
|
+ This should also improve support for more types of SD cards.
|
||||||
|
+ A bug was fixed that caused emummc to not work on lower system versions due to missing SVC access.
|
||||||
|
+ **Please note**: The configuration entries used for emummc have been changed.
|
||||||
|
+ `emummc_` prefixes have been removed, since they are superfluous given the `emummc` category they are under.
|
||||||
|
+ As an example, `emummc!emummc_enabled` is now `emummc!enabled`.
|
||||||
|
+ INI configurations made by @CTCaer's [tool](https://github.com/ctcaer/hekate/releases/latest) (which is the recommended way to manage emummc) should automatically work as expected/be corrected.
|
||||||
|
+ **If you do not wish to use the above, you will need to manually correct your configuration file**.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
|
+ Stratosphere is currently in the process of being re-written/refactored.
|
||||||
|
+ Stratosphere was my (SciresM's) first C++ project, ever -- the code written for it a year ago when I was learning C++ is/was of much lower quality than code written more recently.
|
||||||
|
+ Code is thus being re-rwitten for clarity/stlye/to de-duplicate functionality, with much being moved into libstratosphere.
|
||||||
|
+ Stratosphere will, after the rewrite, globally use the `sts::` namespace -- this should greatly enhancing libstratosphere's ability to provide functionality for system modules.
|
||||||
|
+ The rewritten modules consistently have lower memory footprints, and should be easier to maintain going forwards.
|
||||||
|
+ The `sm`, `boot`, `spl`, `ro`, and `loader` modules have been tackled so far.
|
||||||
|
+ General system stability improvements to enhance the user's experience.
|
||||||
## 0.9.1
|
## 0.9.1
|
||||||
+ Support was added for 8.1.0.
|
+ Support was added for 8.1.0.
|
||||||
+ Please note, emummc is still considered **beta/experimental** -- this is not the inevitable bugfix update for it, although some number of bugs have been fixed. :)
|
+ Please note, emummc is still considered **beta/experimental** -- this is not the inevitable bugfix update for it, although some number of bugs have been fixed. :)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
[subrepo]
|
[subrepo]
|
||||||
remote = https://github.com/m4xw/emuMMC
|
remote = https://github.com/m4xw/emuMMC
|
||||||
branch = develop
|
branch = develop
|
||||||
commit = e7799388e8d3de17fd178ffe310be2e81ef46d6f
|
commit = b168ddf5fbb31013ff529a4859110c82b11eb361
|
||||||
parent = f2086fe05492cb523b60fa10e4425c4ea59521b3
|
parent = c07f54f3709a4710e0aead6c91139fa0893b5e5c
|
||||||
method = rebase
|
method = rebase
|
||||||
cmdver = 0.4.0
|
cmdver = 0.4.1
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
*A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw***
|
*A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw***
|
||||||
|
|
||||||
### Supported Horizon Versions
|
### Supported Horizon Versions
|
||||||
**1.0.0 - 8.0.1**
|
**1.0.0 - 10.0.0**
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Arbitrary SDMMC backend selection
|
* Arbitrary SDMMC backend selection
|
||||||
|
|||||||
@@ -116,6 +116,7 @@
|
|||||||
"svcReplyAndReceive": "0x43",
|
"svcReplyAndReceive": "0x43",
|
||||||
"svcReplyAndReceiveWithUserBuffer": "0x44",
|
"svcReplyAndReceiveWithUserBuffer": "0x44",
|
||||||
"svcCreateEvent": "0x45",
|
"svcCreateEvent": "0x45",
|
||||||
|
"svcReadWriteRegister": "0x4E",
|
||||||
"svcCreateInterruptEvent": "0x53",
|
"svcCreateInterruptEvent": "0x53",
|
||||||
"svcQueryIoMapping": "0x55",
|
"svcQueryIoMapping": "0x55",
|
||||||
"svcCreateDeviceAddressSpace": "0x56",
|
"svcCreateDeviceAddressSpace": "0x56",
|
||||||
|
|||||||
@@ -41,29 +41,35 @@
|
|||||||
#include "offsets/800_exfat.h"
|
#include "offsets/800_exfat.h"
|
||||||
#include "offsets/810.h"
|
#include "offsets/810.h"
|
||||||
#include "offsets/810_exfat.h"
|
#include "offsets/810_exfat.h"
|
||||||
|
#include "offsets/900.h"
|
||||||
|
#include "offsets/900_exfat.h"
|
||||||
|
#include "offsets/910.h"
|
||||||
|
#include "offsets/910_exfat.h"
|
||||||
|
#include "offsets/1000.h"
|
||||||
|
#include "offsets/1000_exfat.h"
|
||||||
#include "../utils/fatal.h"
|
#include "../utils/fatal.h"
|
||||||
|
|
||||||
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
|
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
|
||||||
|
|
||||||
#define DEFINE_OFFSET_STRUCT(vers) \
|
#define DEFINE_OFFSET_STRUCT(vers) \
|
||||||
static const fs_offsets_t GET_OFFSET_STRUCT_NAME(vers) = { \
|
static const fs_offsets_t GET_OFFSET_STRUCT_NAME(vers) = { \
|
||||||
.sdmmc_accessor_gc = FS_OFFSET##vers##_SDMMC_ACCESSOR_GC, \
|
.sdmmc_accessor_gc = FS_OFFSET##vers##_SDMMC_ACCESSOR_GC, \
|
||||||
.sdmmc_accessor_sd = FS_OFFSET##vers##_SDMMC_ACCESSOR_SD, \
|
.sdmmc_accessor_sd = FS_OFFSET##vers##_SDMMC_ACCESSOR_SD, \
|
||||||
.sdmmc_accessor_nand = FS_OFFSET##vers##_SDMMC_ACCESSOR_NAND, \
|
.sdmmc_accessor_nand = FS_OFFSET##vers##_SDMMC_ACCESSOR_NAND, \
|
||||||
.sdmmc_wrapper_read = FS_OFFSET##vers##_SDMMC_WRAPPER_READ, \
|
.sdmmc_wrapper_read = FS_OFFSET##vers##_SDMMC_WRAPPER_READ, \
|
||||||
.sdmmc_wrapper_write = FS_OFFSET##vers##_SDMMC_WRAPPER_WRITE, \
|
.sdmmc_wrapper_write = FS_OFFSET##vers##_SDMMC_WRAPPER_WRITE, \
|
||||||
.clkrst_set_min_v_clock_rate = FS_OFFSET##vers##_CLKRST_SET_MIN_V_CLK_RATE, \
|
.clkrst_set_min_v_clock_rate = FS_OFFSET##vers##_CLKRST_SET_MIN_V_CLK_RATE, \
|
||||||
.rtld = FS_OFFSET##vers##_RTLD, \
|
.rtld = FS_OFFSET##vers##_RTLD, \
|
||||||
.rtld_destination = FS_OFFSET##vers##_RTLD_DESTINATION, \
|
.rtld_destination = FS_OFFSET##vers##_RTLD_DESTINATION, \
|
||||||
.lock_mutex = FS_OFFSET##vers##_LOCK_MUTEX, \
|
.lock_mutex = FS_OFFSET##vers##_LOCK_MUTEX, \
|
||||||
.unlock_mutex = FS_OFFSET##vers##_UNLOCK_MUTEX, \
|
.unlock_mutex = FS_OFFSET##vers##_UNLOCK_MUTEX, \
|
||||||
.sd_mutex = FS_OFFSET##vers##_SD_MUTEX, \
|
.sd_mutex = FS_OFFSET##vers##_SD_MUTEX, \
|
||||||
.nand_mutex = FS_OFFSET##vers##_NAND_MUTEX, \
|
.nand_mutex = FS_OFFSET##vers##_NAND_MUTEX, \
|
||||||
.active_partition = FS_OFFSET##vers##_ACTIVE_PARTITION, \
|
.active_partition = FS_OFFSET##vers##_ACTIVE_PARTITION, \
|
||||||
.sdmmc_das_handle = FS_OFFSET##vers##_SDMMC_DAS_HANDLE, \
|
.sdmmc_das_handle = FS_OFFSET##vers##_SDMMC_DAS_HANDLE, \
|
||||||
.shutdown_sd = FS_OFFSET##vers##_SHUTDOWN_SD, \
|
.sdmmc_accessor_controller_close = FS_OFFSET##vers##_SDMMC_WRAPPER_CONTROLLER_CLOSE, \
|
||||||
.sd_das_init = FS_OFFSET##vers##_SD_DAS_INIT, \
|
.sd_das_init = FS_OFFSET##vers##_SD_DAS_INIT, \
|
||||||
.nintendo_paths = FS_OFFSET##vers##_NINTENDO_PATHS, \
|
.nintendo_paths = FS_OFFSET##vers##_NINTENDO_PATHS, \
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually define offset structs
|
// Actually define offset structs
|
||||||
@@ -92,6 +98,12 @@ DEFINE_OFFSET_STRUCT(_800);
|
|||||||
DEFINE_OFFSET_STRUCT(_800_EXFAT);
|
DEFINE_OFFSET_STRUCT(_800_EXFAT);
|
||||||
DEFINE_OFFSET_STRUCT(_810);
|
DEFINE_OFFSET_STRUCT(_810);
|
||||||
DEFINE_OFFSET_STRUCT(_810_EXFAT);
|
DEFINE_OFFSET_STRUCT(_810_EXFAT);
|
||||||
|
DEFINE_OFFSET_STRUCT(_900);
|
||||||
|
DEFINE_OFFSET_STRUCT(_900_EXFAT);
|
||||||
|
DEFINE_OFFSET_STRUCT(_910);
|
||||||
|
DEFINE_OFFSET_STRUCT(_910_EXFAT);
|
||||||
|
DEFINE_OFFSET_STRUCT(_1000);
|
||||||
|
DEFINE_OFFSET_STRUCT(_1000_EXFAT);
|
||||||
|
|
||||||
const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
|
const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
|
||||||
switch (version) {
|
switch (version) {
|
||||||
@@ -145,6 +157,18 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
|
|||||||
return &(GET_OFFSET_STRUCT_NAME(_810));
|
return &(GET_OFFSET_STRUCT_NAME(_810));
|
||||||
case FS_VER_8_1_0_EXFAT:
|
case FS_VER_8_1_0_EXFAT:
|
||||||
return &(GET_OFFSET_STRUCT_NAME(_810_EXFAT));
|
return &(GET_OFFSET_STRUCT_NAME(_810_EXFAT));
|
||||||
|
case FS_VER_9_0_0:
|
||||||
|
return &(GET_OFFSET_STRUCT_NAME(_900));
|
||||||
|
case FS_VER_9_0_0_EXFAT:
|
||||||
|
return &(GET_OFFSET_STRUCT_NAME(_900_EXFAT));
|
||||||
|
case FS_VER_9_1_0:
|
||||||
|
return &(GET_OFFSET_STRUCT_NAME(_910));
|
||||||
|
case FS_VER_9_1_0_EXFAT:
|
||||||
|
return &(GET_OFFSET_STRUCT_NAME(_910_EXFAT));
|
||||||
|
case FS_VER_10_0_0:
|
||||||
|
return &(GET_OFFSET_STRUCT_NAME(_1000));
|
||||||
|
case FS_VER_10_0_0_EXFAT:
|
||||||
|
return &(GET_OFFSET_STRUCT_NAME(_1000_EXFAT));
|
||||||
default:
|
default:
|
||||||
fatal_abort(Fatal_UnknownVersion);
|
fatal_abort(Fatal_UnknownVersion);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ typedef struct {
|
|||||||
// Misc funcs
|
// Misc funcs
|
||||||
uintptr_t lock_mutex;
|
uintptr_t lock_mutex;
|
||||||
uintptr_t unlock_mutex;
|
uintptr_t unlock_mutex;
|
||||||
|
uintptr_t sdmmc_accessor_controller_close;
|
||||||
// Misc data
|
// Misc data
|
||||||
uintptr_t sd_mutex;
|
uintptr_t sd_mutex;
|
||||||
uintptr_t nand_mutex;
|
uintptr_t nand_mutex;
|
||||||
uintptr_t active_partition;
|
uintptr_t active_partition;
|
||||||
uintptr_t sdmmc_das_handle;
|
uintptr_t sdmmc_das_handle;
|
||||||
// NOPs
|
// NOPs
|
||||||
uintptr_t shutdown_sd;
|
|
||||||
uintptr_t sd_das_init;
|
uintptr_t sd_das_init;
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
fs_offsets_nintendo_path_t nintendo_paths[];
|
fs_offsets_nintendo_path_t nintendo_paths[];
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ typedef struct sdmmc_accessor_vt
|
|||||||
void *map_device_addr_space;
|
void *map_device_addr_space;
|
||||||
void *unmap_device_addr_space;
|
void *unmap_device_addr_space;
|
||||||
void *controller_open;
|
void *controller_open;
|
||||||
void *controller_close;
|
uint64_t (*sdmmc_accessor_controller_close)(void *);
|
||||||
uint64_t (*read_write)(void *, uint64_t, uint64_t, void *, uint64_t, uint64_t);
|
uint64_t (*read_write)(void *, uint64_t, uint64_t, void *, uint64_t, uint64_t);
|
||||||
// More not included because we don't use it.
|
// More not included because we don't use it.
|
||||||
} sdmmc_accessor_vt_t;
|
} sdmmc_accessor_vt_t;
|
||||||
|
|||||||
@@ -59,6 +59,15 @@ enum FS_VER
|
|||||||
FS_VER_8_1_0,
|
FS_VER_8_1_0,
|
||||||
FS_VER_8_1_0_EXFAT,
|
FS_VER_8_1_0_EXFAT,
|
||||||
|
|
||||||
|
FS_VER_9_0_0,
|
||||||
|
FS_VER_9_0_0_EXFAT,
|
||||||
|
|
||||||
|
FS_VER_9_1_0,
|
||||||
|
FS_VER_9_1_0_EXFAT,
|
||||||
|
|
||||||
|
FS_VER_10_0_0,
|
||||||
|
FS_VER_10_0_0_EXFAT,
|
||||||
|
|
||||||
FS_VER_MAX,
|
FS_VER_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_100_LOCK_MUTEX 0x2884
|
#define FS_OFFSET_100_LOCK_MUTEX 0x2884
|
||||||
#define FS_OFFSET_100_UNLOCK_MUTEX 0x28F0
|
#define FS_OFFSET_100_UNLOCK_MUTEX 0x28F0
|
||||||
|
|
||||||
|
#define FS_OFFSET_100_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x6A8AC
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_100_SD_MUTEX 0xE36058
|
#define FS_OFFSET_100_SD_MUTEX 0xE36058
|
||||||
#define FS_OFFSET_100_NAND_MUTEX 0xE30610
|
#define FS_OFFSET_100_NAND_MUTEX 0xE30610
|
||||||
@@ -41,16 +43,13 @@
|
|||||||
#define FS_OFFSET_100_SDMMC_DAS_HANDLE 0xE2F730
|
#define FS_OFFSET_100_SDMMC_DAS_HANDLE 0xE2F730
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_100_SHUTDOWN_SD 0x22548
|
|
||||||
#define FS_OFFSET_100_SD_DAS_INIT 0x0
|
#define FS_OFFSET_100_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
#define FS_OFFSET_100_NINTENDO_PATHS \
|
#define FS_OFFSET_100_NINTENDO_PATHS \
|
||||||
{ \
|
{ \
|
||||||
{.opcode_reg = 9, .adrp_offset = 0x00032C58, .add_rel_offset = 4}, \
|
{.opcode_reg = 8, .adrp_offset = 0x00032C58, .add_rel_offset = 8}, \
|
||||||
{.opcode_reg = 8, .adrp_offset = 0x00032C60, .add_rel_offset = 4}, \
|
{.opcode_reg = 9, .adrp_offset = 0x00032F40, .add_rel_offset = 8}, \
|
||||||
{.opcode_reg = 9, .adrp_offset = 0x00032F3C, .add_rel_offset = 4}, \
|
|
||||||
{.opcode_reg = 8, .adrp_offset = 0x00032F44, .add_rel_offset = 4}, \
|
|
||||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
58
emummc/source/FS/offsets/1000.h
Normal file
58
emummc/source/FS/offsets/1000.h
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||||
|
* Copyright (c) 2019 Atmosphere-NX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef __FS_1000_H__
|
||||||
|
#define __FS_1000_H__
|
||||||
|
|
||||||
|
// Accessor vtable getters
|
||||||
|
#define FS_OFFSET_1000_SDMMC_ACCESSOR_GC 0x14DC90
|
||||||
|
#define FS_OFFSET_1000_SDMMC_ACCESSOR_SD 0x14BDA0
|
||||||
|
#define FS_OFFSET_1000_SDMMC_ACCESSOR_NAND 0x146C20
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
#define FS_OFFSET_1000_SDMMC_WRAPPER_READ 0x142380
|
||||||
|
#define FS_OFFSET_1000_SDMMC_WRAPPER_WRITE 0x142460
|
||||||
|
#define FS_OFFSET_1000_RTLD 0x634
|
||||||
|
#define FS_OFFSET_1000_RTLD_DESTINATION 0x9C
|
||||||
|
|
||||||
|
#define FS_OFFSET_1000_CLKRST_SET_MIN_V_CLK_RATE 0x1415A0
|
||||||
|
|
||||||
|
// Misc funcs
|
||||||
|
#define FS_OFFSET_1000_LOCK_MUTEX 0x28910
|
||||||
|
#define FS_OFFSET_1000_UNLOCK_MUTEX 0x28960
|
||||||
|
|
||||||
|
#define FS_OFFSET_1000_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1422E0
|
||||||
|
|
||||||
|
// Misc Data
|
||||||
|
#define FS_OFFSET_1000_SD_MUTEX 0xE273E8
|
||||||
|
#define FS_OFFSET_1000_NAND_MUTEX 0xE22DA0
|
||||||
|
#define FS_OFFSET_1000_ACTIVE_PARTITION 0xE22DE0
|
||||||
|
#define FS_OFFSET_1000_SDMMC_DAS_HANDLE 0xE0AB90
|
||||||
|
|
||||||
|
// NOPs
|
||||||
|
#define FS_OFFSET_1000_SD_DAS_INIT 0x151CEC
|
||||||
|
|
||||||
|
// Nintendo Paths
|
||||||
|
#define FS_OFFSET_1000_NINTENDO_PATHS \
|
||||||
|
{ \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x0006BBA4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00078520, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x0007ED0C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 4, .adrp_offset = 0x0009115C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __FS_1000_H__
|
||||||
58
emummc/source/FS/offsets/1000_exfat.h
Normal file
58
emummc/source/FS/offsets/1000_exfat.h
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||||
|
* Copyright (c) 2019 Atmosphere-NX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef __FS_1000_EXFAT_H__
|
||||||
|
#define __FS_1000_EXFAT_H__
|
||||||
|
|
||||||
|
// Accessor vtable getters
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SDMMC_ACCESSOR_GC 0x14DC90
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SDMMC_ACCESSOR_SD 0x14BDA0
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SDMMC_ACCESSOR_NAND 0x146C20
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SDMMC_WRAPPER_READ 0x142380
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SDMMC_WRAPPER_WRITE 0x142460
|
||||||
|
#define FS_OFFSET_1000_EXFAT_RTLD 0x634
|
||||||
|
#define FS_OFFSET_1000_EXFAT_RTLD_DESTINATION 0x9C
|
||||||
|
|
||||||
|
#define FS_OFFSET_1000_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1415A0
|
||||||
|
|
||||||
|
// Misc funcs
|
||||||
|
#define FS_OFFSET_1000_EXFAT_LOCK_MUTEX 0x28910
|
||||||
|
#define FS_OFFSET_1000_EXFAT_UNLOCK_MUTEX 0x28960
|
||||||
|
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1422E0
|
||||||
|
|
||||||
|
// Misc Data
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SD_MUTEX 0xE353E8
|
||||||
|
#define FS_OFFSET_1000_EXFAT_NAND_MUTEX 0xE30DA0
|
||||||
|
#define FS_OFFSET_1000_EXFAT_ACTIVE_PARTITION 0xE30DE0
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SDMMC_DAS_HANDLE 0xE18B90
|
||||||
|
|
||||||
|
// NOPs
|
||||||
|
#define FS_OFFSET_1000_EXFAT_SD_DAS_INIT 0x151CEC
|
||||||
|
|
||||||
|
// Nintendo Paths
|
||||||
|
#define FS_OFFSET_1000_EXFAT_NINTENDO_PATHS \
|
||||||
|
{ \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x0006BBA4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00078520, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x0007ED0C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 4, .adrp_offset = 0x0009115C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __FS_1000_EXFAT_H__
|
||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_200_LOCK_MUTEX 0x3264
|
#define FS_OFFSET_200_LOCK_MUTEX 0x3264
|
||||||
#define FS_OFFSET_200_UNLOCK_MUTEX 0x32D0
|
#define FS_OFFSET_200_UNLOCK_MUTEX 0x32D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_200_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x733F4
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_200_SD_MUTEX 0xE42268
|
#define FS_OFFSET_200_SD_MUTEX 0xE42268
|
||||||
#define FS_OFFSET_200_NAND_MUTEX 0xE3CED0
|
#define FS_OFFSET_200_NAND_MUTEX 0xE3CED0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_200_SDMMC_DAS_HANDLE 0xE3BDD0
|
#define FS_OFFSET_200_SDMMC_DAS_HANDLE 0xE3BDD0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_200_SHUTDOWN_SD 0x20C48
|
|
||||||
#define FS_OFFSET_200_SD_DAS_INIT 0x0
|
#define FS_OFFSET_200_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_200_EXFAT_LOCK_MUTEX 0x3264
|
#define FS_OFFSET_200_EXFAT_LOCK_MUTEX 0x3264
|
||||||
#define FS_OFFSET_200_EXFAT_UNLOCK_MUTEX 0x32D0
|
#define FS_OFFSET_200_EXFAT_UNLOCK_MUTEX 0x32D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_200_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x733F4
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_200_EXFAT_SD_MUTEX 0xF22268
|
#define FS_OFFSET_200_EXFAT_SD_MUTEX 0xF22268
|
||||||
#define FS_OFFSET_200_EXFAT_NAND_MUTEX 0xF1CED0
|
#define FS_OFFSET_200_EXFAT_NAND_MUTEX 0xF1CED0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_200_EXFAT_SDMMC_DAS_HANDLE 0xF1BDD0
|
#define FS_OFFSET_200_EXFAT_SDMMC_DAS_HANDLE 0xF1BDD0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_200_EXFAT_SHUTDOWN_SD 0x20C48
|
|
||||||
#define FS_OFFSET_200_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_200_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_210_LOCK_MUTEX 0x3264
|
#define FS_OFFSET_210_LOCK_MUTEX 0x3264
|
||||||
#define FS_OFFSET_210_UNLOCK_MUTEX 0x32D0
|
#define FS_OFFSET_210_UNLOCK_MUTEX 0x32D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_210_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x737D4
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_210_SD_MUTEX 0xE43268
|
#define FS_OFFSET_210_SD_MUTEX 0xE43268
|
||||||
#define FS_OFFSET_210_NAND_MUTEX 0xE3DED0
|
#define FS_OFFSET_210_NAND_MUTEX 0xE3DED0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_210_SDMMC_DAS_HANDLE 0xE3CDD0
|
#define FS_OFFSET_210_SDMMC_DAS_HANDLE 0xE3CDD0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_210_SHUTDOWN_SD 0x20E60
|
|
||||||
#define FS_OFFSET_210_SD_DAS_INIT 0x0
|
#define FS_OFFSET_210_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_210_EXFAT_LOCK_MUTEX 0x3264
|
#define FS_OFFSET_210_EXFAT_LOCK_MUTEX 0x3264
|
||||||
#define FS_OFFSET_210_EXFAT_UNLOCK_MUTEX 0x32D0
|
#define FS_OFFSET_210_EXFAT_UNLOCK_MUTEX 0x32D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_210_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x737D4
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_210_EXFAT_SD_MUTEX 0xF22268
|
#define FS_OFFSET_210_EXFAT_SD_MUTEX 0xF22268
|
||||||
#define FS_OFFSET_210_EXFAT_NAND_MUTEX 0xF1CED0
|
#define FS_OFFSET_210_EXFAT_NAND_MUTEX 0xF1CED0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_210_EXFAT_SDMMC_DAS_HANDLE 0xF1BDD0
|
#define FS_OFFSET_210_EXFAT_SDMMC_DAS_HANDLE 0xF1BDD0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_210_EXFAT_SHUTDOWN_SD 0x20E60
|
|
||||||
#define FS_OFFSET_210_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_210_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_300_LOCK_MUTEX 0x35CC
|
#define FS_OFFSET_300_LOCK_MUTEX 0x35CC
|
||||||
#define FS_OFFSET_300_UNLOCK_MUTEX 0x3638
|
#define FS_OFFSET_300_UNLOCK_MUTEX 0x3638
|
||||||
|
|
||||||
|
#define FS_OFFSET_300_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A270
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_300_SD_MUTEX 0xE69268
|
#define FS_OFFSET_300_SD_MUTEX 0xE69268
|
||||||
#define FS_OFFSET_300_NAND_MUTEX 0xE646F0
|
#define FS_OFFSET_300_NAND_MUTEX 0xE646F0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_300_SDMMC_DAS_HANDLE 0xE635A0
|
#define FS_OFFSET_300_SDMMC_DAS_HANDLE 0xE635A0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_300_SHUTDOWN_SD 0x258D8
|
|
||||||
#define FS_OFFSET_300_SD_DAS_INIT 0x0
|
#define FS_OFFSET_300_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_300_EXFAT_LOCK_MUTEX 0x35CC
|
#define FS_OFFSET_300_EXFAT_LOCK_MUTEX 0x35CC
|
||||||
#define FS_OFFSET_300_EXFAT_UNLOCK_MUTEX 0x3638
|
#define FS_OFFSET_300_EXFAT_UNLOCK_MUTEX 0x3638
|
||||||
|
|
||||||
|
#define FS_OFFSET_300_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A270
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_300_EXFAT_SD_MUTEX 0xF4C268
|
#define FS_OFFSET_300_EXFAT_SD_MUTEX 0xF4C268
|
||||||
#define FS_OFFSET_300_EXFAT_NAND_MUTEX 0xF476F0
|
#define FS_OFFSET_300_EXFAT_NAND_MUTEX 0xF476F0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_300_EXFAT_SDMMC_DAS_HANDLE 0xF465A0
|
#define FS_OFFSET_300_EXFAT_SDMMC_DAS_HANDLE 0xF465A0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_300_EXFAT_SHUTDOWN_SD 0x258D8
|
|
||||||
#define FS_OFFSET_300_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_300_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_301_LOCK_MUTEX 0x3638
|
#define FS_OFFSET_301_LOCK_MUTEX 0x3638
|
||||||
#define FS_OFFSET_301_UNLOCK_MUTEX 0x36A4
|
#define FS_OFFSET_301_UNLOCK_MUTEX 0x36A4
|
||||||
|
|
||||||
|
#define FS_OFFSET_301_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A32C
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_301_SD_MUTEX 0xE69268
|
#define FS_OFFSET_301_SD_MUTEX 0xE69268
|
||||||
#define FS_OFFSET_301_NAND_MUTEX 0xE646F0
|
#define FS_OFFSET_301_NAND_MUTEX 0xE646F0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_301_SDMMC_DAS_HANDLE 0xE635A0
|
#define FS_OFFSET_301_SDMMC_DAS_HANDLE 0xE635A0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_301_SHUTDOWN_SD 0x25944
|
|
||||||
#define FS_OFFSET_301_SD_DAS_INIT 0x0
|
#define FS_OFFSET_301_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_301_EXFAT_LOCK_MUTEX 0x3638
|
#define FS_OFFSET_301_EXFAT_LOCK_MUTEX 0x3638
|
||||||
#define FS_OFFSET_301_EXFAT_UNLOCK_MUTEX 0x36A4
|
#define FS_OFFSET_301_EXFAT_UNLOCK_MUTEX 0x36A4
|
||||||
|
|
||||||
|
#define FS_OFFSET_301_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A32C
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_301_EXFAT_SD_MUTEX 0xF4C268
|
#define FS_OFFSET_301_EXFAT_SD_MUTEX 0xF4C268
|
||||||
#define FS_OFFSET_301_EXFAT_NAND_MUTEX 0xF476F0
|
#define FS_OFFSET_301_EXFAT_NAND_MUTEX 0xF476F0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_301_EXFAT_SDMMC_DAS_HANDLE 0xF465A0
|
#define FS_OFFSET_301_EXFAT_SDMMC_DAS_HANDLE 0xF465A0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_301_EXFAT_SHUTDOWN_SD 0x25944
|
|
||||||
#define FS_OFFSET_301_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_301_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_400_LOCK_MUTEX 0x39A0
|
#define FS_OFFSET_400_LOCK_MUTEX 0x39A0
|
||||||
#define FS_OFFSET_400_UNLOCK_MUTEX 0x3A0C
|
#define FS_OFFSET_400_UNLOCK_MUTEX 0x3A0C
|
||||||
|
|
||||||
|
#define FS_OFFSET_400_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DB48
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_400_SD_MUTEX 0xE80268
|
#define FS_OFFSET_400_SD_MUTEX 0xE80268
|
||||||
#define FS_OFFSET_400_NAND_MUTEX 0xE7BC60
|
#define FS_OFFSET_400_NAND_MUTEX 0xE7BC60
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_400_SDMMC_DAS_HANDLE 0xE7ABF0
|
#define FS_OFFSET_400_SDMMC_DAS_HANDLE 0xE7ABF0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_400_SHUTDOWN_SD 0x32D70
|
|
||||||
#define FS_OFFSET_400_SD_DAS_INIT 0x0
|
#define FS_OFFSET_400_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_400_EXFAT_LOCK_MUTEX 0x39A0
|
#define FS_OFFSET_400_EXFAT_LOCK_MUTEX 0x39A0
|
||||||
#define FS_OFFSET_400_EXFAT_UNLOCK_MUTEX 0x3A0C
|
#define FS_OFFSET_400_EXFAT_UNLOCK_MUTEX 0x3A0C
|
||||||
|
|
||||||
|
#define FS_OFFSET_400_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DB48
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_400_EXFAT_SD_MUTEX 0xF63268
|
#define FS_OFFSET_400_EXFAT_SD_MUTEX 0xF63268
|
||||||
#define FS_OFFSET_400_EXFAT_NAND_MUTEX 0xF5EC60
|
#define FS_OFFSET_400_EXFAT_NAND_MUTEX 0xF5EC60
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_400_EXFAT_SDMMC_DAS_HANDLE 0xF5DBF0
|
#define FS_OFFSET_400_EXFAT_SDMMC_DAS_HANDLE 0xF5DBF0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_400_EXFAT_SHUTDOWN_SD 0x32D70
|
|
||||||
#define FS_OFFSET_400_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_400_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_410_LOCK_MUTEX 0x39A0
|
#define FS_OFFSET_410_LOCK_MUTEX 0x39A0
|
||||||
#define FS_OFFSET_410_UNLOCK_MUTEX 0x3A0C
|
#define FS_OFFSET_410_UNLOCK_MUTEX 0x3A0C
|
||||||
|
|
||||||
|
#define FS_OFFSET_410_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DBAC
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_410_SD_MUTEX 0xE80268
|
#define FS_OFFSET_410_SD_MUTEX 0xE80268
|
||||||
#define FS_OFFSET_410_NAND_MUTEX 0xE7BC60
|
#define FS_OFFSET_410_NAND_MUTEX 0xE7BC60
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_410_SDMMC_DAS_HANDLE 0xE7ABF0
|
#define FS_OFFSET_410_SDMMC_DAS_HANDLE 0xE7ABF0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_410_SHUTDOWN_SD 0x32D70
|
|
||||||
#define FS_OFFSET_410_SD_DAS_INIT 0x0
|
#define FS_OFFSET_410_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_410_EXFAT_LOCK_MUTEX 0x39A0
|
#define FS_OFFSET_410_EXFAT_LOCK_MUTEX 0x39A0
|
||||||
#define FS_OFFSET_410_EXFAT_UNLOCK_MUTEX 0x3A0C
|
#define FS_OFFSET_410_EXFAT_UNLOCK_MUTEX 0x3A0C
|
||||||
|
|
||||||
|
#define FS_OFFSET_410_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DBAC
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_410_EXFAT_SD_MUTEX 0xF63268
|
#define FS_OFFSET_410_EXFAT_SD_MUTEX 0xF63268
|
||||||
#define FS_OFFSET_410_EXFAT_NAND_MUTEX 0xF5EC60
|
#define FS_OFFSET_410_EXFAT_NAND_MUTEX 0xF5EC60
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_410_EXFAT_SDMMC_DAS_HANDLE 0xF5DBF0
|
#define FS_OFFSET_410_EXFAT_SDMMC_DAS_HANDLE 0xF5DBF0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_410_EXFAT_SHUTDOWN_SD 0x32D70
|
|
||||||
#define FS_OFFSET_410_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_410_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_500_LOCK_MUTEX 0x4080
|
#define FS_OFFSET_500_LOCK_MUTEX 0x4080
|
||||||
#define FS_OFFSET_500_UNLOCK_MUTEX 0x40D0
|
#define FS_OFFSET_500_UNLOCK_MUTEX 0x40D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_500_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9380
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_500_SD_MUTEX 0xEC3268
|
#define FS_OFFSET_500_SD_MUTEX 0xEC3268
|
||||||
#define FS_OFFSET_500_NAND_MUTEX 0xEBDE58
|
#define FS_OFFSET_500_NAND_MUTEX 0xEBDE58
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_500_SDMMC_DAS_HANDLE 0xEBCE30
|
#define FS_OFFSET_500_SDMMC_DAS_HANDLE 0xEBCE30
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_500_SHUTDOWN_SD 0x443E8
|
|
||||||
#define FS_OFFSET_500_SD_DAS_INIT 0x0
|
#define FS_OFFSET_500_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_500_EXFAT_LOCK_MUTEX 0x4080
|
#define FS_OFFSET_500_EXFAT_LOCK_MUTEX 0x4080
|
||||||
#define FS_OFFSET_500_EXFAT_UNLOCK_MUTEX 0x40D0
|
#define FS_OFFSET_500_EXFAT_UNLOCK_MUTEX 0x40D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_500_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9380
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_500_EXFAT_SD_MUTEX 0xFA8268
|
#define FS_OFFSET_500_EXFAT_SD_MUTEX 0xFA8268
|
||||||
#define FS_OFFSET_500_EXFAT_NAND_MUTEX 0xFA2E58
|
#define FS_OFFSET_500_EXFAT_NAND_MUTEX 0xFA2E58
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_500_EXFAT_SDMMC_DAS_HANDLE 0xFA1E30
|
#define FS_OFFSET_500_EXFAT_SDMMC_DAS_HANDLE 0xFA1E30
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_500_EXFAT_SHUTDOWN_SD 0x443E8
|
|
||||||
#define FS_OFFSET_500_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_500_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_510_LOCK_MUTEX 0x4080
|
#define FS_OFFSET_510_LOCK_MUTEX 0x4080
|
||||||
#define FS_OFFSET_510_UNLOCK_MUTEX 0x40D0
|
#define FS_OFFSET_510_UNLOCK_MUTEX 0x40D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_510_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9750
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_510_SD_MUTEX 0xEC4268
|
#define FS_OFFSET_510_SD_MUTEX 0xEC4268
|
||||||
#define FS_OFFSET_510_NAND_MUTEX 0xEBEE58
|
#define FS_OFFSET_510_NAND_MUTEX 0xEBEE58
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_510_SDMMC_DAS_HANDLE 0xEBDE30
|
#define FS_OFFSET_510_SDMMC_DAS_HANDLE 0xEBDE30
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_510_SHUTDOWN_SD 0x44578
|
|
||||||
#define FS_OFFSET_510_SD_DAS_INIT 0x0
|
#define FS_OFFSET_510_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_510_EXFAT_LOCK_MUTEX 0x4080
|
#define FS_OFFSET_510_EXFAT_LOCK_MUTEX 0x4080
|
||||||
#define FS_OFFSET_510_EXFAT_UNLOCK_MUTEX 0x40D0
|
#define FS_OFFSET_510_EXFAT_UNLOCK_MUTEX 0x40D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_510_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9750
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_510_EXFAT_SD_MUTEX 0xFA9268
|
#define FS_OFFSET_510_EXFAT_SD_MUTEX 0xFA9268
|
||||||
#define FS_OFFSET_510_EXFAT_NAND_MUTEX 0xFA3E58
|
#define FS_OFFSET_510_EXFAT_NAND_MUTEX 0xFA3E58
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_510_EXFAT_SDMMC_DAS_HANDLE 0xFA2E30
|
#define FS_OFFSET_510_EXFAT_SDMMC_DAS_HANDLE 0xFA2E30
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_510_EXFAT_SHUTDOWN_SD 0x44578
|
|
||||||
#define FS_OFFSET_510_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_510_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_600_LOCK_MUTEX 0x1412C0
|
#define FS_OFFSET_600_LOCK_MUTEX 0x1412C0
|
||||||
#define FS_OFFSET_600_UNLOCK_MUTEX 0x141310
|
#define FS_OFFSET_600_UNLOCK_MUTEX 0x141310
|
||||||
|
|
||||||
|
#define FS_OFFSET_600_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x148500
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_600_SD_MUTEX 0xF06268
|
#define FS_OFFSET_600_SD_MUTEX 0xF06268
|
||||||
#define FS_OFFSET_600_NAND_MUTEX 0xF01BA0
|
#define FS_OFFSET_600_NAND_MUTEX 0xF01BA0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_600_SDMMC_DAS_HANDLE 0xE01670
|
#define FS_OFFSET_600_SDMMC_DAS_HANDLE 0xE01670
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_600_SHUTDOWN_SD 0xB2F28
|
|
||||||
#define FS_OFFSET_600_SD_DAS_INIT 0x0
|
#define FS_OFFSET_600_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_600_EXFAT_LOCK_MUTEX 0x14C9C0
|
#define FS_OFFSET_600_EXFAT_LOCK_MUTEX 0x14C9C0
|
||||||
#define FS_OFFSET_600_EXFAT_UNLOCK_MUTEX 0x14CA10
|
#define FS_OFFSET_600_EXFAT_UNLOCK_MUTEX 0x14CA10
|
||||||
|
|
||||||
|
#define FS_OFFSET_600_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x153C00
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_600_EXFAT_SD_MUTEX 0xFEB268
|
#define FS_OFFSET_600_EXFAT_SD_MUTEX 0xFEB268
|
||||||
#define FS_OFFSET_600_EXFAT_NAND_MUTEX 0xFE6BA0
|
#define FS_OFFSET_600_EXFAT_NAND_MUTEX 0xFE6BA0
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_600_EXFAT_SDMMC_DAS_HANDLE 0xEE6670
|
#define FS_OFFSET_600_EXFAT_SDMMC_DAS_HANDLE 0xEE6670
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_600_EXFAT_SHUTDOWN_SD 0xBE628
|
|
||||||
#define FS_OFFSET_600_EXFAT_SD_DAS_INIT 0x0
|
#define FS_OFFSET_600_EXFAT_SD_DAS_INIT 0x0
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_700_LOCK_MUTEX 0x148A90
|
#define FS_OFFSET_700_LOCK_MUTEX 0x148A90
|
||||||
#define FS_OFFSET_700_UNLOCK_MUTEX 0x148AE0
|
#define FS_OFFSET_700_UNLOCK_MUTEX 0x148AE0
|
||||||
|
|
||||||
|
#define FS_OFFSET_700_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x14FD50
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_700_SD_MUTEX 0xF123E8
|
#define FS_OFFSET_700_SD_MUTEX 0xF123E8
|
||||||
#define FS_OFFSET_700_NAND_MUTEX 0xF0DBE8
|
#define FS_OFFSET_700_NAND_MUTEX 0xF0DBE8
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_700_SDMMC_DAS_HANDLE 0xE0E7A0
|
#define FS_OFFSET_700_SDMMC_DAS_HANDLE 0xE0E7A0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_700_SHUTDOWN_SD 0xB8FCC
|
|
||||||
#define FS_OFFSET_700_SD_DAS_INIT 0x85FE8
|
#define FS_OFFSET_700_SD_DAS_INIT 0x85FE8
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_700_EXFAT_LOCK_MUTEX 0x154040
|
#define FS_OFFSET_700_EXFAT_LOCK_MUTEX 0x154040
|
||||||
#define FS_OFFSET_700_EXFAT_UNLOCK_MUTEX 0x154090
|
#define FS_OFFSET_700_EXFAT_UNLOCK_MUTEX 0x154090
|
||||||
|
|
||||||
|
#define FS_OFFSET_700_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x15B300
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_700_EXFAT_SD_MUTEX 0xFF73E8
|
#define FS_OFFSET_700_EXFAT_SD_MUTEX 0xFF73E8
|
||||||
#define FS_OFFSET_700_EXFAT_NAND_MUTEX 0xFF2BE8
|
#define FS_OFFSET_700_EXFAT_NAND_MUTEX 0xFF2BE8
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_700_EXFAT_SDMMC_DAS_HANDLE 0xEF3A00
|
#define FS_OFFSET_700_EXFAT_SDMMC_DAS_HANDLE 0xEF3A00
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_700_EXFAT_SHUTDOWN_SD 0xC457C
|
|
||||||
#define FS_OFFSET_700_EXFAT_SD_DAS_INIT 0x91598
|
#define FS_OFFSET_700_EXFAT_SD_DAS_INIT 0x91598
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_800_LOCK_MUTEX 0x14B6D0
|
#define FS_OFFSET_800_LOCK_MUTEX 0x14B6D0
|
||||||
#define FS_OFFSET_800_UNLOCK_MUTEX 0x14B720
|
#define FS_OFFSET_800_UNLOCK_MUTEX 0x14B720
|
||||||
|
|
||||||
|
#define FS_OFFSET_800_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1529E0
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_800_SD_MUTEX 0xF1A3E8
|
#define FS_OFFSET_800_SD_MUTEX 0xF1A3E8
|
||||||
#define FS_OFFSET_800_NAND_MUTEX 0xF15BE8
|
#define FS_OFFSET_800_NAND_MUTEX 0xF15BE8
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_800_SDMMC_DAS_HANDLE 0xE167C0
|
#define FS_OFFSET_800_SDMMC_DAS_HANDLE 0xE167C0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_800_SHUTDOWN_SD 0xBAF6C
|
|
||||||
#define FS_OFFSET_800_SD_DAS_INIT 0x87D58
|
#define FS_OFFSET_800_SD_DAS_INIT 0x87D58
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_800_EXFAT_LOCK_MUTEX 0x156C80
|
#define FS_OFFSET_800_EXFAT_LOCK_MUTEX 0x156C80
|
||||||
#define FS_OFFSET_800_EXFAT_UNLOCK_MUTEX 0x156CD0
|
#define FS_OFFSET_800_EXFAT_UNLOCK_MUTEX 0x156CD0
|
||||||
|
|
||||||
|
#define FS_OFFSET_800_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x15DF90
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_800_EXFAT_SD_MUTEX 0xFFE3E8
|
#define FS_OFFSET_800_EXFAT_SD_MUTEX 0xFFE3E8
|
||||||
#define FS_OFFSET_800_EXFAT_NAND_MUTEX 0xFF9BE8
|
#define FS_OFFSET_800_EXFAT_NAND_MUTEX 0xFF9BE8
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_800_EXFAT_SDMMC_DAS_HANDLE 0xEFAA20
|
#define FS_OFFSET_800_EXFAT_SDMMC_DAS_HANDLE 0xEFAA20
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_800_EXFAT_SHUTDOWN_SD 0xC651C
|
|
||||||
#define FS_OFFSET_800_EXFAT_SD_DAS_INIT 0x93308
|
#define FS_OFFSET_800_EXFAT_SD_DAS_INIT 0x93308
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_810_LOCK_MUTEX 0x14B6D0
|
#define FS_OFFSET_810_LOCK_MUTEX 0x14B6D0
|
||||||
#define FS_OFFSET_810_UNLOCK_MUTEX 0x14B720
|
#define FS_OFFSET_810_UNLOCK_MUTEX 0x14B720
|
||||||
|
|
||||||
|
#define FS_OFFSET_810_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1529E0
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_810_SD_MUTEX 0xF1A3E8
|
#define FS_OFFSET_810_SD_MUTEX 0xF1A3E8
|
||||||
#define FS_OFFSET_810_NAND_MUTEX 0xF15BE8
|
#define FS_OFFSET_810_NAND_MUTEX 0xF15BE8
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_810_SDMMC_DAS_HANDLE 0xE167C0
|
#define FS_OFFSET_810_SDMMC_DAS_HANDLE 0xE167C0
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_810_SHUTDOWN_SD 0xBAF6C
|
|
||||||
#define FS_OFFSET_810_SD_DAS_INIT 0x87D58
|
#define FS_OFFSET_810_SD_DAS_INIT 0x87D58
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FS_OFFSET_810_EXFAT_LOCK_MUTEX 0x156C80
|
#define FS_OFFSET_810_EXFAT_LOCK_MUTEX 0x156C80
|
||||||
#define FS_OFFSET_810_EXFAT_UNLOCK_MUTEX 0x156CD0
|
#define FS_OFFSET_810_EXFAT_UNLOCK_MUTEX 0x156CD0
|
||||||
|
|
||||||
|
#define FS_OFFSET_810_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x15DF90
|
||||||
|
|
||||||
// Misc Data
|
// Misc Data
|
||||||
#define FS_OFFSET_810_EXFAT_SD_MUTEX 0xFFE3E8
|
#define FS_OFFSET_810_EXFAT_SD_MUTEX 0xFFE3E8
|
||||||
#define FS_OFFSET_810_EXFAT_NAND_MUTEX 0xFF9BE8
|
#define FS_OFFSET_810_EXFAT_NAND_MUTEX 0xFF9BE8
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#define FS_OFFSET_810_EXFAT_SDMMC_DAS_HANDLE 0xEFAA20
|
#define FS_OFFSET_810_EXFAT_SDMMC_DAS_HANDLE 0xEFAA20
|
||||||
|
|
||||||
// NOPs
|
// NOPs
|
||||||
#define FS_OFFSET_810_EXFAT_SHUTDOWN_SD 0xC651C
|
|
||||||
#define FS_OFFSET_810_EXFAT_SD_DAS_INIT 0x93308
|
#define FS_OFFSET_810_EXFAT_SD_DAS_INIT 0x93308
|
||||||
|
|
||||||
// Nintendo Paths
|
// Nintendo Paths
|
||||||
|
|||||||
59
emummc/source/FS/offsets/900.h
Normal file
59
emummc/source/FS/offsets/900.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||||
|
* Copyright (c) 2019 Atmosphere-NX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef __FS_900_H__
|
||||||
|
#define __FS_900_H__
|
||||||
|
|
||||||
|
// Accessor vtable getters
|
||||||
|
#define FS_OFFSET_900_SDMMC_ACCESSOR_GC 0x1430F0
|
||||||
|
#define FS_OFFSET_900_SDMMC_ACCESSOR_SD 0x141200
|
||||||
|
#define FS_OFFSET_900_SDMMC_ACCESSOR_NAND 0x13C080
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
#define FS_OFFSET_900_SDMMC_WRAPPER_READ 0x1377E0
|
||||||
|
#define FS_OFFSET_900_SDMMC_WRAPPER_WRITE 0x1378C0
|
||||||
|
#define FS_OFFSET_900_RTLD 0x454
|
||||||
|
#define FS_OFFSET_900_RTLD_DESTINATION 0x9C
|
||||||
|
|
||||||
|
#define FS_OFFSET_900_CLKRST_SET_MIN_V_CLK_RATE 0x136A00
|
||||||
|
|
||||||
|
// Misc funcs
|
||||||
|
#define FS_OFFSET_900_LOCK_MUTEX 0x25280
|
||||||
|
#define FS_OFFSET_900_UNLOCK_MUTEX 0x252D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_900_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137740
|
||||||
|
|
||||||
|
// Misc Data
|
||||||
|
#define FS_OFFSET_900_SD_MUTEX 0xE1D3E8
|
||||||
|
#define FS_OFFSET_900_NAND_MUTEX 0xE18258
|
||||||
|
#define FS_OFFSET_900_ACTIVE_PARTITION 0xE18298
|
||||||
|
#define FS_OFFSET_900_SDMMC_DAS_HANDLE 0xDFEFA0
|
||||||
|
|
||||||
|
// NOPs
|
||||||
|
#define FS_OFFSET_900_SD_DAS_INIT 0x1472BC
|
||||||
|
|
||||||
|
// Nintendo Paths
|
||||||
|
#define FS_OFFSET_900_NINTENDO_PATHS \
|
||||||
|
{ \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00068A60, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00070A40, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081CB4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081EF4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 4, .adrp_offset = 0x0008211C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __FS_900_H__
|
||||||
59
emummc/source/FS/offsets/900_exfat.h
Normal file
59
emummc/source/FS/offsets/900_exfat.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||||
|
* Copyright (c) 2019 Atmosphere-NX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef __FS_900_EXFAT_H__
|
||||||
|
#define __FS_900_EXFAT_H__
|
||||||
|
|
||||||
|
// Accessor vtable getters
|
||||||
|
#define FS_OFFSET_900_EXFAT_SDMMC_ACCESSOR_GC 0x1430F0
|
||||||
|
#define FS_OFFSET_900_EXFAT_SDMMC_ACCESSOR_SD 0x141200
|
||||||
|
#define FS_OFFSET_900_EXFAT_SDMMC_ACCESSOR_NAND 0x13C080
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
#define FS_OFFSET_900_EXFAT_SDMMC_WRAPPER_READ 0x1377E0
|
||||||
|
#define FS_OFFSET_900_EXFAT_SDMMC_WRAPPER_WRITE 0x1378C0
|
||||||
|
#define FS_OFFSET_900_EXFAT_RTLD 0x454
|
||||||
|
#define FS_OFFSET_900_EXFAT_RTLD_DESTINATION 0x9C
|
||||||
|
|
||||||
|
#define FS_OFFSET_900_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x136A00
|
||||||
|
|
||||||
|
// Misc funcs
|
||||||
|
#define FS_OFFSET_900_EXFAT_LOCK_MUTEX 0x25280
|
||||||
|
#define FS_OFFSET_900_EXFAT_UNLOCK_MUTEX 0x252D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_900_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137740
|
||||||
|
|
||||||
|
// Misc Data
|
||||||
|
#define FS_OFFSET_900_EXFAT_SD_MUTEX 0xE2B3E8
|
||||||
|
#define FS_OFFSET_900_EXFAT_NAND_MUTEX 0xE26258
|
||||||
|
#define FS_OFFSET_900_EXFAT_ACTIVE_PARTITION 0xE26298
|
||||||
|
#define FS_OFFSET_900_EXFAT_SDMMC_DAS_HANDLE 0xE0CFA0
|
||||||
|
|
||||||
|
// NOPs
|
||||||
|
#define FS_OFFSET_900_EXFAT_SD_DAS_INIT 0x1472BC
|
||||||
|
|
||||||
|
// Nintendo Paths
|
||||||
|
#define FS_OFFSET_900_EXFAT_NINTENDO_PATHS \
|
||||||
|
{ \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00068A60, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00070A40, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081CB4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081EF4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 4, .adrp_offset = 0x0008211C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __FS_900_EXFAT_H__
|
||||||
59
emummc/source/FS/offsets/910.h
Normal file
59
emummc/source/FS/offsets/910.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||||
|
* Copyright (c) 2019 Atmosphere-NX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef __FS_910_H__
|
||||||
|
#define __FS_910_H__
|
||||||
|
|
||||||
|
// Accessor vtable getters
|
||||||
|
#define FS_OFFSET_910_SDMMC_ACCESSOR_GC 0x143100
|
||||||
|
#define FS_OFFSET_910_SDMMC_ACCESSOR_SD 0x141210
|
||||||
|
#define FS_OFFSET_910_SDMMC_ACCESSOR_NAND 0x13C090
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
#define FS_OFFSET_910_SDMMC_WRAPPER_READ 0x1377F0
|
||||||
|
#define FS_OFFSET_910_SDMMC_WRAPPER_WRITE 0x1378D0
|
||||||
|
#define FS_OFFSET_910_RTLD 0x454
|
||||||
|
#define FS_OFFSET_910_RTLD_DESTINATION 0x9C
|
||||||
|
|
||||||
|
#define FS_OFFSET_910_CLKRST_SET_MIN_V_CLK_RATE 0x136A10
|
||||||
|
|
||||||
|
// Misc funcs
|
||||||
|
#define FS_OFFSET_910_LOCK_MUTEX 0x25280
|
||||||
|
#define FS_OFFSET_910_UNLOCK_MUTEX 0x252D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_910_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137750
|
||||||
|
|
||||||
|
// Misc Data
|
||||||
|
#define FS_OFFSET_910_SD_MUTEX 0xE1D3E8
|
||||||
|
#define FS_OFFSET_910_NAND_MUTEX 0xE18258
|
||||||
|
#define FS_OFFSET_910_ACTIVE_PARTITION 0xE18298
|
||||||
|
#define FS_OFFSET_910_SDMMC_DAS_HANDLE 0xDFEFA0
|
||||||
|
|
||||||
|
// NOPs
|
||||||
|
#define FS_OFFSET_910_SD_DAS_INIT 0x1472CC
|
||||||
|
|
||||||
|
// Nintendo Paths
|
||||||
|
#define FS_OFFSET_910_NINTENDO_PATHS \
|
||||||
|
{ \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00068A70, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00070A50, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081CC4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081F04, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 4, .adrp_offset = 0x0008212C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __FS_910_H__
|
||||||
59
emummc/source/FS/offsets/910_exfat.h
Normal file
59
emummc/source/FS/offsets/910_exfat.h
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||||
|
* Copyright (c) 2019 Atmosphere-NX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef __FS_910_EXFAT_H__
|
||||||
|
#define __FS_910_EXFAT_H__
|
||||||
|
|
||||||
|
// Accessor vtable getters
|
||||||
|
#define FS_OFFSET_910_EXFAT_SDMMC_ACCESSOR_GC 0x143100
|
||||||
|
#define FS_OFFSET_910_EXFAT_SDMMC_ACCESSOR_SD 0x141210
|
||||||
|
#define FS_OFFSET_910_EXFAT_SDMMC_ACCESSOR_NAND 0x13C090
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
#define FS_OFFSET_910_EXFAT_SDMMC_WRAPPER_READ 0x1377F0
|
||||||
|
#define FS_OFFSET_910_EXFAT_SDMMC_WRAPPER_WRITE 0x1378D0
|
||||||
|
#define FS_OFFSET_910_EXFAT_RTLD 0x454
|
||||||
|
#define FS_OFFSET_910_EXFAT_RTLD_DESTINATION 0x9C
|
||||||
|
|
||||||
|
#define FS_OFFSET_910_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x136A10
|
||||||
|
|
||||||
|
// Misc funcs
|
||||||
|
#define FS_OFFSET_910_EXFAT_LOCK_MUTEX 0x25280
|
||||||
|
#define FS_OFFSET_910_EXFAT_UNLOCK_MUTEX 0x252D0
|
||||||
|
|
||||||
|
#define FS_OFFSET_910_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137750
|
||||||
|
|
||||||
|
// Misc Data
|
||||||
|
#define FS_OFFSET_910_EXFAT_SD_MUTEX 0xE2B3E8
|
||||||
|
#define FS_OFFSET_910_EXFAT_NAND_MUTEX 0xE26258
|
||||||
|
#define FS_OFFSET_910_EXFAT_ACTIVE_PARTITION 0xE26298
|
||||||
|
#define FS_OFFSET_910_EXFAT_SDMMC_DAS_HANDLE 0xE0CFA0
|
||||||
|
|
||||||
|
// NOPs
|
||||||
|
#define FS_OFFSET_910_EXFAT_SD_DAS_INIT 0x1472CC
|
||||||
|
|
||||||
|
// Nintendo Paths
|
||||||
|
#define FS_OFFSET_910_EXFAT_NINTENDO_PATHS \
|
||||||
|
{ \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00068A70, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00070A50, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081CC4, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 3, .adrp_offset = 0x00081F04, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 4, .adrp_offset = 0x0008212C, .add_rel_offset = 0x00000004}, \
|
||||||
|
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __FS_910_EXFAT_H__
|
||||||
@@ -24,11 +24,13 @@
|
|||||||
#include "../utils/types.h"
|
#include "../utils/types.h"
|
||||||
#include "../utils/util.h"
|
#include "../utils/util.h"
|
||||||
#include "../utils/fatal.h"
|
#include "../utils/fatal.h"
|
||||||
|
#include "../emuMMC/emummc.h"
|
||||||
|
|
||||||
#define DPRINTF(...) //fprintf(stdout, __VA_ARGS__)
|
#define DPRINTF(...) //fprintf(stdout, __VA_ARGS__)
|
||||||
|
|
||||||
sdmmc_accessor_t *_current_accessor = NULL;
|
sdmmc_accessor_t *_current_accessor = NULL;
|
||||||
bool sdmmc_memcpy_buf = false;
|
bool sdmmc_memcpy_buf = false;
|
||||||
|
extern bool custom_driver;
|
||||||
|
|
||||||
static inline u32 unstuff_bits(u32 *resp, u32 start, u32 size)
|
static inline u32 unstuff_bits(u32 *resp, u32 start, u32 size)
|
||||||
{
|
{
|
||||||
@@ -52,25 +54,25 @@ intptr_t sdmmc_calculate_dma_addr(sdmmc_accessor_t *_this, void *buf, unsigned i
|
|||||||
char *_buf = (char *)buf;
|
char *_buf = (char *)buf;
|
||||||
char *actual_buf_start = _buf;
|
char *actual_buf_start = _buf;
|
||||||
char *actual_buf_end = &_buf[512 * num_sectors];
|
char *actual_buf_end = &_buf[512 * num_sectors];
|
||||||
char *dma_buffer_start = _this->parent->dmaBuffers[FS_SDMMC_EMMC].device_addr_buffer;
|
char *dma_buffer_start = _this->parent->dmaBuffers[0].device_addr_buffer;
|
||||||
|
|
||||||
if (dma_buffer_start <= _buf && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[FS_SDMMC_EMMC].device_addr_buffer_size])
|
if (dma_buffer_start <= _buf && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[0].device_addr_buffer_size])
|
||||||
{
|
{
|
||||||
dma_buf_idx = FS_SDMMC_EMMC;
|
dma_buf_idx = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dma_buffer_start = _this->parent->dmaBuffers[FS_SDMMC_SD].device_addr_buffer;
|
dma_buffer_start = _this->parent->dmaBuffers[1].device_addr_buffer;
|
||||||
if (dma_buffer_start <= actual_buf_start && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[FS_SDMMC_SD].device_addr_buffer_size])
|
if (dma_buffer_start <= actual_buf_start && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[1].device_addr_buffer_size])
|
||||||
{
|
{
|
||||||
dma_buf_idx = FS_SDMMC_SD;
|
dma_buf_idx = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dma_buffer_start = _this->parent->dmaBuffers[FS_SDMMC_GC].device_addr_buffer;
|
dma_buffer_start = _this->parent->dmaBuffers[2].device_addr_buffer;
|
||||||
if (dma_buffer_start <= actual_buf_start && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[FS_SDMMC_GC].device_addr_buffer_size])
|
if (dma_buffer_start <= actual_buf_start && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[2].device_addr_buffer_size])
|
||||||
{
|
{
|
||||||
dma_buf_idx = FS_SDMMC_GC;
|
dma_buf_idx = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -86,30 +88,69 @@ intptr_t sdmmc_calculate_dma_addr(sdmmc_accessor_t *_this, void *buf, unsigned i
|
|||||||
return admaaddr;
|
return admaaddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sdmmc_get_fitting_dma_index(sdmmc_accessor_t *_this, unsigned int num_sectors)
|
int sdmmc_calculate_dma_index(sdmmc_accessor_t *_this, void *buf, unsigned int num_sectors)
|
||||||
{
|
{
|
||||||
int dma_buf_idx = 0;
|
int dma_buf_idx = 0;
|
||||||
int blkSize = num_sectors * 512;
|
char *_buf = (char *)buf;
|
||||||
|
char *actual_buf_start = _buf;
|
||||||
|
char *actual_buf_end = &_buf[512 * num_sectors];
|
||||||
|
char *dma_buffer_start = _this->parent->dmaBuffers[0].device_addr_buffer;
|
||||||
|
|
||||||
if (_this->parent->dmaBuffers[FS_SDMMC_EMMC].device_addr_buffer_size >= blkSize)
|
if (dma_buffer_start <= _buf && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[0].device_addr_buffer_size])
|
||||||
{
|
{
|
||||||
dma_buf_idx = FS_SDMMC_EMMC;
|
dma_buf_idx = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_this->parent->dmaBuffers[FS_SDMMC_SD].device_addr_buffer_size >= blkSize)
|
dma_buffer_start = _this->parent->dmaBuffers[1].device_addr_buffer;
|
||||||
|
if (dma_buffer_start <= actual_buf_start && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[1].device_addr_buffer_size])
|
||||||
{
|
{
|
||||||
dma_buf_idx = FS_SDMMC_SD;
|
dma_buf_idx = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_this->parent->dmaBuffers[FS_SDMMC_GC].device_addr_buffer_size >= blkSize)
|
dma_buffer_start = _this->parent->dmaBuffers[2].device_addr_buffer;
|
||||||
|
if (dma_buffer_start <= actual_buf_start && actual_buf_end <= &dma_buffer_start[_this->parent->dmaBuffers[2].device_addr_buffer_size])
|
||||||
{
|
{
|
||||||
dma_buf_idx = FS_SDMMC_GC;
|
dma_buf_idx = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If buffer is on a random heap
|
// If buffer is on a random heap
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sdmmc_memcpy_buf = false;
|
||||||
|
|
||||||
|
return dma_buf_idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sdmmc_calculate_fitting_dma_index(sdmmc_accessor_t *_this, unsigned int num_sectors)
|
||||||
|
{
|
||||||
|
int dma_buf_idx = 0;
|
||||||
|
int blkSize = num_sectors * 512;
|
||||||
|
|
||||||
|
if (_this->parent->dmaBuffers[0].device_addr_buffer_size >= blkSize)
|
||||||
|
{
|
||||||
|
dma_buf_idx = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_this->parent->dmaBuffers[1].device_addr_buffer_size >= blkSize)
|
||||||
|
{
|
||||||
|
dma_buf_idx = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_this->parent->dmaBuffers[2].device_addr_buffer_size >= blkSize)
|
||||||
|
{
|
||||||
|
dma_buf_idx = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Can't find a fitting buffer
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -266,14 +307,112 @@ out:;
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern _sdmmc_accessor_sd sdmmc_accessor_sd;
|
||||||
|
extern _sdmmc_accessor_nand sdmmc_accessor_nand;
|
||||||
int sdmmc_storage_read(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, void *buf)
|
int sdmmc_storage_read(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, void *buf)
|
||||||
{
|
{
|
||||||
return _sdmmc_storage_readwrite(storage, sector, num_sectors, buf, 0);
|
if (!custom_driver)
|
||||||
|
{
|
||||||
|
sdmmc_accessor_t *accessor_sd = sdmmc_accessor_sd();
|
||||||
|
sdmmc_accessor_t *accessor_nand = sdmmc_accessor_nand();
|
||||||
|
|
||||||
|
if (sdmmc_calculate_dma_addr(accessor_sd, buf, num_sectors))
|
||||||
|
{
|
||||||
|
return !accessor_sd->vtab->read_write(accessor_sd, sector, num_sectors, buf, num_sectors * 512, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sdmmc_calculate_dma_addr(accessor_nand, buf, num_sectors))
|
||||||
|
{
|
||||||
|
// buf is on the nand dma buffer
|
||||||
|
int original_dma_idx = sdmmc_calculate_dma_index(accessor_nand, buf, num_sectors);
|
||||||
|
sdmmc_dma_buffer_t *original_dma_buffer = &accessor_nand->parent->dmaBuffers[original_dma_idx];
|
||||||
|
|
||||||
|
// Next entry
|
||||||
|
int dma_idx = sdmmc_calculate_fitting_dma_index(accessor_sd, num_sectors) + 1;
|
||||||
|
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer = original_dma_buffer->device_addr_buffer;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_masked = original_dma_buffer->device_addr_buffer_masked;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_size = original_dma_buffer->device_addr_buffer_size;
|
||||||
|
|
||||||
|
u64 res = accessor_sd->vtab->read_write(accessor_sd, sector, num_sectors, buf, num_sectors * 512, 1);
|
||||||
|
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer = 0;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_masked = 0;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_size = 0;
|
||||||
|
|
||||||
|
return !res;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// buf is on a heap
|
||||||
|
int dma_idx = sdmmc_calculate_fitting_dma_index(accessor_sd, num_sectors);
|
||||||
|
void *dma_buf = &accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer[0];
|
||||||
|
|
||||||
|
u64 res = accessor_sd->vtab->read_write(accessor_sd, sector, num_sectors, dma_buf, num_sectors * 512, 1);
|
||||||
|
memcpy(buf, dma_buf, num_sectors * 512);
|
||||||
|
|
||||||
|
return !res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return _sdmmc_storage_readwrite(storage, sector, num_sectors, buf, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sdmmc_storage_write(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, void *buf)
|
int sdmmc_storage_write(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, void *buf)
|
||||||
{
|
{
|
||||||
return _sdmmc_storage_readwrite(storage, sector, num_sectors, buf, 1);
|
if (!custom_driver)
|
||||||
|
{
|
||||||
|
sdmmc_accessor_t *accessor_sd = sdmmc_accessor_sd();
|
||||||
|
sdmmc_accessor_t *accessor_nand = sdmmc_accessor_nand();
|
||||||
|
|
||||||
|
if (sdmmc_calculate_dma_addr(accessor_sd, buf, num_sectors))
|
||||||
|
{
|
||||||
|
return !accessor_sd->vtab->read_write(accessor_sd, sector, num_sectors, buf, num_sectors * 512, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sdmmc_calculate_dma_addr(accessor_nand, buf, num_sectors))
|
||||||
|
{
|
||||||
|
// buf is on the nand dma buffer
|
||||||
|
int original_dma_idx = sdmmc_calculate_dma_index(accessor_nand, buf, num_sectors);
|
||||||
|
sdmmc_dma_buffer_t *original_dma_buffer = &accessor_nand->parent->dmaBuffers[original_dma_idx];
|
||||||
|
|
||||||
|
// Next entry
|
||||||
|
int dma_idx = sdmmc_calculate_fitting_dma_index(accessor_sd, num_sectors) + 1;
|
||||||
|
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer = original_dma_buffer->device_addr_buffer;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_masked = original_dma_buffer->device_addr_buffer_masked;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_size = original_dma_buffer->device_addr_buffer_size;
|
||||||
|
|
||||||
|
u64 res = accessor_sd->vtab->read_write(accessor_sd, sector, num_sectors, buf, num_sectors * 512, 0);
|
||||||
|
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer = 0;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_masked = 0;
|
||||||
|
accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer_size = 0;
|
||||||
|
|
||||||
|
return !res;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// buf is on a heap
|
||||||
|
int dma_idx = sdmmc_calculate_fitting_dma_index(accessor_sd, num_sectors);
|
||||||
|
void *dma_buf = &accessor_sd->parent->dmaBuffers[dma_idx].device_addr_buffer[0];
|
||||||
|
|
||||||
|
memcpy(dma_buf, buf, num_sectors * 512);
|
||||||
|
u64 res = accessor_sd->vtab->read_write(accessor_sd, sector, num_sectors, dma_buf, num_sectors * 512, 0);
|
||||||
|
|
||||||
|
return !res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return _sdmmc_storage_readwrite(storage, sector, num_sectors, buf, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -703,7 +842,7 @@ static int _sd_storage_get_op_cond(sdmmc_storage_t *storage, int is_version_1, i
|
|||||||
if (cond & SD_OCR_CCS)
|
if (cond & SD_OCR_CCS)
|
||||||
storage->has_sector_access = 1;
|
storage->has_sector_access = 1;
|
||||||
|
|
||||||
if (false && cond & SD_ROCR_S18A && supports_low_voltage)
|
if (cond & SD_ROCR_S18A && supports_low_voltage)
|
||||||
{
|
{
|
||||||
//The low voltage regulator configuration is valid for SDMMC1 only.
|
//The low voltage regulator configuration is valid for SDMMC1 only.
|
||||||
if (storage->sdmmc->id == SDMMC_1 &&
|
if (storage->sdmmc->id == SDMMC_1 &&
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ int sdmmc_storage_set_mmc_partition(sdmmc_storage_t *storage, u32 partition);
|
|||||||
int sdmmc_storage_init_sd(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 id, u32 bus_width, u32 type);
|
int sdmmc_storage_init_sd(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 id, u32 bus_width, u32 type);
|
||||||
int sdmmc_storage_init_gc(sdmmc_storage_t *storage, sdmmc_t *sdmmc);
|
int sdmmc_storage_init_gc(sdmmc_storage_t *storage, sdmmc_t *sdmmc);
|
||||||
intptr_t sdmmc_calculate_dma_addr(sdmmc_accessor_t *_this, void *buf, unsigned int num_sectors);
|
intptr_t sdmmc_calculate_dma_addr(sdmmc_accessor_t *_this, void *buf, unsigned int num_sectors);
|
||||||
int sdmmc_get_fitting_dma_index(sdmmc_accessor_t *_this, unsigned int num_sectors);
|
int sdmmc_calculate_dma_index(sdmmc_accessor_t *_this, void *buf, unsigned int num_sectors);
|
||||||
|
int sdmmc_calculate_fitting_dma_index(sdmmc_accessor_t *_this, unsigned int num_sectors);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -641,23 +641,6 @@ static int _sdmmc_autocal_config_offset(sdmmc_t *sdmmc, u32 power)
|
|||||||
|
|
||||||
static void _sdmmc_autocal_execute(sdmmc_t *sdmmc, u32 power)
|
static void _sdmmc_autocal_execute(sdmmc_t *sdmmc, u32 power)
|
||||||
{
|
{
|
||||||
if(sdmmc->id == SDMMC_1)
|
|
||||||
{
|
|
||||||
static int last_power = SDMMC_POWER_3_3;
|
|
||||||
if(power == SDMMC_POWER_1_8 && last_power == SDMMC_POWER_3_3)
|
|
||||||
{
|
|
||||||
last_power = power = SDMMC_POWER_1_8;
|
|
||||||
if (!_sdmmc_autocal_config_offset(sdmmc, power))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if(power == SDMMC_POWER_3_3 && last_power == SDMMC_POWER_1_8)
|
|
||||||
{
|
|
||||||
last_power = power = SDMMC_POWER_3_3;
|
|
||||||
if (!_sdmmc_autocal_config_offset(sdmmc, power))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool should_enable_sd_clock = false;
|
bool should_enable_sd_clock = false;
|
||||||
if (sdmmc->regs->clkcon & TEGRA_MMC_CLKCON_SD_CLOCK_ENABLE)
|
if (sdmmc->regs->clkcon & TEGRA_MMC_CLKCON_SD_CLOCK_ENABLE)
|
||||||
{
|
{
|
||||||
@@ -811,7 +794,7 @@ static int _sdmmc_config_dma(sdmmc_t *sdmmc, u32 *blkcnt_out, sdmmc_req_t *req)
|
|||||||
if (!admaaddr)
|
if (!admaaddr)
|
||||||
{
|
{
|
||||||
// buf is on a heap
|
// buf is on a heap
|
||||||
int dma_idx = sdmmc_get_fitting_dma_index(_current_accessor, blkcnt);
|
int dma_idx = sdmmc_calculate_fitting_dma_index(_current_accessor, blkcnt);
|
||||||
admaaddr = (u64)&_current_accessor->parent->dmaBuffers[dma_idx].device_addr_buffer_masked[0];
|
admaaddr = (u64)&_current_accessor->parent->dmaBuffers[dma_idx].device_addr_buffer_masked[0];
|
||||||
sdmmc->last_dma_idx = dma_idx;
|
sdmmc->last_dma_idx = dma_idx;
|
||||||
}
|
}
|
||||||
@@ -1011,10 +994,13 @@ static int _sdmmc_config_sdmmc1()
|
|||||||
PINMUX_AUX(PINMUX_AUX_SDMMC1_DAT1) = PINMUX_DRIVE_2X | PINMUX_INPUT_ENABLE | PINMUX_PARKED | PINMUX_PULL_UP;
|
PINMUX_AUX(PINMUX_AUX_SDMMC1_DAT1) = PINMUX_DRIVE_2X | PINMUX_INPUT_ENABLE | PINMUX_PARKED | PINMUX_PULL_UP;
|
||||||
PINMUX_AUX(PINMUX_AUX_SDMMC1_DAT0) = PINMUX_DRIVE_2X | PINMUX_INPUT_ENABLE | PINMUX_PARKED | PINMUX_PULL_UP;
|
PINMUX_AUX(PINMUX_AUX_SDMMC1_DAT0) = PINMUX_DRIVE_2X | PINMUX_INPUT_ENABLE | PINMUX_PARKED | PINMUX_PULL_UP;
|
||||||
|
|
||||||
|
//Make sure SDMMC1 controller is reset.
|
||||||
|
smcReadWriteRegister(PMC_BASE + APBDEV_PMC_NO_IOPOWER, (1 << 12), (1 << 12));
|
||||||
|
usleep(1000);
|
||||||
|
|
||||||
//Make sure the SDMMC1 controller is powered.
|
//Make sure the SDMMC1 controller is powered.
|
||||||
//PMC(APBDEV_PMC_NO_IOPOWER) &= ~(1 << 12);
|
smcReadWriteRegister(PMC_BASE + APBDEV_PMC_NO_IOPOWER, ~(1 << 12), (1 << 12));
|
||||||
//Assume 3.3V SD card voltage.
|
smcReadWriteRegister(PMC_BASE + APBDEV_PMC_PWR_DET_VAL, (1 << 12), (1 << 12));
|
||||||
//PMC(APBDEV_PMC_PWR_DET_VAL) |= (1 << 12);
|
|
||||||
|
|
||||||
//Set enable SD card power.
|
//Set enable SD card power.
|
||||||
PINMUX_AUX(PINMUX_AUX_DMIC3_CLK) = PINMUX_INPUT_ENABLE | PINMUX_PULL_DOWN | 1; //GPIO control, pull down.
|
PINMUX_AUX(PINMUX_AUX_DMIC3_CLK) = PINMUX_INPUT_ENABLE | PINMUX_PULL_DOWN | 1; //GPIO control, pull down.
|
||||||
@@ -1025,10 +1011,10 @@ static int _sdmmc_config_sdmmc1()
|
|||||||
usleep(1000);
|
usleep(1000);
|
||||||
|
|
||||||
//Enable SD card power.
|
//Enable SD card power.
|
||||||
//max77620_regulator_set_voltage(REGULATOR_LDO2, 3300000);
|
max77620_regulator_set_voltage(REGULATOR_LDO2, 3300000);
|
||||||
//max77620_regulator_enable(REGULATOR_LDO2, 1);
|
max77620_regulator_enable(REGULATOR_LDO2, 1);
|
||||||
|
|
||||||
//usleep(1000);
|
usleep(1000);
|
||||||
|
|
||||||
//For good measure.
|
//For good measure.
|
||||||
APB_MISC(APB_MISC_GP_SDMMC1_PAD_CFGPADCTRL) = 0x10000000;
|
APB_MISC(APB_MISC_GP_SDMMC1_PAD_CFGPADCTRL) = 0x10000000;
|
||||||
@@ -1071,7 +1057,7 @@ int sdmmc_init(sdmmc_t *sdmmc, u32 id, u32 power, u32 bus_width, u32 type, int n
|
|||||||
sdmmc->regs->veniotrimctl &= 0xFFFFFFFB;
|
sdmmc->regs->veniotrimctl &= 0xFFFFFFFB;
|
||||||
static const u32 trim_values[] = { 2, 8, 3, 8 };
|
static const u32 trim_values[] = { 2, 8, 3, 8 };
|
||||||
sdmmc->regs->venclkctl = (sdmmc->regs->venclkctl & 0xE0FFFFFF) | (trim_values[sdmmc->id] << 24);
|
sdmmc->regs->venclkctl = (sdmmc->regs->venclkctl & 0xE0FFFFFF) | (trim_values[sdmmc->id] << 24);
|
||||||
sdmmc->regs->sdmemcmppadctl = (sdmmc->regs->sdmemcmppadctl & 0xF) | 7;
|
sdmmc->regs->sdmemcmppadctl = (sdmmc->regs->sdmemcmppadctl & 0xFFFFFFF0) | 7;
|
||||||
if (!_sdmmc_autocal_config_offset(sdmmc, power))
|
if (!_sdmmc_autocal_config_offset(sdmmc, power))
|
||||||
return 0;
|
return 0;
|
||||||
_sdmmc_autocal_execute(sdmmc, power);
|
_sdmmc_autocal_execute(sdmmc, power);
|
||||||
@@ -1103,8 +1089,9 @@ void sdmmc_end(sdmmc_t *sdmmc)
|
|||||||
if (sdmmc->id == SDMMC_1)
|
if (sdmmc->id == SDMMC_1)
|
||||||
{
|
{
|
||||||
gpio_output_enable(GPIO_PORT_E, GPIO_PIN_4, GPIO_OUTPUT_DISABLE);
|
gpio_output_enable(GPIO_PORT_E, GPIO_PIN_4, GPIO_OUTPUT_DISABLE);
|
||||||
//max77620_regulator_enable(REGULATOR_LDO2, 0);
|
msleep(1); // To power cycle min 1ms without power is needed.
|
||||||
msleep(100); // To power cycle min 1ms without power is needed.
|
max77620_regulator_enable(REGULATOR_LDO2, 0);
|
||||||
|
msleep(100); // Some extra.
|
||||||
}
|
}
|
||||||
|
|
||||||
_sdmmc_get_clkcon(sdmmc);
|
_sdmmc_get_clkcon(sdmmc);
|
||||||
@@ -1158,7 +1145,7 @@ int sdmmc_enable_low_voltage(sdmmc_t *sdmmc)
|
|||||||
_sdmmc_get_clkcon(sdmmc);
|
_sdmmc_get_clkcon(sdmmc);
|
||||||
|
|
||||||
max77620_regulator_set_voltage(REGULATOR_LDO2, 1800000);
|
max77620_regulator_set_voltage(REGULATOR_LDO2, 1800000);
|
||||||
PMC(APBDEV_PMC_PWR_DET_VAL) &= ~(1 << 12);
|
smcReadWriteRegister(PMC_BASE + APBDEV_PMC_PWR_DET_VAL, ~(1 << 12), (1 << 12));
|
||||||
|
|
||||||
_sdmmc_autocal_config_offset(sdmmc, SDMMC_POWER_1_8);
|
_sdmmc_autocal_config_offset(sdmmc, SDMMC_POWER_1_8);
|
||||||
_sdmmc_autocal_execute(sdmmc, SDMMC_POWER_1_8);
|
_sdmmc_autocal_execute(sdmmc, SDMMC_POWER_1_8);
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ sdmmc_storage_t sd_storage;
|
|||||||
|
|
||||||
// init vars
|
// init vars
|
||||||
bool custom_driver = true;
|
bool custom_driver = true;
|
||||||
extern const volatile emuMMC_ctx_t emuMMC_ctx;
|
|
||||||
|
|
||||||
// FS funcs
|
// FS funcs
|
||||||
_sdmmc_accessor_gc sdmmc_accessor_gc;
|
_sdmmc_accessor_gc sdmmc_accessor_gc;
|
||||||
@@ -92,26 +91,9 @@ static void _sdmmc_ensure_initialized(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sdmmc_finalize(void)
|
|
||||||
{
|
|
||||||
if (!sdmmc_storage_end(&sd_storage))
|
|
||||||
{
|
|
||||||
fatal_abort(Fatal_InitSD);
|
|
||||||
}
|
|
||||||
storageSDinitialized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _file_based_update_filename(char *outFilename, u32 sd_path_len, u32 part_idx)
|
static void _file_based_update_filename(char *outFilename, u32 sd_path_len, u32 part_idx)
|
||||||
{
|
{
|
||||||
if (part_idx < 10)
|
snprintf(outFilename + sd_path_len, 3, "%02d", part_idx);
|
||||||
{
|
|
||||||
outFilename[sd_path_len] = '0';
|
|
||||||
itoa(part_idx, &outFilename[sd_path_len + 1], 10);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
itoa(part_idx, &outFilename[sd_path_len], 10);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _file_based_emmc_finalize(void)
|
static void _file_based_emmc_finalize(void)
|
||||||
@@ -119,11 +101,13 @@ static void _file_based_emmc_finalize(void)
|
|||||||
if ((emuMMC_ctx.EMMC_Type == emuMMC_SD_File) && fat_mounted)
|
if ((emuMMC_ctx.EMMC_Type == emuMMC_SD_File) && fat_mounted)
|
||||||
{
|
{
|
||||||
// Close all open handles.
|
// Close all open handles.
|
||||||
f_close(f_emu.fp_boot0);
|
f_close(&f_emu.fp_boot0);
|
||||||
f_close(f_emu.fp_boot1);
|
f_close(&f_emu.fp_boot1);
|
||||||
|
|
||||||
for (int i = 0; i < f_emu.parts; i++)
|
for (int i = 0; i < f_emu.parts; i++)
|
||||||
f_close(f_emu.fp_gpp[i]);
|
{
|
||||||
|
f_close(&f_emu.fp_gpp[i]);
|
||||||
|
}
|
||||||
|
|
||||||
// Force unmount FAT volume.
|
// Force unmount FAT volume.
|
||||||
f_mount(NULL, "", 1);
|
f_mount(NULL, "", 1);
|
||||||
@@ -132,6 +116,18 @@ static void _file_based_emmc_finalize(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sdmmc_finalize(void)
|
||||||
|
{
|
||||||
|
_file_based_emmc_finalize();
|
||||||
|
|
||||||
|
if (!sdmmc_storage_end(&sd_storage))
|
||||||
|
{
|
||||||
|
fatal_abort(Fatal_InitSD);
|
||||||
|
}
|
||||||
|
|
||||||
|
storageSDinitialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
static void _file_based_emmc_initialize(void)
|
static void _file_based_emmc_initialize(void)
|
||||||
{
|
{
|
||||||
char path[sizeof(emuMMC_ctx.storagePath) + 0x20];
|
char path[sizeof(emuMMC_ctx.storagePath) + 0x20];
|
||||||
@@ -143,36 +139,32 @@ static void _file_based_emmc_initialize(void)
|
|||||||
int path_len = strlen(path);
|
int path_len = strlen(path);
|
||||||
|
|
||||||
// Open BOOT0 physical partition.
|
// Open BOOT0 physical partition.
|
||||||
f_emu.fp_boot0 = (FIL *)malloc(sizeof(FIL));
|
|
||||||
memcpy(path + path_len, "BOOT0", 6);
|
memcpy(path + path_len, "BOOT0", 6);
|
||||||
if (f_open(f_emu.fp_boot0, path, FA_READ | FA_WRITE) != FR_OK)
|
if (f_open(&f_emu.fp_boot0, path, FA_READ | FA_WRITE) != FR_OK)
|
||||||
fatal_abort(Fatal_InitSD);
|
fatal_abort(Fatal_InitSD);
|
||||||
|
|
||||||
// Open BOOT1 physical partition.
|
// Open BOOT1 physical partition.
|
||||||
f_emu.fp_boot1 = (FIL *)malloc(sizeof(FIL));
|
|
||||||
memcpy(path + path_len, "BOOT1", 6);
|
memcpy(path + path_len, "BOOT1", 6);
|
||||||
if (f_open(f_emu.fp_boot1, path, FA_READ | FA_WRITE) != FR_OK)
|
if (f_open(&f_emu.fp_boot1, path, FA_READ | FA_WRITE) != FR_OK)
|
||||||
fatal_abort(Fatal_InitSD);
|
fatal_abort(Fatal_InitSD);
|
||||||
|
|
||||||
// Open handles for GPP physical partition files.
|
// Open handles for GPP physical partition files.
|
||||||
_file_based_update_filename(path, path_len, 00);
|
_file_based_update_filename(path, path_len, 00);
|
||||||
if (f_open(f_emu.fp_gpp[0], path, FA_READ | FA_WRITE) != FR_OK)
|
|
||||||
|
if (f_open(&f_emu.fp_gpp[0], path, FA_READ | FA_WRITE) != FR_OK)
|
||||||
fatal_abort(Fatal_InitSD);
|
fatal_abort(Fatal_InitSD);
|
||||||
|
|
||||||
f_emu.part_size = f_size(f_emu.fp_gpp[0]);
|
f_emu.part_size = f_size(&f_emu.fp_gpp[0]) >> 9;
|
||||||
|
|
||||||
// Iterate folder for split parts and stop if next doesn't exist.
|
// Iterate folder for split parts and stop if next doesn't exist.
|
||||||
// Supports up to 32 parts of any size.
|
// Supports up to 32 parts of any size.
|
||||||
// TODO: decide on max parts and define them. (hekate produces up to 30 parts on 1GB mode.)
|
// TODO: decide on max parts and define them. (hekate produces up to 30 parts on 1GB mode.)
|
||||||
for (f_emu.parts = 1; f_emu.parts < 32; f_emu.parts++)
|
for (f_emu.parts = 1; f_emu.parts < 32; f_emu.parts++)
|
||||||
{
|
{
|
||||||
f_emu.fp_gpp[f_emu.parts] = (FIL *)malloc(sizeof(FIL));
|
|
||||||
_file_based_update_filename(path, path_len, f_emu.parts);
|
_file_based_update_filename(path, path_len, f_emu.parts);
|
||||||
|
|
||||||
if (f_open(f_emu.fp_gpp[f_emu.parts], path, FA_READ | FA_WRITE) != FR_OK)
|
if (f_open(&f_emu.fp_gpp[f_emu.parts], path, FA_READ | FA_WRITE) != FR_OK)
|
||||||
{
|
{
|
||||||
free(f_emu.fp_gpp[f_emu.parts]);
|
|
||||||
|
|
||||||
// Check if single file.
|
// Check if single file.
|
||||||
if (f_emu.parts == 1)
|
if (f_emu.parts == 1)
|
||||||
f_emu.parts = 0;
|
f_emu.parts = 0;
|
||||||
@@ -257,14 +249,20 @@ sdmmc_accessor_t *sdmmc_accessor_get(int mmc_id)
|
|||||||
|
|
||||||
void mutex_lock_handler(int mmc_id)
|
void mutex_lock_handler(int mmc_id)
|
||||||
{
|
{
|
||||||
lock_mutex(sd_mutex);
|
if (custom_driver)
|
||||||
|
{
|
||||||
|
lock_mutex(sd_mutex);
|
||||||
|
}
|
||||||
lock_mutex(nand_mutex);
|
lock_mutex(nand_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mutex_unlock_handler(int mmc_id)
|
void mutex_unlock_handler(int mmc_id)
|
||||||
{
|
{
|
||||||
unlock_mutex(nand_mutex);
|
unlock_mutex(nand_mutex);
|
||||||
unlock_mutex(sd_mutex);
|
if (custom_driver)
|
||||||
|
{
|
||||||
|
unlock_mutex(sd_mutex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sdmmc_nand_get_active_partition_index()
|
int sdmmc_nand_get_active_partition_index()
|
||||||
@@ -303,19 +301,19 @@ static uint64_t emummc_read_write_inner(void *buf, unsigned int sector, unsigned
|
|||||||
case FS_EMMC_PARTITION_GPP:
|
case FS_EMMC_PARTITION_GPP:
|
||||||
if (f_emu.parts)
|
if (f_emu.parts)
|
||||||
{
|
{
|
||||||
fp_tmp = f_emu.fp_gpp[sector / f_emu.part_size];
|
fp_tmp = &f_emu.fp_gpp[sector / f_emu.part_size];
|
||||||
sector = sector % f_emu.part_size;
|
sector = sector % f_emu.part_size;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fp_tmp = f_emu.fp_gpp[0];
|
fp_tmp = &f_emu.fp_gpp[0];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FS_EMMC_PARTITION_BOOT1:
|
case FS_EMMC_PARTITION_BOOT1:
|
||||||
fp_tmp = f_emu.fp_boot1;
|
fp_tmp = &f_emu.fp_boot1;
|
||||||
break;
|
break;
|
||||||
case FS_EMMC_PARTITION_BOOT0:
|
case FS_EMMC_PARTITION_BOOT0:
|
||||||
fp_tmp = f_emu.fp_boot0;
|
fp_tmp = &f_emu.fp_boot0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,10 +322,44 @@ static uint64_t emummc_read_write_inner(void *buf, unsigned int sector, unsigned
|
|||||||
; //TODO. Out of range. close stuff and fatal?
|
; //TODO. Out of range. close stuff and fatal?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t res = 0;
|
||||||
if (!is_write)
|
if (!is_write)
|
||||||
return !(f_read(fp_tmp, buf, num_sectors << 9, NULL));
|
res = !(f_read(fp_tmp, buf, num_sectors << 9, NULL));
|
||||||
else
|
else
|
||||||
return !(f_write(fp_tmp, buf, num_sectors << 9, NULL));
|
res = !(f_write(fp_tmp, buf, num_sectors << 9, NULL));
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Controller close wrapper
|
||||||
|
uint64_t sdmmc_wrapper_controller_close(int mmc_id)
|
||||||
|
{
|
||||||
|
sdmmc_accessor_t *_this;
|
||||||
|
_this = sdmmc_accessor_get(mmc_id);
|
||||||
|
|
||||||
|
if (_this != NULL)
|
||||||
|
{
|
||||||
|
if (mmc_id == FS_SDMMC_SD)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mmc_id == FS_SDMMC_EMMC)
|
||||||
|
{
|
||||||
|
// Close file handles and unmount
|
||||||
|
_file_based_emmc_finalize();
|
||||||
|
|
||||||
|
// Close SD
|
||||||
|
sdmmc_accessor_get(FS_SDMMC_SD)->vtab->sdmmc_accessor_controller_close(sdmmc_accessor_get(FS_SDMMC_SD));
|
||||||
|
|
||||||
|
// Close eMMC
|
||||||
|
return _this->vtab->sdmmc_accessor_controller_close(_this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _this->vtab->sdmmc_accessor_controller_close(_this);
|
||||||
|
}
|
||||||
|
|
||||||
|
fatal_abort(Fatal_CloseAccessor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FS read wrapper.
|
// FS read wrapper.
|
||||||
@@ -366,6 +398,18 @@ uint64_t sdmmc_wrapper_read(void *buf, uint64_t bufSize, int mmc_id, unsigned in
|
|||||||
|
|
||||||
if (mmc_id == FS_SDMMC_SD)
|
if (mmc_id == FS_SDMMC_SD)
|
||||||
{
|
{
|
||||||
|
static bool first_sd_read = true;
|
||||||
|
if (first_sd_read)
|
||||||
|
{
|
||||||
|
first_sd_read = false;
|
||||||
|
// Because some SD cards have issues with emuMMC's driver
|
||||||
|
// we currently swap to FS's driver after first SD read
|
||||||
|
// TODO: Fix remaining driver issues
|
||||||
|
custom_driver = false;
|
||||||
|
// FS will handle sd mutex w/o custom driver from here on
|
||||||
|
unlock_mutex(sd_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
// Call hekates driver.
|
// Call hekates driver.
|
||||||
if (sdmmc_storage_read(&sd_storage, sector, num_sectors, buf))
|
if (sdmmc_storage_read(&sd_storage, sector, num_sectors, buf))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ sdmmc_accessor_t *sdmmc_accessor_get(int mmc_id);
|
|||||||
void mutex_lock_handler(int mmc_id);
|
void mutex_lock_handler(int mmc_id);
|
||||||
void mutex_unlock_handler(int mmc_id);
|
void mutex_unlock_handler(int mmc_id);
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
uint64_t sdmmc_wrapper_controller_close(int mmc_id);
|
||||||
uint64_t sdmmc_wrapper_read(void *buf, uint64_t bufSize, int mmc_id, unsigned int sector, unsigned int num_sectors);
|
uint64_t sdmmc_wrapper_read(void *buf, uint64_t bufSize, int mmc_id, unsigned int sector, unsigned int num_sectors);
|
||||||
uint64_t sdmmc_wrapper_write(int mmc_id, unsigned int sector, unsigned int num_sectors, void *buf, uint64_t bufSize);
|
uint64_t sdmmc_wrapper_write(int mmc_id, unsigned int sector, unsigned int num_sectors, void *buf, uint64_t bufSize);
|
||||||
|
|
||||||
@@ -59,9 +61,9 @@ typedef struct _file_based_ctxt
|
|||||||
uint64_t parts;
|
uint64_t parts;
|
||||||
uint64_t part_size;
|
uint64_t part_size;
|
||||||
FATFS *sd_fs;
|
FATFS *sd_fs;
|
||||||
FIL *fp_boot0;
|
FIL fp_boot0;
|
||||||
FIL *fp_boot1;
|
FIL fp_boot1;
|
||||||
FIL *fp_gpp[32];
|
FIL fp_gpp[32];
|
||||||
} file_based_ctxt;
|
} file_based_ctxt;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "nx/svc.h"
|
#include "nx/svc.h"
|
||||||
#include "nx/smc.h"
|
#include "nx/smc.h"
|
||||||
|
#include "soc/clock.h"
|
||||||
|
#include "soc/i2c.h"
|
||||||
#include "emuMMC/emummc.h"
|
#include "emuMMC/emummc.h"
|
||||||
#include "emuMMC/emummc_ctx.h"
|
#include "emuMMC/emummc_ctx.h"
|
||||||
#include "FS/FS_offsets.h"
|
#include "FS/FS_offsets.h"
|
||||||
@@ -46,6 +48,9 @@ extern char __argdata__;
|
|||||||
// TODO
|
// TODO
|
||||||
static char nintendo_path[0x80] = "Nintendo";
|
static char nintendo_path[0x80] = "Nintendo";
|
||||||
|
|
||||||
|
// 1.0.0 requires special path handling because it has separate album and contents paths.
|
||||||
|
#define FS_100_ALBUM_PATH 0
|
||||||
|
#define FS_100_CONTENTS_PATH 1
|
||||||
static char nintendo_path_album_100[0x100] = "/Nintendo/Album";
|
static char nintendo_path_album_100[0x100] = "/Nintendo/Album";
|
||||||
static char nintendo_path_contents_100[0x100] = "/Nintendo/Contents";
|
static char nintendo_path_contents_100[0x100] = "/Nintendo/Contents";
|
||||||
|
|
||||||
@@ -174,6 +179,8 @@ void setup_hooks(void)
|
|||||||
INJECT_HOOK(fs_offsets->sdmmc_wrapper_read, sdmmc_wrapper_read);
|
INJECT_HOOK(fs_offsets->sdmmc_wrapper_read, sdmmc_wrapper_read);
|
||||||
// sdmmc_wrapper_write hook
|
// sdmmc_wrapper_write hook
|
||||||
INJECT_HOOK(fs_offsets->sdmmc_wrapper_write, sdmmc_wrapper_write);
|
INJECT_HOOK(fs_offsets->sdmmc_wrapper_write, sdmmc_wrapper_write);
|
||||||
|
// sdmmc_wrapper_controller_close hook
|
||||||
|
INJECT_HOOK(fs_offsets->sdmmc_accessor_controller_close, sdmmc_wrapper_controller_close);
|
||||||
|
|
||||||
// On 8.0.0+, we need to hook the regulator setup, because
|
// On 8.0.0+, we need to hook the regulator setup, because
|
||||||
// otherwise it will abort because we have already turned it on.
|
// otherwise it will abort because we have already turned it on.
|
||||||
@@ -203,10 +210,6 @@ void populate_function_pointers(void)
|
|||||||
|
|
||||||
void write_nops(void)
|
void write_nops(void)
|
||||||
{
|
{
|
||||||
// This NOPs out a call to ShutdownSdCard when preparing for shutdown/reboot.
|
|
||||||
// This prevents the PatrolReader from hanging when saving its state, which
|
|
||||||
// occurs immediately afterwards (in ShutdownMmc).
|
|
||||||
INJECT_NOP(fs_offsets->shutdown_sd);
|
|
||||||
// On 7.0.0+, we need to attach to device address space ourselves.
|
// On 7.0.0+, we need to attach to device address space ourselves.
|
||||||
// This patches an abort that happens when Nintendo's code sees SD
|
// This patches an abort that happens when Nintendo's code sees SD
|
||||||
// is already attached
|
// is already attached
|
||||||
@@ -275,23 +278,18 @@ void setup_nintendo_paths(void)
|
|||||||
// 1.0.0 needs special handling because it uses two paths.
|
// 1.0.0 needs special handling because it uses two paths.
|
||||||
// Do album path
|
// Do album path
|
||||||
{
|
{
|
||||||
int path_len = snprintf(nintendo_path_album_100, sizeof(nintendo_path_album_100), "/%s/Album", nintendo_path);
|
snprintf(nintendo_path_album_100, sizeof(nintendo_path_album_100), "/%s/Album", nintendo_path);
|
||||||
intptr_t nintendo_album_path_location = (intptr_t)&nintendo_path_album_100;
|
intptr_t nintendo_album_path_location = (intptr_t)&nintendo_path_album_100;
|
||||||
intptr_t album_path_location = nintendo_album_path_location + path_len - 6; // "/Album"
|
uintptr_t fs_adrp_opcode_location = INJECT_OFFSET(uintptr_t, fs_offsets->nintendo_paths[FS_100_ALBUM_PATH].adrp_offset);
|
||||||
uintptr_t fs_n_adrp_opcode_location = INJECT_OFFSET(uintptr_t, fs_offsets->nintendo_paths[0].adrp_offset);
|
write_adrp_add(fs_offsets->nintendo_paths[FS_100_ALBUM_PATH].opcode_reg, fs_adrp_opcode_location, fs_offsets->nintendo_paths[FS_100_ALBUM_PATH].add_rel_offset, nintendo_album_path_location);
|
||||||
uintptr_t fs_adrp_opcode_location = INJECT_OFFSET(uintptr_t, fs_offsets->nintendo_paths[1].adrp_offset);
|
|
||||||
write_adrp_add(fs_offsets->nintendo_paths[0].opcode_reg, fs_n_adrp_opcode_location, fs_offsets->nintendo_paths[0].add_rel_offset, nintendo_album_path_location);
|
|
||||||
write_adrp_add(fs_offsets->nintendo_paths[1].opcode_reg, fs_adrp_opcode_location, fs_offsets->nintendo_paths[1].add_rel_offset, album_path_location);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do contents path
|
// Do contents path
|
||||||
{
|
{
|
||||||
int path_len = snprintf(nintendo_path_contents_100, sizeof(nintendo_path_contents_100), "/%s/Contents", nintendo_path);
|
snprintf(nintendo_path_contents_100, sizeof(nintendo_path_contents_100), "/%s/Contents", nintendo_path);
|
||||||
intptr_t nintendo_contents_path_location = (intptr_t)&nintendo_path_contents_100;
|
intptr_t nintendo_contents_path_location = (intptr_t)&nintendo_path_contents_100;
|
||||||
intptr_t contents_path_location = nintendo_contents_path_location + path_len - 9; // "/Contents"
|
uintptr_t fs_adrp_opcode_location = INJECT_OFFSET(uintptr_t, fs_offsets->nintendo_paths[FS_100_CONTENTS_PATH].adrp_offset);
|
||||||
uintptr_t fs_n_adrp_opcode_location = INJECT_OFFSET(uintptr_t, fs_offsets->nintendo_paths[2].adrp_offset);
|
write_adrp_add(fs_offsets->nintendo_paths[FS_100_CONTENTS_PATH].opcode_reg, fs_adrp_opcode_location, fs_offsets->nintendo_paths[FS_100_CONTENTS_PATH].add_rel_offset, nintendo_contents_path_location);
|
||||||
uintptr_t fs_adrp_opcode_location = INJECT_OFFSET(uintptr_t, fs_offsets->nintendo_paths[3].adrp_offset);
|
|
||||||
write_adrp_add(fs_offsets->nintendo_paths[2].opcode_reg, fs_n_adrp_opcode_location, fs_offsets->nintendo_paths[2].add_rel_offset, nintendo_contents_path_location);
|
|
||||||
write_adrp_add(fs_offsets->nintendo_paths[3].opcode_reg, fs_adrp_opcode_location, fs_offsets->nintendo_paths[3].add_rel_offset, contents_path_location);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -316,4 +314,7 @@ void __init()
|
|||||||
populate_function_pointers();
|
populate_function_pointers();
|
||||||
write_nops();
|
write_nops();
|
||||||
setup_nintendo_paths();
|
setup_nintendo_paths();
|
||||||
|
|
||||||
|
clock_enable_i2c5();
|
||||||
|
i2c_init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,18 @@ extern "C" {
|
|||||||
* @return Result code.
|
* @return Result code.
|
||||||
* @note Syscall number 0x55.
|
* @note Syscall number 0x55.
|
||||||
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||||
|
* @warning Only exists on [10.0.0+]. For older versions use \ref svcLegacyQueryIoMapping.
|
||||||
*/
|
*/
|
||||||
Result svcQueryIoMapping(u64* virtaddr, u64 physaddr, u64 size);
|
Result svcQueryIoMapping(u64* virtaddr, u64* out_size, u64 physaddr, u64 size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns a virtual address mapped to a given IO range.
|
||||||
|
* @return Result code.
|
||||||
|
* @note Syscall number 0x55.
|
||||||
|
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
|
||||||
|
* @warning Only exists on [1.0.0-9.2.0]. For newer versions use \ref svcQueryIoMapping.
|
||||||
|
*/
|
||||||
|
Result svcLegacyQueryIoMapping(u64* virtaddr, u64 physaddr, u64 size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Attaches a device address space to a device.
|
* @brief Attaches a device address space to a device.
|
||||||
|
|||||||
@@ -17,6 +17,15 @@
|
|||||||
.endm
|
.endm
|
||||||
|
|
||||||
SVC_BEGIN svcQueryIoMapping
|
SVC_BEGIN svcQueryIoMapping
|
||||||
|
STP X0, X1, [SP, #-16]!
|
||||||
|
SVC 0x55
|
||||||
|
LDP X3, X4, [SP], #16
|
||||||
|
STR X1, [X3]
|
||||||
|
STR X2, [X4]
|
||||||
|
RET
|
||||||
|
SVC_END
|
||||||
|
|
||||||
|
SVC_BEGIN svcLegacyQueryIoMapping
|
||||||
STR X0, [SP, #-16]!
|
STR X0, [SP, #-16]!
|
||||||
SVC 0x55
|
SVC 0x55
|
||||||
LDR X2, [SP], #16
|
LDR X2, [SP], #16
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
#include "../utils/util.h"
|
#include "../utils/util.h"
|
||||||
#include "t210.h"
|
#include "t210.h"
|
||||||
|
|
||||||
static u32 i2c_addrs[] = {
|
// TODO: not hardcode I2C_5
|
||||||
|
static u64 i2c_addrs[] = {
|
||||||
0x7000C000, 0x7000C400, 0x7000C500,
|
0x7000C000, 0x7000C400, 0x7000C500,
|
||||||
0x7000C700, 0x7000D000, 0x7000D100
|
0x7000C700, 0x7000D000, 0x7000D100
|
||||||
};
|
};
|
||||||
@@ -28,6 +29,7 @@ static u32 i2c_addrs[] = {
|
|||||||
static void _i2c_wait(vu32 *base)
|
static void _i2c_wait(vu32 *base)
|
||||||
{
|
{
|
||||||
base[I2C_CONFIG_LOAD] = 0x25;
|
base[I2C_CONFIG_LOAD] = 0x25;
|
||||||
|
|
||||||
for (u32 i = 0; i < 20; i++)
|
for (u32 i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
usleep(1);
|
usleep(1);
|
||||||
@@ -44,8 +46,7 @@ static int _i2c_send_pkt(u32 idx, u32 x, u8 *buf, u32 size)
|
|||||||
u32 tmp = 0;
|
u32 tmp = 0;
|
||||||
memcpy(&tmp, buf, size);
|
memcpy(&tmp, buf, size);
|
||||||
|
|
||||||
vu32 *base = (vu32 *)QueryIoMapping(i2c_addrs[0], 0x2000);
|
vu32 *base = (vu32 *)QueryIoMapping(i2c_addrs[I2C_5], 0x1000);
|
||||||
base = base + (i2c_addrs[idx] - i2c_addrs[0]);
|
|
||||||
base[I2C_CMD_ADDR0] = x << 1; //Set x (send mode).
|
base[I2C_CMD_ADDR0] = x << 1; //Set x (send mode).
|
||||||
base[I2C_CMD_DATA1] = tmp; //Set value.
|
base[I2C_CMD_DATA1] = tmp; //Set value.
|
||||||
base[I2C_CNFG] = (2 * size - 2) | 0x2800; //Set size and send mode.
|
base[I2C_CNFG] = (2 * size - 2) | 0x2800; //Set size and send mode.
|
||||||
@@ -66,8 +67,7 @@ static int _i2c_recv_pkt(u32 idx, u8 *buf, u32 size, u32 x)
|
|||||||
if (size > 8)
|
if (size > 8)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
vu32 *base = (vu32 *)QueryIoMapping(i2c_addrs[0], 0x2000);
|
vu32 *base = (vu32 *)QueryIoMapping(i2c_addrs[I2C_5], 0x1000);
|
||||||
base = base + (i2c_addrs[idx] - i2c_addrs[0]);
|
|
||||||
|
|
||||||
base[I2C_CMD_ADDR0] = (x << 1) | 1; // Set x (recv mode).
|
base[I2C_CMD_ADDR0] = (x << 1) | 1; // Set x (recv mode).
|
||||||
base[I2C_CNFG] = (size - 1) << 1 | 0x2840; // Set size and recv mode.
|
base[I2C_CNFG] = (size - 1) << 1 | 0x2840; // Set size and recv mode.
|
||||||
@@ -93,10 +93,9 @@ static int _i2c_recv_pkt(u32 idx, u8 *buf, u32 size, u32 x)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void i2c_init(u32 idx)
|
void i2c_init()
|
||||||
{
|
{
|
||||||
vu32 *base = (vu32 *)QueryIoMapping(i2c_addrs[0], 0x2000);
|
vu32 *base = (vu32 *)QueryIoMapping(i2c_addrs[I2C_5], 0x1000);
|
||||||
base = base + (i2c_addrs[idx] - i2c_addrs[0]);
|
|
||||||
|
|
||||||
base[I2C_CLK_DIVISOR_REGISTER] = 0x50001;
|
base[I2C_CLK_DIVISOR_REGISTER] = 0x50001;
|
||||||
base[I2C_BUS_CLEAR_CONFIG] = 0x90003;
|
base[I2C_BUS_CLEAR_CONFIG] = 0x90003;
|
||||||
@@ -104,7 +103,6 @@ void i2c_init(u32 idx)
|
|||||||
|
|
||||||
for (u32 i = 0; i < 10; i++)
|
for (u32 i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
usleep(20000);
|
|
||||||
if (base[INTERRUPT_STATUS_REGISTER] & 0x800)
|
if (base[INTERRUPT_STATUS_REGISTER] & 0x800)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#define I2C_BUS_CLEAR_STATUS 0x22
|
#define I2C_BUS_CLEAR_STATUS 0x22
|
||||||
#define I2C_CONFIG_LOAD 0x23
|
#define I2C_CONFIG_LOAD 0x23
|
||||||
|
|
||||||
void i2c_init(u32 idx);
|
void i2c_init();
|
||||||
int i2c_send_buf_small(u32 idx, u32 x, u32 y, u8 *buf, u32 size);
|
int i2c_send_buf_small(u32 idx, u32 x, u32 y, u8 *buf, u32 size);
|
||||||
int i2c_recv_buf_small(u8 *buf, u32 size, u32 idx, u32 x, u32 y);
|
int i2c_recv_buf_small(u8 *buf, u32 size, u32 idx, u32 x, u32 y);
|
||||||
int i2c_send_byte(u32 idx, u32 x, u32 y, u8 b);
|
int i2c_send_byte(u32 idx, u32 x, u32 y, u8 b);
|
||||||
|
|||||||
@@ -15,13 +15,26 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include "fatal.h"
|
#include "fatal.h"
|
||||||
|
|
||||||
void __attribute__((noreturn)) fatal_abort(enum FatalReason abortReason)
|
void __attribute__((noreturn)) fatal_abort(enum FatalReason abortReason)
|
||||||
{
|
{
|
||||||
|
atmosphere_fatal_error_ctx error_ctx;
|
||||||
|
memset(&error_ctx, 0, sizeof(atmosphere_fatal_error_ctx));
|
||||||
|
|
||||||
|
// Basic error storage for Atmosphere
|
||||||
|
// TODO: Maybe include a small reboot2payload stub?
|
||||||
|
error_ctx.magic = ATMOSPHERE_REBOOT_TO_FATAL_MAGIC;
|
||||||
|
error_ctx.title_id = 0x0100000000000000; // FS
|
||||||
|
error_ctx.error_desc = abortReason;
|
||||||
|
|
||||||
|
// Copy fatal context
|
||||||
|
smcCopyToIram(ATMOSPHERE_FATAL_ERROR_ADDR, &error_ctx, sizeof(atmosphere_fatal_error_ctx));
|
||||||
|
|
||||||
// Reboot to RCM
|
// Reboot to RCM
|
||||||
smcRebootToRcm();
|
smcRebootToRcm();
|
||||||
|
|
||||||
while(true)
|
while (true)
|
||||||
; // Should never be reached
|
; // Should never be reached
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,17 +18,61 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "../nx/smc.h"
|
#include "../nx/smc.h"
|
||||||
|
|
||||||
enum FatalReason {
|
enum FatalReason
|
||||||
|
{
|
||||||
Fatal_InitMMC = 0,
|
Fatal_InitMMC = 0,
|
||||||
Fatal_InitSD,
|
Fatal_InitSD,
|
||||||
Fatal_InvalidAccessor,
|
Fatal_InvalidAccessor,
|
||||||
Fatal_ReadNoAccessor,
|
Fatal_ReadNoAccessor,
|
||||||
Fatal_WriteNoAccessor,
|
Fatal_WriteNoAccessor,
|
||||||
Fatal_IoMapping,
|
Fatal_IoMappingLegacy,
|
||||||
Fatal_UnknownVersion,
|
Fatal_UnknownVersion,
|
||||||
Fatal_BadResult,
|
Fatal_BadResult,
|
||||||
Fatal_GetConfig,
|
Fatal_GetConfig,
|
||||||
|
Fatal_CloseAccessor,
|
||||||
|
Fatal_IoMapping,
|
||||||
Fatal_Max
|
Fatal_Max
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define AMS_FATAL_ERROR_MAX_STACKTRACE 0x20
|
||||||
|
#define AMS_FATAL_ERROR_MAX_STACKDUMP 0x100
|
||||||
|
|
||||||
|
/* Atmosphere reboot-to-fatal-error. */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t magic;
|
||||||
|
uint32_t error_desc;
|
||||||
|
uint64_t title_id;
|
||||||
|
union {
|
||||||
|
uint64_t gprs[32];
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint64_t _gprs[29];
|
||||||
|
uint64_t fp;
|
||||||
|
uint64_t lr;
|
||||||
|
uint64_t sp;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
uint64_t pc;
|
||||||
|
uint64_t module_base;
|
||||||
|
uint32_t pstate;
|
||||||
|
uint32_t afsr0;
|
||||||
|
uint32_t afsr1;
|
||||||
|
uint32_t esr;
|
||||||
|
uint64_t far;
|
||||||
|
uint64_t report_identifier; /* Normally just system tick. */
|
||||||
|
uint64_t stack_trace_size;
|
||||||
|
uint64_t stack_dump_size;
|
||||||
|
uint64_t stack_trace[AMS_FATAL_ERROR_MAX_STACKTRACE];
|
||||||
|
uint8_t stack_dump[AMS_FATAL_ERROR_MAX_STACKDUMP];
|
||||||
|
} atmosphere_fatal_error_ctx;
|
||||||
|
|
||||||
|
/* "AFE1" */
|
||||||
|
#define ATMOSPHERE_REBOOT_TO_FATAL_MAGIC 0x31454641
|
||||||
|
/* "AFE0" */
|
||||||
|
#define ATMOSPHERE_REBOOT_TO_FATAL_MAGIC_0 0x30454641
|
||||||
|
|
||||||
|
#define ATMOSPHERE_FATAL_ERROR_ADDR 0x4003E000
|
||||||
|
#define ATMOSPHERE_FATAL_ERROR_CONTEXT ((volatile atmosphere_fatal_error_ctx *)(ATMOSPHERE_FATAL_ERROR_ADDR))
|
||||||
|
|
||||||
void __attribute__((noreturn)) fatal_abort(enum FatalReason abortReason);
|
void __attribute__((noreturn)) fatal_abort(enum FatalReason abortReason);
|
||||||
|
|||||||
@@ -38,8 +38,15 @@ static inline uintptr_t _GetIoMapping(u64 io_addr, u64 io_size)
|
|||||||
u64 vaddr;
|
u64 vaddr;
|
||||||
u64 aligned_addr = (io_addr & ~0xFFFul);
|
u64 aligned_addr = (io_addr & ~0xFFFul);
|
||||||
u64 aligned_size = io_size + (io_addr - aligned_addr);
|
u64 aligned_size = io_size + (io_addr - aligned_addr);
|
||||||
if (svcQueryIoMapping(&vaddr, aligned_addr, aligned_size) != 0) {
|
if (emuMMC_ctx.fs_ver >= FS_VER_10_0_0) {
|
||||||
fatal_abort(Fatal_IoMapping);
|
u64 out_size;
|
||||||
|
if (svcQueryIoMapping(&vaddr, &out_size, aligned_addr, aligned_size) != 0) {
|
||||||
|
fatal_abort(Fatal_IoMapping);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (svcLegacyQueryIoMapping(&vaddr, aligned_addr, aligned_size) != 0) {
|
||||||
|
fatal_abort(Fatal_IoMappingLegacy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (uintptr_t)(vaddr + (io_addr - aligned_addr));
|
return (uintptr_t)(vaddr + (io_addr - aligned_addr));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#define _UTIL_H_
|
#define _UTIL_H_
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
#include "../emuMMC/emummc_ctx.h"
|
||||||
|
|
||||||
intptr_t QueryIoMapping(u64 addr, u64 size);
|
intptr_t QueryIoMapping(u64 addr, u64 size);
|
||||||
#define byte_swap_32(num) ((num >> 24) & 0xff) | ((num << 8) & 0xff0000) | \
|
#define byte_swap_32(num) ((num >> 24) & 0xff) | ((num << 8) & 0xff0000) | \
|
||||||
@@ -37,4 +38,6 @@ void usleep(u64 ticks);
|
|||||||
void msleep(u64 milliseconds);
|
void msleep(u64 milliseconds);
|
||||||
void exec_cfg(u32 *base, const cfg_op_t *ops, u32 num_ops);
|
void exec_cfg(u32 *base, const cfg_op_t *ops, u32 num_ops);
|
||||||
|
|
||||||
|
extern volatile emuMMC_ctx_t emuMMC_ctx;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ TARGET := $(notdir $(CURDIR))
|
|||||||
BUILD := build
|
BUILD := build
|
||||||
SOURCES := src src/dbg
|
SOURCES := src src/dbg
|
||||||
DATA := data
|
DATA := data
|
||||||
INCLUDES := include ../common/include
|
INCLUDES := include ../libraries/libvapours/include
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
@@ -48,7 +48,7 @@ CFLAGS := \
|
|||||||
-Wall \
|
-Wall \
|
||||||
$(ARCH) $(DEFINES)
|
$(ARCH) $(DEFINES)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE)
|
CFLAGS += $(INCLUDE)
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ TARGET := $(notdir $(CURDIR))
|
|||||||
BUILD := build
|
BUILD := build
|
||||||
SOURCES := src
|
SOURCES := src
|
||||||
DATA := data
|
DATA := data
|
||||||
INCLUDES := include ../../common/include
|
INCLUDES := include ../../libraries/libvapours/include
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@@ -33,7 +33,7 @@ static inline uint32_t get_special_clk_reg(CarDevice dev) {
|
|||||||
case CARDEVICE_BPMP: return 0;
|
case CARDEVICE_BPMP: return 0;
|
||||||
default: reboot();
|
default: reboot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t get_special_clk_val(CarDevice dev) {
|
static inline uint32_t get_special_clk_val(CarDevice dev) {
|
||||||
switch (dev) {
|
switch (dev) {
|
||||||
@@ -48,19 +48,19 @@ static inline uint32_t get_special_clk_val(CarDevice dev) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t g_clk_reg_offsets[NUM_CAR_BANKS] = {0x010, 0x014, 0x018, 0x360, 0x364, 0x280, 0x298};
|
static uint32_t g_clk_reg_offsets[NUM_CAR_BANKS] = {0x010, 0x014, 0x018, 0x360, 0x364, 0x280, 0x298};
|
||||||
static uint32_t g_rst_reg_offsets[NUM_CAR_BANKS] = {0x004, 0x008, 0x00C, 0x358, 0x35C, 0x28C, 0x2A4};
|
static uint32_t g_rst_reg_offsets[NUM_CAR_BANKS] = {0x004, 0x008, 0x00C, 0x358, 0x35C, 0x28C, 0x2A4};
|
||||||
|
|
||||||
static uint32_t g_clk_clr_reg_offsets[NUM_CAR_BANKS] = {0x324, 0x32C, 0x334, 0x444, 0x44C, 0x228, 0x2A0};
|
static uint32_t g_clk_clr_reg_offsets[NUM_CAR_BANKS] = {0x324, 0x32C, 0x334, 0x444, 0x44C, 0x228, 0x2A0};
|
||||||
|
|
||||||
void car_configure_oscillators(void) {
|
void car_configure_oscillators(void) {
|
||||||
/* Enable the crystal oscillator, setting drive strength to the saved value in PMC. */
|
/* Enable the crystal oscillator, setting drive strength to the saved value in PMC. */
|
||||||
CLK_RST_CONTROLLER_OSC_CTRL_0 = (CLK_RST_CONTROLLER_OSC_CTRL_0 & 0xFFFFFC0E) | 1 | (((APBDEV_PMC_OSC_EDPD_OVER_0 >> 1) & 0x3F) << 4);
|
CLK_RST_CONTROLLER_OSC_CTRL_0 = (CLK_RST_CONTROLLER_OSC_CTRL_0 & 0xFFFFFC0E) | 1 | (((APBDEV_PMC_OSC_EDPD_OVER_0 >> 1) & 0x3F) << 4);
|
||||||
|
|
||||||
/* Set CLK_M_DIVISOR to 1 (causes actual division by 2.) */
|
/* Set CLK_M_DIVISOR to 1 (causes actual division by 2.) */
|
||||||
CLK_RST_CONTROLLER_SPARE_REG0_0 = (1 << 2);
|
CLK_RST_CONTROLLER_SPARE_REG0_0 = (1 << 2);
|
||||||
/* Reading the register after writing it is required to ensure value takes. */
|
/* Reading the register after writing it is required to ensure value takes. */
|
||||||
(void)(CLK_RST_CONTROLLER_SPARE_REG0_0);
|
(void)(CLK_RST_CONTROLLER_SPARE_REG0_0);
|
||||||
|
|
||||||
/* Set TIMERUS_USEC_CFG to cycle at 0x60 / 0x5 = 19.2 MHz. */
|
/* Set TIMERUS_USEC_CFG to cycle at 0x60 / 0x5 = 19.2 MHz. */
|
||||||
/* Value is (dividend << 8) | (divisor). */
|
/* Value is (dividend << 8) | (divisor). */
|
||||||
TIMERUS_USEC_CFG_0 = 0x45F;
|
TIMERUS_USEC_CFG_0 = 0x45F;
|
||||||
@@ -68,30 +68,30 @@ void car_configure_oscillators(void) {
|
|||||||
|
|
||||||
void car_mbist_workaround(void) {
|
void car_mbist_workaround(void) {
|
||||||
/* This code works around MBIST bug. */
|
/* This code works around MBIST bug. */
|
||||||
|
|
||||||
/* Clear LVL2_CLK_GATE_OVR* registers. */
|
/* Clear LVL2_CLK_GATE_OVR* registers. */
|
||||||
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRA_0 = 0;
|
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRA_0 = 0;
|
||||||
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRB_0 = 0;
|
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRB_0 = 0;
|
||||||
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRC_0 = 0;
|
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRC_0 = 0;
|
||||||
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRD_0 = 0;
|
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRD_0 = 0;
|
||||||
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRE_0 = 0;
|
CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRE_0 = 0;
|
||||||
|
|
||||||
/* Clear bit patterns in CAR. */
|
/* Clear bit patterns in CAR. */
|
||||||
/* L: Reset all but RTC, TMR, GPIO, BPMP Cache (CACHE2). */
|
/* L: Reset all but RTC, TMR, GPIO, BPMP Cache (CACHE2). */
|
||||||
MAKE_CAR_REG(g_clk_clr_reg_offsets[0]) = MAKE_CAR_REG(g_clk_reg_offsets[0]) & 0x7FFFFECF;
|
MAKE_CAR_REG(g_clk_clr_reg_offsets[0]) = MAKE_CAR_REG(g_clk_reg_offsets[0]) & 0x7FFFFECF;
|
||||||
/* H: Reset all but MC, PMC, FUSE, EMC. */
|
/* H: Reset all but MC, PMC, FUSE, EMC. */
|
||||||
MAKE_CAR_REG(g_clk_clr_reg_offsets[1]) = MAKE_CAR_REG(g_clk_reg_offsets[1]) & 0xFDFFFF3E;
|
MAKE_CAR_REG(g_clk_clr_reg_offsets[1]) = MAKE_CAR_REG(g_clk_reg_offsets[1]) & 0xFDFFFF3E;
|
||||||
/* U: Reset all but CSITE, IRAM[A-D], BPMP Cache RAM (CRAM2). */
|
/* U: Reset all but CSITE, IRAM[A-D], BPMP Cache RAM (CRAM2). */
|
||||||
MAKE_CAR_REG(g_clk_clr_reg_offsets[2]) = MAKE_CAR_REG(g_clk_reg_offsets[2]) & 0xFE0FFDFF;
|
MAKE_CAR_REG(g_clk_clr_reg_offsets[2]) = MAKE_CAR_REG(g_clk_reg_offsets[2]) & 0xFE0FFDFF;
|
||||||
/* V: Reset all but MSELECT, S/PDIF audio doubler, TZRAM, SE. */
|
/* V: Reset all but MSELECT, S/PDIF audio doubler, TZRAM, SE. */
|
||||||
MAKE_CAR_REG(g_clk_clr_reg_offsets[3]) = MAKE_CAR_REG(g_clk_reg_offsets[3]) & 0x3FBFFFF7;
|
MAKE_CAR_REG(g_clk_clr_reg_offsets[3]) = MAKE_CAR_REG(g_clk_reg_offsets[3]) & 0x3FBFFFF7;
|
||||||
/* W: Reset all but PCIERX[0-5], ENTROPY. */
|
/* W: Reset all but PCIERX[0-5], ENTROPY. */
|
||||||
MAKE_CAR_REG(g_clk_clr_reg_offsets[4]) = MAKE_CAR_REG(g_clk_reg_offsets[4]) & 0xFFDFFF03;
|
MAKE_CAR_REG(g_clk_clr_reg_offsets[4]) = MAKE_CAR_REG(g_clk_reg_offsets[4]) & 0xFFDFFF03;
|
||||||
/* X: Reset all but ETC, MCLK, MCLK2, I2C6, EMC_DLL, GPU, DBGAPB, PLLG_REF, . */
|
/* X: Reset all but ETC, MCLK, MCLK2, I2C6, EMC_DLL, GPU, DBGAPB, PLLG_REF, . */
|
||||||
MAKE_CAR_REG(g_clk_clr_reg_offsets[5]) = MAKE_CAR_REG(g_clk_reg_offsets[5]) & 0xDCFFB87F;
|
MAKE_CAR_REG(g_clk_clr_reg_offsets[5]) = MAKE_CAR_REG(g_clk_reg_offsets[5]) & 0xDCFFB87F;
|
||||||
/* Y: Reset all but MC_CDPA, MC_CCPA. */
|
/* Y: Reset all but MC_CDPA, MC_CCPA. */
|
||||||
MAKE_CAR_REG(g_clk_clr_reg_offsets[6]) = MAKE_CAR_REG(g_clk_reg_offsets[6]) & 0xFFFFFCFF;
|
MAKE_CAR_REG(g_clk_clr_reg_offsets[6]) = MAKE_CAR_REG(g_clk_reg_offsets[6]) & 0xFFFFFCFF;
|
||||||
|
|
||||||
/* Enable clock to MC1, if CH1 is enabled in EMC. */
|
/* Enable clock to MC1, if CH1 is enabled in EMC. */
|
||||||
if (EMC_FBIO_CFG7_0 & 4) { /* CH1_ENABLE */
|
if (EMC_FBIO_CFG7_0 & 4) { /* CH1_ENABLE */
|
||||||
CLK_RST_CONTROLLER_CLK_ENB_W_SET_0 |= 0x40000000; /* SET_CLK_ENB_MC1 */
|
CLK_RST_CONTROLLER_CLK_ENB_W_SET_0 |= 0x40000000; /* SET_CLK_ENB_MC1 */
|
||||||
@@ -132,3 +132,7 @@ void clkrst_reboot(CarDevice dev) {
|
|||||||
clkrst_disable(dev);
|
clkrst_disable(dev);
|
||||||
clkrst_enable(dev);
|
clkrst_enable(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clkrst_enable_fuse_regs(bool enable) {
|
||||||
|
CLK_RST_CONTROLLER_MISC_CLK_ENB_0 = ((CLK_RST_CONTROLLER_MISC_CLK_ENB_0 & 0xEFFFFFFF) | ((enable & 1) << 28));
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -79,7 +79,7 @@ typedef enum {
|
|||||||
CARDEVICE_UARTC = ((1 << 5) | 0x17),
|
CARDEVICE_UARTC = ((1 << 5) | 0x17),
|
||||||
CARDEVICE_I2C1 = ((0 << 5) | 0xC),
|
CARDEVICE_I2C1 = ((0 << 5) | 0xC),
|
||||||
CARDEVICE_I2C5 = ((1 << 5) | 0xF),
|
CARDEVICE_I2C5 = ((1 << 5) | 0xF),
|
||||||
CARDEVICE_UNK = ((3 << 5) | 0x1E),
|
CARDEVICE_TZRAM = ((3 << 5) | 0x1E),
|
||||||
CARDEVICE_SE = ((3 << 5) | 0x1F),
|
CARDEVICE_SE = ((3 << 5) | 0x1F),
|
||||||
CARDEVICE_HOST1X = ((0 << 5) | 0x1C),
|
CARDEVICE_HOST1X = ((0 << 5) | 0x1C),
|
||||||
CARDEVICE_TSEC = ((2 << 5) | 0x13),
|
CARDEVICE_TSEC = ((2 << 5) | 0x13),
|
||||||
@@ -103,7 +103,8 @@ void rst_disable(CarDevice dev);
|
|||||||
|
|
||||||
void clkrst_enable(CarDevice dev);
|
void clkrst_enable(CarDevice dev);
|
||||||
void clkrst_disable(CarDevice dev);
|
void clkrst_disable(CarDevice dev);
|
||||||
|
|
||||||
void clkrst_reboot(CarDevice dev);
|
void clkrst_reboot(CarDevice dev);
|
||||||
|
|
||||||
|
void clkrst_enable_fuse_regs(bool enable);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 naehrwert
|
* Copyright (c) 2018 naehrwert
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -29,7 +29,7 @@ bool fuse_check_downgrade_status(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void fuse_disable_programming(void) {
|
void fuse_disable_programming(void) {
|
||||||
FUSE_REGS->FUSE_DIS_PGM = 1;
|
FUSE_REGS->FUSE_DISABLEREGPROGRAM = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static fuse_bypass_data_t g_fuse_bypass_entries[NUM_FUSE_BYPASS_ENTRIES] = {
|
static fuse_bypass_data_t g_fuse_bypass_entries[NUM_FUSE_BYPASS_ENTRIES] = {
|
||||||
@@ -37,13 +37,14 @@ static fuse_bypass_data_t g_fuse_bypass_entries[NUM_FUSE_BYPASS_ENTRIES] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void fuse_configure_fuse_bypass(void) {
|
void fuse_configure_fuse_bypass(void) {
|
||||||
/* Enable fuses in CAR? This seems to affect fuse data visibility. */
|
/* Make all fuse registers visible. */
|
||||||
CLK_RST_CONTROLLER_MISC_CLK_ENB_0 |= 0x10000000;
|
clkrst_enable_fuse_regs(true);
|
||||||
|
|
||||||
/* Configure bypass/override, only if programming is allowed. */
|
/* Configure bypass/override, only if programming is allowed. */
|
||||||
if (!(FUSE_REGS->FUSE_DIS_PGM & 1)) {
|
if (!(FUSE_REGS->FUSE_DISABLEREGPROGRAM & 1)) {
|
||||||
/* Enable write access. */
|
/* Enable write access and flush status. */
|
||||||
FUSE_REGS->FUSE_WRITE_ACCESS = (FUSE_REGS->FUSE_WRITE_ACCESS & ~0x1) | 0x10000;
|
FUSE_REGS->FUSE_WRITE_ACCESS_SW = (FUSE_REGS->FUSE_WRITE_ACCESS_SW & ~0x1) | 0x10000;
|
||||||
|
|
||||||
/* Enable fuse bypass config. */
|
/* Enable fuse bypass config. */
|
||||||
FUSE_REGS->FUSE_FUSEBYPASS = 1;
|
FUSE_REGS->FUSE_FUSEBYPASS = 1;
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ void fuse_configure_fuse_bypass(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Disable fuse write access. */
|
/* Disable fuse write access. */
|
||||||
FUSE_REGS->FUSE_WRITE_ACCESS |= 1;
|
FUSE_REGS->FUSE_WRITE_ACCESS_SW |= 1;
|
||||||
|
|
||||||
/* Enable fuse bypass config. */
|
/* Enable fuse bypass config. */
|
||||||
/* I think this is a bug, and Nintendo meant to write 0 here? */
|
/* I think this is a bug, and Nintendo meant to write 0 here? */
|
||||||
@@ -63,7 +64,7 @@ void fuse_configure_fuse_bypass(void) {
|
|||||||
/* I have no idea why this happens. What? */
|
/* I have no idea why this happens. What? */
|
||||||
/* This is probably also either a bug or does nothing. */
|
/* This is probably also either a bug or does nothing. */
|
||||||
/* Is this bit even clearable? */
|
/* Is this bit even clearable? */
|
||||||
FUSE_REGS->FUSE_DIS_PGM &= 0xFFFFFFFE;
|
FUSE_REGS->FUSE_DISABLEREGPROGRAM &= 0xFFFFFFFE;
|
||||||
|
|
||||||
/* Restore saved private key disable bit. */
|
/* Restore saved private key disable bit. */
|
||||||
FUSE_REGS->FUSE_PRIVATEKEYDISABLE |= (APBDEV_PMC_SECURE_SCRATCH21_0 & 0x10);
|
FUSE_REGS->FUSE_PRIVATEKEYDISABLE |= (APBDEV_PMC_SECURE_SCRATCH21_0 & 0x10);
|
||||||
@@ -71,5 +72,4 @@ void fuse_configure_fuse_bypass(void) {
|
|||||||
/* Lock private key disable secure scratch. */
|
/* Lock private key disable secure scratch. */
|
||||||
APBDEV_PMC_SEC_DISABLE2_0 |= 0x4000000;
|
APBDEV_PMC_SEC_DISABLE2_0 |= 0x4000000;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user