emummc: integrate updates for 14.0.0

This commit is contained in:
Michael Scire 2022-03-23 09:22:22 -07:00
parent 12d83106fd
commit 4f763b2aa4
5 changed files with 157 additions and 0 deletions

View file

@ -59,6 +59,8 @@
#include "offsets/1300_exfat.h"
#include "offsets/1310.h"
#include "offsets/1310_exfat.h"
#include "offsets/1400.h"
#include "offsets/1400_exfat.h"
#include "../utils/fatal.h"
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
@ -129,6 +131,8 @@ DEFINE_OFFSET_STRUCT(_1300);
DEFINE_OFFSET_STRUCT(_1300_EXFAT);
DEFINE_OFFSET_STRUCT(_1310);
DEFINE_OFFSET_STRUCT(_1310_EXFAT);
DEFINE_OFFSET_STRUCT(_1400);
DEFINE_OFFSET_STRUCT(_1400_EXFAT);
const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
switch (version) {
@ -218,6 +222,10 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
return &(GET_OFFSET_STRUCT_NAME(_1310));
case FS_VER_13_1_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1310_EXFAT));
case FS_VER_14_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1400));
case FS_VER_14_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1400_EXFAT));
default:
fatal_abort(Fatal_UnknownVersion);
}

View file

@ -86,6 +86,9 @@ enum FS_VER
FS_VER_13_1_0,
FS_VER_13_1_0_EXFAT,
FS_VER_14_0_0,
FS_VER_14_0_0_EXFAT,
FS_VER_MAX,
};

59
emummc/source/FS/offsets/1400.h vendored Normal file
View 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_1400_H__
#define __FS_1400_H__
// Accessor vtable getters
#define FS_OFFSET_1400_SDMMC_ACCESSOR_GC 0x189F50
#define FS_OFFSET_1400_SDMMC_ACCESSOR_SD 0x18BD60
#define FS_OFFSET_1400_SDMMC_ACCESSOR_NAND 0x18A480
// Hooks
#define FS_OFFSET_1400_SDMMC_WRAPPER_READ 0x185AF0
#define FS_OFFSET_1400_SDMMC_WRAPPER_WRITE 0x185B50
#define FS_OFFSET_1400_RTLD 0x282B8
#define FS_OFFSET_1400_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1400_CLKRST_SET_MIN_V_CLK_RATE 0x1A5D90
// Misc funcs
#define FS_OFFSET_1400_LOCK_MUTEX 0x17E9F0
#define FS_OFFSET_1400_UNLOCK_MUTEX 0x17EA40
#define FS_OFFSET_1400_SDMMC_WRAPPER_CONTROLLER_OPEN 0x185AA0
#define FS_OFFSET_1400_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x185AD0
// Misc Data
#define FS_OFFSET_1400_SD_MUTEX 0xF2E3F0
#define FS_OFFSET_1400_NAND_MUTEX 0xF292F8
#define FS_OFFSET_1400_ACTIVE_PARTITION 0xF29338
#define FS_OFFSET_1400_SDMMC_DAS_HANDLE 0xDFE9C8
// NOPs
#define FS_OFFSET_1400_SD_DAS_INIT 0x27004
// Nintendo Paths
#define FS_OFFSET_1400_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006D9C0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007AC24, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000813E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009387C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1400_H__

59
emummc/source/FS/offsets/1400_exfat.h vendored Normal file
View 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_1400_EXFAT_H__
#define __FS_1400_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1400_EXFAT_SDMMC_ACCESSOR_GC 0x1952D0
#define FS_OFFSET_1400_EXFAT_SDMMC_ACCESSOR_SD 0x1970E0
#define FS_OFFSET_1400_EXFAT_SDMMC_ACCESSOR_NAND 0x195800
// Hooks
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_READ 0x190E70
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_WRITE 0x190ED0
#define FS_OFFSET_1400_EXFAT_RTLD 0x282B8
#define FS_OFFSET_1400_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1400_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B1110
// Misc funcs
#define FS_OFFSET_1400_EXFAT_LOCK_MUTEX 0x189D70
#define FS_OFFSET_1400_EXFAT_UNLOCK_MUTEX 0x189DC0
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x190E20
#define FS_OFFSET_1400_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x190E50
// Misc Data
#define FS_OFFSET_1400_EXFAT_SD_MUTEX 0x10123F0
#define FS_OFFSET_1400_EXFAT_NAND_MUTEX 0x100D2F8
#define FS_OFFSET_1400_EXFAT_ACTIVE_PARTITION 0x100D338
#define FS_OFFSET_1400_EXFAT_SDMMC_DAS_HANDLE 0xE0B9C8
// NOPs
#define FS_OFFSET_1400_EXFAT_SD_DAS_INIT 0x27004
// Nintendo Paths
#define FS_OFFSET_1400_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x0006D9C0, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0007AC24, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000813E8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0009387C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1400_EXFAT_H__

View file

@ -27,6 +27,10 @@ CODE_BEGIN armDCacheFlush
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armDCacheFlush_L0:
dc civac, x8
add x8, x8, x9
@ -34,6 +38,9 @@ armDCacheFlush_L0:
bcc armDCacheFlush_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END
@ -48,6 +55,10 @@ CODE_BEGIN armDCacheClean
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armDCacheClean_L0:
dc cvac, x8
add x8, x8, x9
@ -55,6 +66,9 @@ armDCacheClean_L0:
bcc armDCacheClean_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END
@ -68,6 +82,10 @@ CODE_BEGIN armICacheInvalidate
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armICacheInvalidate_L0:
ic ivau, x8
add x8, x8, x9
@ -75,6 +93,9 @@ armICacheInvalidate_L0:
bcc armICacheInvalidate_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END
@ -89,6 +110,10 @@ CODE_BEGIN armDCacheZero
bic x8, x0, x10
mov x10, x1
mov w1, #1
mrs x0, tpidrro_el0
strb w1, [x0, #0x104]
armDCacheZero_L0:
dc zva, x8
add x8, x8, x9
@ -96,5 +121,8 @@ armDCacheZero_L0:
bcc armDCacheZero_L0
dsb sy
strb wzr, [x0, #0x104]
ret
CODE_END