hocclk/ldr: add kip migration skeleton
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define CUST_REV 3
|
||||
#define KIP_VERSION 231
|
||||
#define CUST_REV 4
|
||||
#define KIP_VERSION 240
|
||||
|
||||
#include "oc_common.hpp"
|
||||
#include "pcv/pcv_common.hpp"
|
||||
|
||||
@@ -76,6 +76,7 @@ typedef enum {
|
||||
HocClkConfigValue_MarikoMiddleFreqs,
|
||||
|
||||
KipConfigValue_custRev,
|
||||
KipConfigValue_KipVersion,
|
||||
// KipConfigValue_mtcConf,
|
||||
KipConfigValue_hpMode,
|
||||
|
||||
@@ -289,6 +290,8 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
|
||||
// KIP config values
|
||||
case KipConfigValue_custRev:
|
||||
return pretty ? "Custom Revision" : "kip_cust_rev";
|
||||
case KipConfigValue_KipVersion:
|
||||
return pretty ? "KIP Version" : "kip_version";
|
||||
// case KipConfigValue_mtcConf:
|
||||
// return pretty ? "MTC Config" : "kip_mtc_conf";
|
||||
case KipConfigValue_hpMode:
|
||||
@@ -549,7 +552,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
|
||||
case HocClkConfigValue_GPUSchedulingMethod:
|
||||
case HocClkConfigValue_MarikoMiddleFreqs:
|
||||
return (input & 0x1) == input;
|
||||
|
||||
case KipConfigValue_KipVersion:
|
||||
case KipConfigValue_custRev:
|
||||
// case KipConfigValue_mtcConf:
|
||||
case KipConfigValue_hpMode:
|
||||
|
||||
@@ -39,7 +39,7 @@ include ${TOPDIR}/lib/libultrahand/ultrahand.mk
|
||||
# version control constants
|
||||
#---------------------------------------------------------------------------------
|
||||
#TARGET_VERSION := $(shell git describe --dirty --always --tags)
|
||||
APP_VERSION := 2.3.1 # ensure to set KIP_VERSION and CUST_REV in sysmodule Makefile when updating this
|
||||
APP_VERSION := 2.4.0 # ensure to set KIP_VERSION and CUST_REV in sysmodule Makefile when updating this
|
||||
TARGET_VERSION := $(APP_VERSION)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
@@ -28,9 +28,9 @@ INCLUDES := ../common/include src/hos src/soc src/i2c src/util src/pwr src/ipc
|
||||
EXEFS_SRC := exefs_src
|
||||
LIBNAMES := minIni
|
||||
# major minor patch
|
||||
TARGET_VERSION := 2.3.1
|
||||
KIP_VERSION := 231
|
||||
CUST_REV := 3
|
||||
TARGET_VERSION := 2.4.0
|
||||
KIP_VERSION := 240
|
||||
CUST_REV := 4
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace kip {
|
||||
|
||||
bool kipAvailable = false;
|
||||
|
||||
void SetKipData()
|
||||
{
|
||||
// TODO: figure out if this REALLY causes issues (i doubt it)
|
||||
@@ -74,7 +73,7 @@ namespace kip {
|
||||
CUST_WRITE_FIELD_BATCH(&table, eristaEmcMaxClock, config::GetConfigValue(KipConfigValue_eristaEmcMaxClock));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoEmcMaxClock, config::GetConfigValue(KipConfigValue_marikoEmcMaxClock));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoEmcVddqVolt, config::GetConfigValue(KipConfigValue_marikoEmcVddqVolt));
|
||||
CUST_WRITE_FIELD_BATCH(&table, emcDvbShift, config::GetConfigValue(KipConfigValue_emcDvbShift) > 8 && config::GetConfigValue(KipConfigValue_emcDvbShift) <= 16 ? 8 : config::GetConfigValue(KipConfigValue_emcDvbShift)); // 2.2.0 -> 2.3.0 compat
|
||||
CUST_WRITE_FIELD_BATCH(&table, emcDvbShift, config::GetConfigValue(KipConfigValue_emcDvbShift));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoSocVmax, config::GetConfigValue(KipConfigValue_marikoSocVmax));
|
||||
|
||||
CUST_WRITE_FIELD_BATCH(&table, t1_tRCD, config::GetConfigValue(KipConfigValue_t1_tRCD));
|
||||
@@ -191,6 +190,7 @@ namespace kip {
|
||||
// }
|
||||
|
||||
if ((u64)crc32::checksum_file("sdmc:/atmosphere/kips/hoc.kip") != config::GetConfigValue(KipCrc32) && !config::GetConfigValue(HocClkConfigValue_IsFirstLoad)) {
|
||||
MigrateKipData(cust_get_cust_rev(&table), cust_get_kip_version(&table));
|
||||
SetKipData();
|
||||
notification::writeNotification("Horizon OC\nKIP has been updated\nPlease reboot your console");
|
||||
return;
|
||||
@@ -220,13 +220,14 @@ namespace kip {
|
||||
|
||||
clockManager::gContext.kipVersion = kipVersion;
|
||||
configValues.values[KipConfigValue_custRev] = cust_get_cust_rev(&table);
|
||||
configValues.values[KipConfigValue_KipVersion] = cust_get_kip_version(&table); // Run this after the check so we can do migration process
|
||||
configValues.values[KipConfigValue_hpMode] = cust_get_hp_mode(&table);
|
||||
|
||||
configValues.values[KipConfigValue_commonEmcMemVolt] = cust_get_common_emc_volt(&table);
|
||||
configValues.values[KipConfigValue_eristaEmcMaxClock] = cust_get_erista_emc_max(&table);
|
||||
configValues.values[KipConfigValue_marikoEmcMaxClock] = cust_get_mariko_emc_max(&table);
|
||||
configValues.values[KipConfigValue_marikoEmcVddqVolt] = cust_get_mariko_emc_vddq(&table);
|
||||
configValues.values[KipConfigValue_emcDvbShift] = cust_get_emc_dvb_shift(&table) > 8 && cust_get_emc_dvb_shift(&table) <= 16 ? 8 : cust_get_emc_dvb_shift(&table); // 2.2.0 -> 2.3.0 compat
|
||||
configValues.values[KipConfigValue_emcDvbShift] = cust_get_emc_dvb_shift(&table);
|
||||
configValues.values[KipConfigValue_marikoSocVmax] = cust_get_marikoSocVmax(&table);
|
||||
|
||||
configValues.values[KipConfigValue_t1_tRCD] = cust_get_tRCD(&table);
|
||||
@@ -302,5 +303,16 @@ namespace kip {
|
||||
notification::writeNotification("Horizon OC\nConfig Buffer Mismatch");
|
||||
}
|
||||
}
|
||||
|
||||
void MigrateKipData(u32 custRev, u32 version) {
|
||||
HocClkConfigValueList configValues;
|
||||
config::GetConfigValues(&configValues);
|
||||
u32 previousVersion = configValues.values[KipConfigValue_KipVersion];
|
||||
if(previousVersion == 0) {
|
||||
return; // We cannot migrate anything!
|
||||
}
|
||||
|
||||
// This function cannot do anything at the moment. The capabilities will be expanded in the next release
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ namespace kip {
|
||||
DECL_MARIKO_GPU_VOLT_GET(1459200, 21)
|
||||
DECL_MARIKO_GPU_VOLT_GET(1497600, 22)
|
||||
DECL_MARIKO_GPU_VOLT_GET(1536000, 23)
|
||||
|
||||
void MigrateKipData(u32 custRev, u32 version);
|
||||
void SetKipData();
|
||||
void GetKipData();
|
||||
}
|
||||
Reference in New Issue
Block a user