PCV services: Difference between revisions

No edit summary
No edit summary
 
(27 intermediate revisions by 2 users not shown)
Line 16: Line 16:
| 4 || [[#GetAcOk]]
| 4 || [[#GetAcOk]]
|-
|-
| 5 || [[#GetBoardPowerControlEvent]]
| 5 || [[#GetPowerEvent]]
|-
|-
| 6 || [2.0.0+] [[#GetSleepButtonState]]
| 6 || [2.0.0-13.2.1] [[#GetSleepButtonState]]
|-
|-
| 7 || [2.0.0+] [[#GetPowerEvent]]
| 7 || [2.0.0+] [[#GetPowerButtonEvent]]
|-
|-
| 8 || [2.0.0-9.2.0] [[#CreateWakeupTimer]]
| 8 || [2.0.0-9.2.0] [[#CreateWakeupTimer]]
Line 36: Line 36:
| 14 || [6.0.0+] [[#GetPowerButton]]
| 14 || [6.0.0+] [[#GetPowerButton]]
|-
|-
| 15 || [10.0.0+] [[#SetEnableWakeupTimer]]
| 15 || [10.0.0+] [[#SetUpRtcResetOnShutdown]]
|}
|}


Line 54: Line 54:
No input. Returns an output bool.
No input. Returns an output bool.


== GetBoardPowerControlEvent ==
== GetPowerEvent ==
Takes an input [[#BoardPowerControlEventTarget|BoardPowerControlEventTarget]]. Returns an output Event handle.
Takes an input [[#BoardPowerControlEventTarget|BoardPowerControlEventTarget]]. Returns an output Event handle.


Line 60: Line 60:
No input. Returns an output [[#SleepButtonState|SleepButtonState]].
No input. Returns an output [[#SleepButtonState|SleepButtonState]].


== GetPowerEvent ==
== GetPowerButtonEvent ==
Takes an input [[#EventTarget|EventTarget]]. Returns an output Event handle.
Takes an input [[#EventTarget|EventTarget]]. Returns an output Event handle.


Line 86: Line 86:
No input. Returns an output bool '''IsPushed'''.
No input. Returns an output bool '''IsPushed'''.


== SetEnableWakeupTimer ==
== SetUpRtcResetOnShutdown ==
Unofficial name.
 
No input/output. Enables an internal wakeup timer when calling [[#ShutdownSystem|ShutdownSystem]] or [[#RebootSystem|RebootSystem]].
No input/output. Enables an internal wakeup timer when calling [[#ShutdownSystem|ShutdownSystem]] or [[#RebootSystem|RebootSystem]].


Line 143: Line 141:
| 4 || [[#GetAcOk]]
| 4 || [[#GetAcOk]]
|-
|-
| 5 || [[#GetBoardPowerControlEvent]]
| 5 || [[#GetPowerEvent]]
|}
|}


Line 157: Line 155:
| 0 || [[#GetSleepButtonState]]
| 0 || [[#GetSleepButtonState]]
|-
|-
| 1 || [[#GetPowerEvent]]
| 1 || [[#GetPowerButtonEvent]]
|}
|}


Line 376: Line 374:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#OpenSession]]
| 0 || [[#OpenSession|OpenSession]]
|-
|-
| 1 || GetTemperatureThresholds
| 1 || [[#GetTemperatureThresholds|GetTemperatureThresholds]]
|-
|-
| 2 || SetTemperature
| 2 || [[#NotifyTemperature|NotifyTemperature]]
|-
|-
| 3 ||  
| 3 || [[#GetClkrstStateTable|GetClkrstStateTable]]
|-
|-
| 4 ||  
| 4 || [[#GetClkrstStateTableUpdateEvent|GetClkrstStateTableUpdateEvent]]
|-
|-
| 5 || [[#GetClockModuleNumLimit]]
| 5 || [[#GetClkrstStateTableCount|GetClkrstStateTableCount]]
|-
| 6 || [15.0.0+] PrintClockTree
|-
| 7 || [20.0.0+]
|}
|}


Line 392: Line 394:
Takes an input [[#Module|DeviceCode]] and an input u32. Returns an [[#IClkrstSession]].
Takes an input [[#Module|DeviceCode]] and an input u32. Returns an [[#IClkrstSession]].


== GetClockModuleNumLimit ==
== NotifyTemperature ==
Returns 0x1A.
Takes an input float. No output.
 
== GetClkrstStateTable ==
Takes a type-0xA output buffer of [[#ModuleState|ModuleState]] and an input s32 '''MaxCount'''. Returns an output s32 '''OutCount'''.
 
[7.0.0+] The type-0xA output buffer was replaced with a type-0x22 output buffer.
 
== GetClkrstStateTableUpdateEvent ==
No input. Returns an output Event handle.
 
== GetClkrstStateTableCount ==
No input. Returns 0x1A.


== IClkrstSession ==
== IClkrstSession ==
Line 402: Line 415:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || SetClockEnabled
| 0 || EnableClock
|-
|-
| 1 || SetClockDisabled
| 1 || DisableClock
|-
|-
| 2 || SetResetAsserted
| 2 || AssertReset
|-
|-
| 3 || SetResetDeasserted
| 3 || DeassertReset
|-
|-
| 4 || SetPowerEnabled
| 4 || EnablePower
|-
|-
| 5 || SetPowerDisabled
| 5 || DisablePower
|-
|-
| 6 || GetState
| 6 || GetModuleState
|-
|-
| 7 || SetClockRate
| 7 || SetClockRate
Line 420: Line 433:
| 8 || GetClockRate
| 8 || GetClockRate
|-
|-
| 9 || SetMinVClockRate
| 9 || SetMinimumVoltageClockRate
|-
|-
| 10 || GetPossibleClockRates
| 10 || GetPossibleClockRates
|-
|-
| 11 || GetDvfsTable
| 11 || GetDvfsTable
|-
| 12 || [14.0.0+] IsParentClock
|-
| 13 || [14.0.0+] SetParentClock
|-
| 14 || [18.0.0+]
|-
| 15 || [18.0.0+]
|}
|}


Line 451: Line 472:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#OpenSession]]
| 0 || [[#OpenSession_2|OpenSession]]
|-
|-
| 1 ||  
| 1 || [[#GetRegulatorStateTable|GetRegulatorStateTable]]
|-
|-
| 2 ||  
| 2 || [[#GetRegulatorStateTableUpdateEvent|GetRegulatorStateTableUpdateEvent]]
|-
|-
| 3 || [[#GetPowerModuleNumLimit]]
| 3 || [[#GetRegulatorStateTableCount|GetRegulatorStateTableCount]]
|}
|}


Line 463: Line 484:
Takes an input [[#PowerDomain|DeviceCode]] and returns an [[#IRegulatorSession]].
Takes an input [[#PowerDomain|DeviceCode]] and returns an [[#IRegulatorSession]].


== GetPowerModuleNumLimit ==
== GetRegulatorStateTable ==
Returns 0x3.
Takes a type-0xA output buffer of [[#PowerDomainState|PowerDomainState]] and an input s32 '''MaxCount'''. Returns an output s32 '''OutCount'''.
 
[7.0.0+] The type-0xA output buffer was replaced with a type-0x22 output buffer.
 
== GetRegulatorStateTableUpdateEvent ==
No input. Returns an output Event handle.
 
== GetRegulatorStateTableCount ==
No input. Returns 0x3.


== IRegulatorSession ==
== IRegulatorSession ==
Line 473: Line 502:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || SetVoltageEnabled
| 0 || RequestOutput
|-
| 1 || CancelOutputRequest
|-
| 2 || IsOutputEnabled
|-
| 3 || GetVoltageRangeInMicroVolt
|-
|-
| 1 ||
| 4 || GetVoltageInMicroVolt
|-
|-
| 2 || GetVoltageEnabled
| 5 || RequestVoltageInMicroVolt
|-
|-
| 3 || GetVoltageRange
| 6 || CancelVoltageRequest
|-
|-
| 4 || GetVoltageValue
| 7 || [13.0.0+] [[#GetMinimumOffStateHoldTime|GetMinimumOffStateHoldTime]]
|-
|-
| 5 || SetVoltageValue
| 8 || [13.0.0+] [[#RequestMinimumOffStateHoldTime|RequestMinimumOffStateHoldTime]]
|-
|-
| 6 || ChangeVoltage
| 9 || [13.0.0+] [[#CancelMinimumOffStateHoldTimeRequest|CancelMinimumOffStateHoldTimeRequest]]
|}
|}
=== GetMinimumOffStateHoldTime ===
No input. Returns an output u64.
=== RequestMinimumOffStateHoldTime ===
Takes an input u64. No output.
=== CancelMinimumOffStateHoldTimeRequest ===
No input/output.


= rtc =
= rtc =
This is "nn::rtc::IRtcManager".
This was added with [8.0.0+].
This was added with [8.0.0+].


Line 495: Line 541:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetRtcTime_2|GetRtcTime]]
| 0 || [[#GetTimeInSeconds|GetTimeInSeconds]]
|-
|-
| 1 || [[#SetRtcTime_2|SetRtcTime]]
| 1 || [[#SetTimeInSeconds|SetTimeInSeconds]]
|-
|-
| 2 || [[#SetUpRtcResetOnShutdown_2|SetUpRtcResetOnShutdown]]
| 2 || [[#SetResetOnShutdown|SetResetOnShutdown]]
|-
|-
| 3 || [[#GetRtcResetDetected_2|GetRtcResetDetected]]
| 3 || [[#GetResetDetected|GetResetDetected]]
|-
|-
| 4 || [[#ClearRtcResetDetected_2|ClearRtcResetDetected]]
| 4 || [[#ClearResetDetected|ClearResetDetected]]
|-
|-
| 10 || [10.0.0+]
| 10 || [10.0.0+] [[#EnableAlarm|EnableAlarm]]
|-
|-
| 11 || [10.0.0+]  
| 11 || [10.0.0+] [[#DisableRtcAlarm|DisableRtcAlarm]]
|-
| 12 || [18.0.0+]
|-
| 13 || [18.0.0+]  
|}
|}


== GetRtcTime ==
[20.0.0+] Cmd13 now takes a total of 4-bytes of input instead of 8-bytes and returns a total of 2-bytes of output.
 
== GetTimeInSeconds ==
Same as [[#GetRtcTime|GetRtcTime]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).
Same as [[#GetRtcTime|GetRtcTime]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).


== SetRtcTime ==
== SetTimeInSeconds ==
Same as [[#SetRtcTime|SetRtcTime]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).
Same as [[#SetRtcTime|SetRtcTime]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).


== SetUpRtcResetOnShutdown ==
== SetResetOnShutdown ==
Takes an input bool '''DoReset''' and an input [[Bus_services#I2cDevice|DeviceCode]]. Similar to [[#SetUpRtcResetOnShutdown|SetUpRtcResetOnShutdown]], but this version assigns the provided boolean value on a per-client basis (instead of a global variable) and checks it when the current [[PSC_services#Power_Management_States|power state]] is '''ReadyShutdown'''.
Takes an input bool '''DoReset''' and an input [[Bus_services#I2cDevice|DeviceCode]]. Similar to [[#SetUpRtcResetOnShutdown|SetUpRtcResetOnShutdown]], but this version assigns the provided boolean value on a per-client basis (instead of a global variable) and checks it when the current [[PSC_services#Power_Management_States|power state]] is '''ReadyShutdown'''.


== GetRtcResetDetected ==
== GetResetDetected ==
Same as [[#GetRtcResetDetected|GetRtcResetDetected]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).
Same as [[#GetRtcResetDetected|GetRtcResetDetected]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).


== ClearRtcResetDetected ==
== ClearResetDetected ==
Same as [[#ClearRtcResetDetected|ClearRtcResetDetected]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).
Same as [[#ClearRtcResetDetected|ClearRtcResetDetected]], but takes an input [[Bus_services#I2cDevice|DeviceCode]] ([[#bpc:r|bpc:r]] uses hardcoded value 0x3B000001).
== EnableAlarm ==
Takes an input [[#Module|DeviceCode]], an input u32 '''RtcAlarmId''' (0 = RtcAlarm1, 1 = RtcAlarm2) and an u64 '''RtcAlarmTime'''. No output.
== DisableAlarm ==
Takes an input [[#Module|DeviceCode]] and an input u32 '''RtcAlarmId''' (0 = RtcAlarm1, 1 = RtcAlarm2). No output.


= time:u, time:a, time:s =
= time:u, time:a, time:s =
Line 920: Line 978:
|-
|-
| [6.0.0+] 86 || Extperiph2 || 0x40000057 || VddSoc
| [6.0.0+] 86 || Extperiph2 || 0x40000057 || VddSoc
|-
| [8.0.0+] - || OscClk || 0x40000080 || None
|}
|}


Line 935: Line 995:
| 2 || Max77620_Sd2 || 0x3A000082 || Ldo0, Ldo1, Ldo7, Ldo8 (1.325v)
| 2 || Max77620_Sd2 || 0x3A000082 || Ldo0, Ldo1, Ldo7, Ldo8 (1.325v)
|-
|-
| 3 || Max77620_Sd3 || 0x3A000083 || 1.8v
| 3 || Max77620_Sd3 || 0x3A000083 || Reserved (1.8v)
|-
|-
| 4 || Max77620_Ldo0 || 0x3A0000A0 || Panel (1.2v)
| 4 || Max77620_Ldo0 || 0x3A0000A0 || Panel (1.2v)
Line 943: Line 1,003:
| 6 || Max77620_Ldo2 || 0x3A0000A2 || SdCard (1.8v, 3.3v)
| 6 || Max77620_Ldo2 || 0x3A0000A2 || SdCard (1.8v, 3.3v)
|-
|-
| 7 || Max77620_Ldo3 || 0x3A0000A3 || GcAsic (3.1v)
| 7 || Max77620_Ldo3 || 0x3A0000A3 || GcCard (3.1v)
|-
|-
| 8 || Max77620_Ldo4 || 0x3A0000A4 || Rtc (0.85v)
| 8 || Max77620_Ldo4 || 0x3A0000A4 || Rtc (0.85v)
Line 949: Line 1,009:
| 9 || Max77620_Ldo5 || 0x3A0000A5 || GcCard (1.8v)
| 9 || Max77620_Ldo5 || 0x3A0000A5 || GcCard (1.8v)
|-
|-
| 10 || Max77620_Ldo6 || 0x3A0000A6 || Touchscreen, ALS (2.9v)
| 10 || Max77620_Ldo6 || 0x3A0000A6 || TouchPanel, ALS (2.9v)
|-
|-
| 11 || Max77620_Ldo7 || 0x3A0000A7 || Xusb (1.05v)
| 11 || Max77620_Ldo7 || 0x3A0000A7 || Xusb (1.05v)
Line 966: Line 1,026:
|}
|}


= ClockRatesListType =
= PowerControlTarget =
This is "nn::pcv::ClockRatesListType".
This is "nn::pcv::PowerControlTarget".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value || Description
! Value || Name || DeviceCode || Description
|-
| 0 || || 0x3C000004 || SdCard (Ldo2)
|-
| [6.0.0+] 1 || || 0x34000007 || DisplayPort, HDMI (Ldo8)
|-
| [6.0.0+] 2 || || || Debug (Ldo7, Hoag only)
|-
|-
| 0 || Invalid
| [6.0.0+] 3 || || 0x3500041A || SioMcu (Ldo8, Hoag only)
|-
|-
| 1 || Discrete
| [14.0.0+] - || || 0x3C000404 || GcCard (Ldo3)
|-
|-
| 2 || Range
| [14.0.0+] - || || 0x3C000405 || GcCard (Ldo5)
|}
|}


= ModuleState =
= ModuleState =
This is "nn::pcv::ModuleState".
This is "nn::pcv::ModuleState". This is a 0xC-byte struct.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 998: Line 1,064:
|-
|-
| 0x8 || 0x4 || MinVClockRate
| 0x8 || 0x4 || MinVClockRate
|}
= PowerDomainState =
This is "nn::pcv::PowerDomainState". This is a 0x8-byte struct.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Enabled
|-
| 0x1 || 0x3 || Reserved
|-
| 0x4 || 0x4 || Voltage
|}
[8.0.0+] This is a 0xC-byte struct.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || DeviceCode
|-
| 0x4 || 0x1 || Enabled
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x4 || Voltage
|}
|}


= TemperatureThreshold =
= TemperatureThreshold =
This is "nn::pcv::TemperatureThreshold".
This is "nn::pcv::TemperatureThreshold". This is a 0x8-byte struct.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,012: Line 1,106:
|}
|}


= PowerControlTarget =
= ClockRatesListType =
This is "nn::pcv::PowerControlTarget".
This is "nn::pcv::ClockRatesListType".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value || Name || DeviceCode || Description
! Value || Description
|-
|-
| 0 || || 0x3C000004 || SdCard
| 0 || Invalid
|-
|-
| 1 || || 0x34000007 || DisplayPort, HDMI
| 1 || Discrete
|-
|-
| 2 || || ||
| 2 || Range
|-
| 3 || || 0x3500041A || SioMcu
|}
|}
= PowerDomainState =
This is "nn::pcv::PowerDomainState".


= SteadyClockTimePoint =
= SteadyClockTimePoint =