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:
@@ -17,6 +17,8 @@
|
||||
#include "clocks.h"
|
||||
#include <nxExt/cpp/lockable_mutex.h>
|
||||
|
||||
#include "oc_extra.h"
|
||||
|
||||
class ClockManager
|
||||
{
|
||||
public:
|
||||
@@ -32,64 +34,6 @@ class ClockManager
|
||||
SysClkContext GetCurrentContext();
|
||||
Config* GetConfig();
|
||||
|
||||
typedef enum {
|
||||
PDCtrler_NewPDO = 1, //Received new Power Data Object
|
||||
PDCtrler_NoPD = 2, //No Power Delivery source is detected
|
||||
PDCtrler_AcceptedRDO = 3 //Received and accepted Request Data Object
|
||||
} ChargeInfoPDCtrler; //BM92T series
|
||||
|
||||
typedef enum {
|
||||
PowerRole_Sink = 1,
|
||||
PowerRole_Source = 2
|
||||
} ChargeInfoPowerRole;
|
||||
|
||||
typedef enum {
|
||||
ChargerType_None = 0,
|
||||
ChargerType_PD = 1,
|
||||
ChargerType_TypeC_1500mA = 2,
|
||||
ChargerType_TypeC_3000mA = 3,
|
||||
ChargerType_DCP = 4,
|
||||
ChargerType_CDP = 5,
|
||||
ChargerType_SDP = 6,
|
||||
ChargerType_Apple_500mA = 7,
|
||||
ChargerType_Apple_1000mA = 8,
|
||||
ChargerType_Apple_2000mA = 9
|
||||
} ChargeInfoChargerType;
|
||||
|
||||
typedef enum {
|
||||
Flags_NoHub = BIT(0), //If hub is disconnected
|
||||
Flags_Rail = BIT(8), //At least one Joy-con is charging from rail
|
||||
Flags_SPDSRC = BIT(12), //OTG
|
||||
Flags_ACC = BIT(16) //Accessory
|
||||
} ChargeInfoFlags;
|
||||
|
||||
typedef struct {
|
||||
int32_t InputCurrentLimit; //Input (Sink) current limit in mA
|
||||
int32_t VBUSCurrentLimit; //Output (Source/VBUS/OTG) current limit in mA
|
||||
int32_t ChargeCurrentLimit; //Battery charging current limit in mA (512mA when Docked, 768mA when BatteryTemperature < 17.0 C)
|
||||
int32_t ChargeVoltageLimit; //Battery charging voltage limit in mV (3952mV when BatteryTemperature >= 51.0 C)
|
||||
int32_t unk_x10; //Possibly an emum, getting the same value as PowerRole in all tested cases
|
||||
int32_t unk_x14; //Possibly flags
|
||||
ChargeInfoPDCtrler PDCtrlerState; //Power Delivery Controller State
|
||||
int32_t BatteryTemperature; //Battery temperature in milli C
|
||||
int32_t RawBatteryCharge; //Raw battery charged capacity per cent-mille (i.e. 100% = 100000 pcm)
|
||||
int32_t VoltageAvg; //Voltage avg in mV (more in Notes)
|
||||
int32_t BatteryAge; //Battery age (capacity full / capacity design) per cent-mille (i.e. 100% = 100000 pcm)
|
||||
ChargeInfoPowerRole PowerRole;
|
||||
ChargeInfoChargerType ChargerType;
|
||||
int32_t ChargerVoltageLimit; //Charger and external device voltage limit in mV
|
||||
int32_t ChargerCurrentLimit; //Charger and external device current limit in mA
|
||||
ChargeInfoFlags Flags; //Unknown flags
|
||||
} ChargeInfo;
|
||||
|
||||
typedef enum {
|
||||
EnableBatteryCharging = 2,
|
||||
DisableBatteryCharging = 3,
|
||||
EnableFastBatteryCharging = 10,
|
||||
DisableFastBatteryCharging = 11,
|
||||
GetBatteryChargeInfoFields = 17,
|
||||
} IPsmServerCmd;
|
||||
|
||||
protected:
|
||||
ClockManager();
|
||||
virtual ~ClockManager();
|
||||
@@ -105,16 +49,10 @@ class ClockManager
|
||||
std::uint64_t lastCsvWriteNs;
|
||||
|
||||
SysClkOcExtra *oc;
|
||||
ReverseNXSync *rnxSync;
|
||||
Governor *governor;
|
||||
|
||||
bool IsCpuBoostMode();
|
||||
|
||||
uint32_t GetHz(SysClkModule);
|
||||
|
||||
SysClkProfile ReverseNXProfileHandler();
|
||||
ReverseNXMode ReverseNXFileHandler(const char*);
|
||||
ReverseNXMode GetReverseNXToolMode();
|
||||
ReverseNXMode GetReverseNXMode();
|
||||
|
||||
void ChargingHandler();
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user