Updated: Sys-clk-OC, Loader, System_settings

- Sys-clk-OC

  - Major cleanup in clock_manager, preparing to add basic Erista support.

  - Added an experimental CPU & GPU frequency governor.

    - Known issue:

      - Occasional stuttering is expected: GPU load% metric PMU_GET_GPU_LOAD does not reflect real utilization precisely. Use another metric, some interpolation algo or add min frequency option for improvement.

- Loader

  - Addressed an issue for Erista variants: Boot with unmodified Fusee or Hekate, nn::pcv::EmcDvfsPeriodicCompHandler will fail with rc 0x8C5. Fixed by removing 40.8 MHz while retaining 1600.0 MHz MEM table -- however, this means user has to use modified sys-clk.
This commit is contained in:
KazushiM
2022-10-23 23:01:50 +08:00
parent d596016c84
commit b52bef3c31
27 changed files with 925 additions and 433 deletions

View File

@@ -22,6 +22,7 @@ typedef enum {
SysClkConfigValue_AllowUnsafeFrequencies,
SysClkConfigValue_DisableFastCharging,
SysClkConfigValue_ChargingLimitPercentage,
SysClkConfigValue_GovernorExperimental,
SysClkConfigValue_EnumMax,
} SysClkConfigValue;
@@ -49,6 +50,8 @@ static inline const char* sysclkFormatConfigValue(SysClkConfigValue val, bool pr
return pretty ? "Disable Fast Charging" : "disable_fast_charging";
case SysClkConfigValue_ChargingLimitPercentage:
return pretty ? "Charging Limit (%%)" : "charging_limit_perc";
case SysClkConfigValue_GovernorExperimental:
return pretty ? "Governor (Experimental)" : "governor_experimental";
default:
return NULL;
}
@@ -64,6 +67,7 @@ static inline uint64_t sysclkDefaultConfigValue(SysClkConfigValue val)
case SysClkConfigValue_CsvWriteIntervalMs:
case SysClkConfigValue_AllowUnsafeFrequencies:
case SysClkConfigValue_DisableFastCharging:
case SysClkConfigValue_GovernorExperimental:
return 0ULL;
case SysClkConfigValue_AutoCPUBoost:
case SysClkConfigValue_SyncReverseNXMode:
@@ -88,6 +92,7 @@ static inline uint64_t sysclkValidConfigValue(SysClkConfigValue val, uint64_t in
case SysClkConfigValue_SyncReverseNXMode:
case SysClkConfigValue_AllowUnsafeFrequencies:
case SysClkConfigValue_DisableFastCharging:
case SysClkConfigValue_GovernorExperimental:
return (input & 0x1) == input;
case SysClkConfigValue_ChargingLimitPercentage:
return (input <= 100 && input >= 20);