This commit is contained in:
hanai3Bi
2023-04-01 01:49:31 +03:00
committed by hanabbi
parent 63bbde2f58
commit 3db0b9b380
210 changed files with 1286 additions and 48394 deletions

View File

@@ -16,35 +16,54 @@
#pragma once
#define CUST_REV 3
#define CUST_REV 4
#include "oc_common.hpp"
#include "pcv/pcv_common.hpp"
namespace ams::ldr::oc {
#include "mtc_timing_table.hpp"
enum MtcConfig {
AUTO_ADJ_MARIKO_SAFE_NO_ADJ_ERISTA = 0,
AUTO_ADJ_MARIKO_4266_NO_ADJ_ERISTA = 1,
enum MtcConfig: u32 {
AUTO_ADJ_SAFE_MARIKO_ONLY = 0,
AUTO_ADJ_4266_MARIKO_ONLY = 1,
NO_ADJ_ALL = 2,
CUSTOMIZED_ALL = 3,
};
typedef struct __attribute__((packed)) CustomizeTable {
using CustomizeCpuDvfsTable = pcv::cvb_entry_t[pcv::DvfsTableEntryLimit];
using CustomizeGpuDvfsTable = pcv::cvb_entry_t[pcv::DvfsTableEntryLimit];
static_assert(sizeof(CustomizeCpuDvfsTable) == sizeof(CustomizeGpuDvfsTable));
static_assert(sizeof(CustomizeCpuDvfsTable) == sizeof(pcv::cvb_entry_t) * pcv::DvfsTableEntryLimit);
constexpr uint32_t ERISTA_MTC_MAGIC = 0x43544D45; // EMTC
constexpr uint32_t MARIKO_MTC_MAGIC = 0x43544D4D; // MMTC
typedef struct CustomizeTable {
u8 cust[4] = {'C', 'U', 'S', 'T'};
u16 custRev = CUST_REV;
u16 mtcConf = AUTO_ADJ_MARIKO_SAFE_NO_ADJ_ERISTA;
u32 marikoCpuMaxClock;
u32 marikoCpuBoostClock;
u32 marikoCpuMaxVolt;
u32 marikoGpuMaxClock;
u32 marikoEmcMaxClock;
u32 marikoEmcVddqVolt;
u32 custRev = CUST_REV;
u32 mtcConf;
u32 commonCpuBoostClock;
u32 commonEmcMemVolt;
u32 eristaCpuMaxVolt;
u32 eristaEmcMaxClock;
u32 commonEmcMemVolt;
u32 marikoCpuMaxVolt;
u32 marikoEmcMaxClock;
u32 marikoEmcVddqVolt;
CustomizeCpuDvfsTable eristaCpuDvfsTable;
CustomizeCpuDvfsTable marikoCpuDvfsTable;
CustomizeGpuDvfsTable eristaGpuDvfsTable;
CustomizeGpuDvfsTable marikoGpuDvfsTable;
EristaMtcTable* eristaMtcTable;
MarikoMtcTable* marikoMtcTable;
} CustomizeTable;
static_assert(sizeof(CustomizeTable) == sizeof(u8) * 4 + sizeof(u32) * 9 + sizeof(CustomizeCpuDvfsTable) * 4 + sizeof(void*) * 2);
static_assert(sizeof(CustomizeTable) == 7000);
extern volatile CustomizeTable C;
extern volatile EristaMtcTable EristaMtcTablePlaceholder;
extern volatile MarikoMtcTable MarikoMtcTablePlaceholder;
}