Difference between revisions of "PCV services"

From Nintendo Switch Brew
Jump to navigation Jump to search
 
(45 intermediate revisions by 8 users not shown)
Line 18: Line 18:
 
| 5 || GetBoardPowerControlEvent
 
| 5 || GetBoardPowerControlEvent
 
|-
 
|-
| 6 || GetSleepButtonState
+
| 6 || [2.0.0+] GetSleepButtonState
 
|-
 
|-
| 7 || GetPowerEvent
+
| 7 || [2.0.0+] GetPowerEvent
 
|-
 
|-
| 8 ||
+
| 8 || [2.0.0-9.2.0] CreateWakeupTimer
 
|-
 
|-
| 9 ||
+
| 9 || [2.0.0-9.2.0] CancelWakeupTimer
 
|-
 
|-
| 10 ||
+
| 10 || [2.0.0-9.2.0] [[#EnableWakeupTimerOnDevice]]
 +
|-
 +
| 11 || [3.0.0-9.2.0] CreateWakeupTimerEx
 +
|-
 +
| 12 || [3.0.0-9.2.0] GetLastEnabledWakeupTimerType
 +
|-
 +
| 13 || [3.0.0-9.2.0] CleanAllWakeupTimers
 +
|-
 +
| 14 || [6.0.0+]
 +
|-
 +
| 15 || [10.0.0+]
 
|}
 
|}
 +
 +
== EnableWakeupTimerOnDevice ==
 +
No input, returns a total of 0x10-bytes of output. [3.0.0+] Now returns a total of 0xC-bytes of output.
  
 
= bpc:r =
 
= bpc:r =
Line 36: Line 49:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || GetExternalRtcValue
+
| 0 || GetRtcTime
 
|-
 
|-
| 1 || SetExternalRtcValue
+
| 1 || SetRtcTime
 
|-
 
|-
| 2 || ReadExternalRtcResetFlag
+
| 2 || GetRtcResetDetected
 
|-
 
|-
| 3 || ClearExternalRtcResetFlag
+
| 3 || [2.0.0+] ClearRtcResetDetected
 +
|-
 +
| 4 || [3.0.0+] SetUpRtcResetOnShutdown
 
|}
 
|}
  
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.
+
= bpc:c =
 +
This is "nn::bpc::IBoardPowerControlManager".
  
= pcv =
+
[2.0.0+] This service was replaced by [[#bpc|bpc]].
This is "nn::pcv::detail::IPcvService".
 
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 54: Line 69:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || SetPowerEnabled
+
| 0 || ShutdownSystem
 
|-
 
|-
| 1 || SetClockEnabled
+
| 1 || RebootSystem
 
|-
 
|-
| 2 || SetClockRate
+
| 2 || GetWakeupReason
 
|-
 
|-
| 3 || GetClockRate
+
| 3 || GetShutdownReason
 
|-
 
|-
| 4 || GetState
+
| 4 || GetAcOk
 
|-
 
|-
| 5 || GetPossibleClockRates
+
| 5 || GetBoardPowerControlEvent
 +
|}
 +
 
 +
= bpc:b =
 +
This is "nn::bpc::IPowerButtonManager".
 +
 
 +
[2.0.0+] This service was merged into [[#bpc|bpc]].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 6 || SetMinVClockRate
+
! Cmd || Name
|-
 
| 7 || SetReset
 
|-
 
| 8 || SetVoltageEnabled
 
|-
 
| 9 || GetVoltageEnabled
 
|-
 
| 10 || GetVoltageRange
 
|-
 
| 11 || SetVoltageValue
 
|-
 
| 12 || GetVoltageValue
 
|-
 
| 13 || GetTemperatureThresholds
 
|-
 
| 14 || SetTemperature
 
|-
 
| 15 || Initialize
 
|-
 
| 16 || IsInitialized
 
 
|-
 
|-
| 17 || Finalize
+
| 0 || GetSleepButtonState
|-
 
| 18 || PowerOn
 
|-
 
| 19 || PowerOff
 
|-
 
| 20 || ChangeVoltage
 
|-
 
| 21 || GetPowerClockInfoEvent
 
|-
 
| 22 || GetOscillatorClock
 
|-
 
| 23 || GetDvfsTable
 
|-
 
| 24 || GetModuleStateTable
 
|-
 
| 25 || GetPowerDomainStateTable
 
|-
 
| 26 || GetFuseInfo
 
 
|-
 
|-
 +
| 1 || GetPowerEvent
 
|}
 
|}
  
== User Name to Block Maps ==
+
= bpc:w =
 +
This is "nn::bpc::IWakeupConfigManager".
  
=== Power Switch / Clocking / Reset ===
+
[2.0.0+] This service was merged into [[#bpc|bpc]].
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Name || Block || Rail || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || CpuBus || vdd_cpu ||
+
| 0 || CreateWakeupTimer
 
|-
 
|-
| 1 || GPU || vdd_gpu ||
+
| 1 || CancelWakeupTimer
 
|-
 
|-
| 2 || I2S1 || vdd_soc ||
+
| 2 || [[#EnableWakeupTimerOnDevice]]
 +
|}
 +
 
 +
= pcv =
 +
This is "nn::pcv::detail::IPcvService".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
|  3 || I2S2 || vdd_soc ||
+
! Cmd || Name
 
|-
 
|-
| 4 || I2S3 || vdd_soc ||
+
| [1.0.0-7.0.1] 0 || SetPowerEnabled
 
|-
 
|-
| 5 || PWM || vdd_soc ||
+
| [1.0.0-7.0.1] 1 || SetClockEnabled
 
|-
 
|-
| 6 || I2C1 || vdd_soc ||
+
| [1.0.0-7.0.1] 2 || SetClockRate
 
|-
 
|-
| 7 || I2C2 || vdd_soc ||
+
| [1.0.0-7.0.1] 3 || GetClockRate
 
|-
 
|-
| 8 || I2C3 || vdd_soc ||
+
| [1.0.0-7.0.1] 4 || GetState
 
|-
 
|-
| 9 || I2C4 || vdd_soc ||
+
| [1.0.0-7.0.1] 5 || GetPossibleClockRates
 
|-
 
|-
| 10 || I2C5 || vdd_soc ||
+
| [1.0.0-7.0.1] 6 || SetMinVClockRate
 
|-
 
|-
| 11 || I2C6 || vdd_soc ||
+
| [1.0.0-7.0.1] 7 || SetReset
 
|-
 
|-
| 12 || SPI1 || vdd_soc ||
+
| [1.0.0-7.0.1] 8 || SetVoltageEnabled
 
|-
 
|-
| 13 || SPI2 || vdd_soc ||
+
| [1.0.0-7.0.1] 9 || GetVoltageEnabled
 
|-
 
|-
| 14 || SPI3 || vdd_soc ||
+
| [1.0.0-7.0.1] 10 || GetVoltageRange
 
|-
 
|-
| 15 || SPI4 || vdd_soc ||
+
| [1.0.0-7.0.1] 11 || SetVoltageValue
 
|-
 
|-
| 16 || DISP1 || vdd_soc ||
+
| [1.0.0-7.0.1] 12 || GetVoltageValue
 
|-
 
|-
| 17 || DISP2 || vdd_soc ||
+
| [1.0.0-7.0.1] 13 || GetTemperatureThresholds
 
|-
 
|-
| 20 || SDMMC1 || vdd_soc ||
+
| [1.0.0-7.0.1] 14 || SetTemperature
 
|-
 
|-
| 21 || SDMMC2 || vdd_soc ||
+
| [1.0.0-5.1.0] 15 || Initialize
 
|-
 
|-
| 22 || SDMMC3 || vdd_soc ||
+
| [1.0.0-5.1.0] 16 || IsInitialized
 
|-
 
|-
| 23 || SDMMC4 || vdd_soc ||
+
| [1.0.0-5.1.0] 17 || Finalize
 
|-
 
|-
| 24 || - || - || Not actual block. Used for debug and stuff.
+
| [3.0.0-7.0.1] 18 || PowerOn
 
|-
 
|-
| 25 || CSITE || vdd_soc ||
+
| [3.0.0-7.0.1] 19 || PowerOff
 
|-
 
|-
| 26 || TSEC || vdd_soc ||
+
| [3.0.0-7.0.1] 20 || ChangeVoltage
 
|-
 
|-
| 27 || MSELECT || vdd_soc ||
+
| [3.0.0-7.0.1] 21 || GetPowerClockInfoEvent
 
|-
 
|-
| 28 || HDA2CODEC_2X || vdd_soc ||
+
| [3.0.0-7.0.1] 22 || GetOscillatorClock
 
|-
 
|-
| 29 || ACTMON || vdd_soc ||
+
| [3.0.0-7.0.1] 23 || GetDvfsTable
 
|-
 
|-
| 30 || I2C_SLOW || vdd_soc ||
+
| [3.0.0-7.0.1] 24 || GetModuleStateTable
 
|-
 
|-
| 31 || SOR1 || vdd_soc ||
+
| [3.0.0-7.0.1] 25 || GetPowerDomainStateTable
 
|-
 
|-
| 33 || HDA || vdd_soc ||
+
| 26 || [3.0.0+] GetFuseInfo
 
|-
 
|-
| 34 || XUSB_CORE_HOST || vdd_soc ||
+
| 27 || [5.0.0+] GetDramId
 
|-
 
|-
| 35 || XUSB_FALCON || vdd_soc ||
+
| [6.0.0-7.0.1] 28 || [[#IsPoweredOn]]
 
|-
 
|-
| 36 || XUSB_FS || vdd_soc ||
+
| [6.0.0-7.0.1] 29 || [[#GetVoltage]]
 +
|}
 +
 
 +
[7.0.0+] The type-0xA output buffers were replaced with type-0x22 output buffers, for the following: GetDvfsTable, GetModuleStateTable, and GetPowerDomainStateTable.
 +
 
 +
== IsPoweredOn ==
 +
Takes a [[#PowerDomain|PowerDomain]] and returns a bool indicating the status of the requested voltage block.
 +
 
 +
== GetVoltage ==
 +
Takes a [[#PowerDomain|PowerDomain]] and returns an u32 voltage value for the requested voltage block.
 +
 
 +
= pcv:arb =
 +
This is "nn::pcv::IArbitrationManager".
 +
 
 +
This service no longer exists in [8.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 37 || XUSB_CORE_DEV || vdd_soc ||
+
! Cmd || Name
 
|-
 
|-
| 38 || XUSB_SS_HOSTDEV || vdd_soc ||
+
| 0 || ReleaseControl
 +
|}
 +
 
 +
= pcv:imm =
 +
This is "nn::pcv::IImmediateManager".
 +
 
 +
This service no longer exists in [8.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 39 || UARTA || vdd_soc ||
+
! Cmd || Name
 
|-
 
|-
| 40 || UARTB || vdd_soc ||
+
| 0 || SetClockRate
 +
|}
 +
 
 +
= clkrst, clkrst:i =
 +
These are "nn::clkrst::IClkrstManager" and "nn::clkrst::IImmediateManager".
 +
 
 +
These were added with [8.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 41 || UARTC || vdd_soc ||
+
! Cmd || Name
 
|-
 
|-
| 42 || UARTD || vdd_soc ||
+
| 0 || [[#OpenSession]]
 
|-
 
|-
| 43 || HOST1X || vdd_soc ||
+
| 1 || GetTemperatureThresholds
 
|-
 
|-
| 44 || ENTROPY || vdd_soc ||
+
| 2 || SetTemperature
 
|-
 
|-
| 45 || SOC_THERM || vdd_soc ||
+
| 3 || GetPossibleClockRates
 
|-
 
|-
| 46 || VIC || vdd_soc ||
+
| 4 || GetClockInfoEvent
 
|-
 
|-
| 47 || NVENC || vdd_soc ||
+
| 5 || GetClockModuleNumLimit
 +
|}
 +
 
 +
== OpenSession ==
 +
Takes a [[#Module|DeviceCode]] and an u32. Returns an [[#IClkrstSession]].
 +
 
 +
== GetClockModuleNumLimit ==
 +
Returns 0x1A.
 +
 
 +
== IClkrstSession ==
 +
This is "nn::clkrst::IClkrstSession".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 48 || NVJPG || vdd_soc ||
+
! Cmd || Name
 
|-
 
|-
| 49 || NVDEC || vdd_soc ||
+
| 0 || SetClockEnabled
 
|-
 
|-
| 50 || QSPI || vdd_soc ||
+
| 1 || SetClockDisabled
 
|-
 
|-
| 52 || TSECB || vdd_soc ||
+
| 2 || SetResetAsserted
 
|-
 
|-
| 53 || APE || vdd_soc ||
+
| 3 || SetResetDeasserted
 
|-
 
|-
| 54 || ACLK || vdd_soc ||
+
| 4 || SetPowerEnabled
 
|-
 
|-
| 55 || UARTAPE || vdd_soc ||
+
| 5 || SetPowerDisabled
 
|-
 
|-
| 56 || EMC || vdd_soc ||
+
| 6 || GetState
 
|-
 
|-
| 57 || PLLE0 || vdd_soc ||
+
| 7 || SetClockRate
 
|-
 
|-
| 58 || PLLE0 || vdd_soc ||
+
| 8 || GetClockRate
 
|-
 
|-
| 59 || DSI || vdd_soc ||
+
| 9 || SetMinVClockRate
 
|-
 
|-
| 60 || MAUD || vdd_soc ||
+
| 10 || GetPossibleClockRates
 
|-
 
|-
| 61 || DPAUX1 || vdd_soc ||
+
| 11 || GetDvfsTable
 +
|}
 +
 
 +
= clkrst:a =
 +
This is "nn::clkrst::IArbitrationManager".
 +
 
 +
This was added with [8.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 62 || MIPI_CAL || vdd_soc ||
+
! Cmd || Name
 
|-
 
|-
| 63 || UART_FST_MIPI_CAL || vdd_soc ||
+
| 0 || [[#ReleaseControl]]
 +
|}
 +
 
 +
== ReleaseControl ==
 +
Takes a [[#Module|Module]]. No output.
 +
 
 +
= rgltr =
 +
This is "nn::regulator::IRegulatorManager".
 +
 
 +
This was added with [8.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 64 || OSC || vdd_soc ||
+
! Cmd || Name
|-
 
| 65 || SCLK || vdd_soc ||
 
|-
 
| 66 || SOR_SAFE || vdd_soc ||
 
|-
 
| 67 || XUSB_SS || vdd_soc ||
 
|-
 
| 68 || XUSB_HOST || vdd_soc ||
 
|-
 
| 69 || XUSB_DEV || vdd_soc ||
 
|-
 
| 70 || EXTPERIPH1 || vdd_soc ||
 
|-
 
| 71 || AHUB || vdd_soc ||
 
|-
 
| 72 || HDA2HDMICODEC || vdd_soc ||
 
|-
 
| 73 || PLLP5 || vdd_soc ||
 
|-
 
| 74 || USBD || vdd_soc ||
 
|-
 
| 75 || USB2 || vdd_soc ||
 
|-
 
| 76 || PCIE || vdd_soc ||
 
 
|-
 
|-
| 77 || AFI || vdd_soc ||
+
| 0 || [[#OpenSession]]
 
|-
 
|-
| 78 || PCIEXCLK || vdd_soc ||
+
| 1 || GetPowerDomainStateTable
 
|-
 
|-
| 79 || PEX_USB_UPHY || vdd_soc ||
+
| 2 || GetPowerInfoEvent
|-
 
| 80 || XUSB_PADCTL || vdd_soc ||
 
|-
 
| 81 || APBDMA || vdd_soc ||
 
|-
 
| 82 || USB2_TRK || vdd_soc ||
 
|-
 
| 83 || PLLE0 || vdd_soc ||
 
|-
 
| 84 || PLLE0 || vdd_soc ||
 
|-
 
| 85 || CEC || vdd_soc ||
 
 
|-
 
|-
 +
| 3 || GetPowerModuleNumLimit
 
|}
 
|}
  
=== Voltage ===
+
== OpenSession ==
 +
Takes a [[#PowerDomain|DeviceCode]] and returns an [[#IRegulatorSession]].
 +
 
 +
== GetPowerModuleNumLimit ==
 +
Returns 0x3.
 +
 
 +
== IRegulatorSession ==
 +
This is "nn::regulator::IRegulatorSession".
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Name || Block || Notes
+
! Cmd || Name
|-
 
|  0 || max77620_sd0 ||
 
|-
 
|  1 || max77620_sd1 ||
 
|-
 
|  2 || max77620_sd2 ||
 
|-
 
|  3 || max77620_sd3 ||
 
|-
 
|  4 || max77620_ldo0 ||
 
|-
 
|  5 || max77620_ldo1 ||
 
|-
 
|  6 || max77620_ldo2 ||
 
|-
 
|  7 || max77620_ldo3 ||
 
|-
 
|  8 || max77620_ldo4 ||  
 
 
|-
 
|-
| 9 || max77620_ldo5 ||  
+
| 0 || [[#SetVoltageEnabled]]
 
|-
 
|-
| 10 || max77620_ldo6 ||  
+
| 1 ||
 
|-
 
|-
| 11 || max77620_ldo7 ||  
+
| 2 || [[#GetVoltageEnabled]]
 
|-
 
|-
| 12 || max77620_ldo8 ||  
+
| 3 || GetVoltageRange
 
|-
 
|-
| 13 || max77621_cpu ||  
+
| 4 || GetVoltageValue
 
|-
 
|-
| 14 || max77621_gpu ||  
+
| 5 || [[#SetVoltageValue]]
 
|-
 
|-
 +
| 6 || ChangeVoltage
 
|}
 
|}
  
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.
+
=== SetVoltageEnabled ===
 +
Takes a bool. Enables/disables the LDO this session was opened for.
 +
 
 +
=== GetVoltageEnabled ===
 +
Returns a bool. True if voltage is enabled, false if not.
  
= pcv:arb =
+
=== SetVoltageValue ===
This is "nn::pcv::IArbitrationManager".
+
Takes in a voltage in microvolts and sets the LDO to this voltage.
 +
 
 +
= rtc =
 +
This was added with [8.0.0+].
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 331: Line 349:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || ReleaseControl
+
| 0 || [[#GetRtcTime]]
 
|-
 
|-
|}
+
| 1 || [[#SetRtcTime]]
 
 
= pcv:imm =
 
This is "nn::pcv::IImmediateManager".
 
 
 
{| class="wikitable" border="1"
 
 
|-
 
|-
! Cmd || Name
+
| 2 || [[#SetUpRtcResetOnShutdown]]
 
|-
 
|-
| 0 || SetClockRate
+
| 3 || [[#GetRtcResetDetected]]
 
|-
 
|-
 +
| 4 || [[#ClearRtcResetDetected]]
 
|}
 
|}
 +
 +
== GetRtcTime ==
 +
Same as GetRtcTime from [[#bpc:r|bpc:r]], but takes an extra [[Bus_services#I2cDevice|DeviceCode]], which [[#bpc:r|bpc:r]] hardcodes to 0x3B000001 (max77620_rtc0) instead.
 +
 +
== SetRtcTime ==
 +
Same as SetRtcTime from [[#bpc:r|bpc:r]], but takes an extra [[Bus_services#I2cDevice|DeviceCode]], which [[#bpc:r|bpc:r]] hardcodes to 0x3B000001 (max77620_rtc0) instead.
 +
 +
== SetUpRtcResetOnShutdown ==
 +
Takes an u8 '''DoReset''' and a [[Bus_services#I2cDevice|DeviceCode]]. Similar to SetUpRtcResetOnShutdown from [[#bpc:r|bpc:r]], 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 ==
 +
Same as GetRtcResetDetected from [[#bpc:r|bpc:r]], but takes an extra [[Bus_services#I2cDevice|DeviceCode]], which [[#bpc:r|bpc:r]] hardcodes to 0x3B000001 (max77620_rtc0) instead.
 +
 +
== ClearRtcResetDetected ==
 +
Same as ClearRtcResetDetected from [[#bpc:r|bpc:r]], but takes an extra [[Bus_services#I2cDevice|DeviceCode]], which [[#bpc:r|bpc:r]] hardcodes to 0x3B000001 (max77620_rtc0) instead.
  
 
= time:u, time:a, time:s =
 
= time:u, time:a, time:s =
 
This is "nn::timesrv::detail::service::IStaticService".
 
This is "nn::timesrv::detail::service::IStaticService".
 +
 +
[9.0.0+] These services were moved to [[Glue_services|Glue]] and [[PSC_services|PSC]].
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 364: Line 395:
 
|-
 
|-
 
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].
 
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].
 +
|-
 +
| 20 || [6.0.0+] GetSharedMemoryNativeHandle ||
 +
|-
 +
| 30 || [6.0.0+] GetStandardNetworkClockOperationEventReadableHandle ||
 +
|-
 +
| 31 || [6.0.0+] GetEphemeralNetworkClockOperationEventReadableHandle ||
 
|-
 
|-
 
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset ||  
 
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset ||  
Line 373: Line 410:
 
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear ||  
 
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear ||  
 
|-
 
|-
| 200 || IsStandardNetworkSystemClockAccuracySufficient ||  
+
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient ||
 +
|-
 +
| 201 || [6.0.0+] GetStandardUserSystemClockAutomaticCorrectionUpdatedTime ||  
 
|-
 
|-
 
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint ||  
 
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint ||  
Line 399: Line 438:
 
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.
 
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.
 
|-
 
|-
| 100 || GetRtcValue || No input, returns an output s64.
+
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.
 
|-
 
|-
| 101 || IsRtcResetDetected || No input, returns an output u8 bool.
+
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.
 
|-
 
|-
| 102 || GetSetupResultValue || No input, returns an output u32.
+
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.
 
|-
 
|-
| 200 || GetInternalOffset || No input, returns an output [[#TimeSpanType]].
+
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].
 
|-
 
|-
| 201 || SetInternalOffset || Takes an input [[#TimeSpanType]], no output. Removed in [4.0.0+].
+
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.
 
|}
 
|}
  
 
=== SteadyClockTimePoint ===
 
=== SteadyClockTimePoint ===
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8|| A u64 representing a point in time.
 +
|-
 +
| 0x8 || 0x10 || An ID representing the clock source.
 +
|}
 +
 
This is a 0x18-byte struct.
 
This is a 0x18-byte struct.
  
Line 429: Line 477:
 
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].
 
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].
 
|-
 
|-
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].
+
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].
 
|-
 
|-
 +
| 4 || [9.0.0+] GetOperationEventReadableHandle ||
 
|}
 
|}
  
 
=== PosixTime ===
 
=== PosixTime ===
This is an u64 for UTC POSIX time.
+
This is an s64 for UTC POSIX time.
  
 
=== SystemClockContext ===
 
=== SystemClockContext ===
 
This is an 0x20-byte struct.
 
This is an 0x20-byte struct.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.
 +
|-
 +
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]
 +
|}
  
 
== ITimeZoneService ==
 
== ITimeZoneService ==
Line 456: Line 514:
 
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.
 
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.
 
|-
 
|-
| 5 || GetTimeZoneRuleVersion ||  No input, returns an output [[#TimeZoneRuleVersion]].
+
| 5 || [2.0.0+] GetTimeZoneRuleVersion ||  No input, returns an output [[#TimeZoneRuleVersion]].
 +
|-
 +
| 6 || [5.0.0+] GetDeviceLocationNameAndUpdatedTime ||
 
|-
 
|-
 
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].
 
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].
Line 462: Line 522:
 
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].
 
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].
 
|-
 
|-
| 200 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.
+
| 201 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.
|-
 
| 201 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.
 
 
|-
 
|-
 +
| 202 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.
 
|}
 
|}
  
Line 472: Line 531:
  
 
=== LocationName ===
 
=== LocationName ===
 +
This contains a TimeZone location string with a max size of 0x24 bytes.
 +
 +
=== TimeZoneRule ===
 +
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.
 +
 +
This is loaded from the [[Title_list|TimeZoneBinary]] title with the specified LocationName under the zoneinfo/ directory, the content is then converted into this TimeZoneRule structure.
 +
 +
The files contained under zoneinfo/ directory are Tzif2 files without Tzif1 header and data at the begining of them (see [https://tools.ietf.org/html/rfc8536 RFC8536] for more information).
 +
 +
The conversion of a Tzif2 file to a TimeZoneRule structure is based on [https://github.com/eggert/tz/blob/master/localtime.c tz database code] with some custom modifications (Leap seconds aren't handled, no usage of "posixrules" and Tzif1 support stripped out).
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x10 || Location name string, no NUL-terminator.
+
| 0x0 || 0x4 || timecnt
 +
|-
 +
| 0x4 || 0x4 || typecnt
 +
|-
 +
| 0x8 || 0x4 || charcnt
 +
|-
 +
| 0xC || 0x1 || goback
 +
|-
 +
| 0xD || 0x1 || goahead
 +
|-
 +
| 0xE || 0x2 || Padding
 +
|-
 +
| 0x10 || 0x8 * 1000 || ats
 +
|-
 +
| 0x1f50 || 0x1 * 1000 || types
 
|-
 
|-
| 0x10 || ? ||  
+
| 0x2338 || 0x10 * 128 || ttis (time type information), struct ttinfo[1000]
 
|-
 
|-
| 0x18 || 0x8? || ?
+
| 0x2b38 || 0x1 * 512 || chars
 
|-
 
|-
| 0x20 || ? || ?
+
| 0x2d38 || 0x4 || defaulttype
 +
|-
 +
| 0x2d3c || 0x12c4 || Reserved / Unused
 
|}
 
|}
  
This is an 0x24-byte struct.
+
=== ttinfo ===
 +
This is an 0x10-byte struct.
 +
Represent a Time Type Information used in [[#TimeZoneRule]].
  
=== TimeZoneRule ===
+
{| class="wikitable" border="1"
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.
+
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || tt_gmtoff
 +
|-
 +
| 0x4 || 0x1 || tt_isdst
 +
|-
 +
| 0x5 || 0x3 || Padding
 +
|-
 +
| 0x8 || 0x4 || tt_abbrind
 +
|-
 +
| 0xC || 0x1 || tt_ttisstd
 +
|-
 +
| 0xD || 0x1 || tt_ttisgmt
 +
|-
 +
| 0xE || 0x2 || Padding
 +
|}
  
 
=== TimeZoneRuleVersion ===
 
=== TimeZoneRuleVersion ===
Line 524: Line 628:
 
| 0x4 || 0x4 || 0-based day-of-year.
 
| 0x4 || 0x4 || 0-based day-of-year.
 
|-
 
|-
| 0x8 || ? || Timezone name string.
+
| 0x8 || 0x8 || Timezone name string.
 
|-
 
|-
 
| 0x10 || 0x4 || 0 = no DST, 1 = DST.
 
| 0x10 || 0x4 || 0 = no DST, 1 = DST.
Line 532: Line 636:
  
 
This is an 0x18-byte struct. This stores timezone info.
 
This is an 0x18-byte struct. This stores timezone info.
 +
 +
= Module =
 +
This is "nn::pcv::Module".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name || DeviceCode || Rail
 +
|-
 +
|  0 || Cpu || 0x40000001 || VddCpu
 +
|-
 +
|  1 || Gpu || 0x40000002 || VddGpu
 +
|-
 +
|  2 || I2s1 || 0x40000003 || VddSoc
 +
|-
 +
|  3 || I2s2 || 0x40000004 || VddSoc
 +
|-
 +
|  4 || I2s3 || 0x40000005 || VddSoc
 +
|-
 +
|  5 || Pwm || 0x40000006 || VddSoc
 +
|-
 +
|  6 || I2c1 || 0x02000001 || VddSoc
 +
|-
 +
|  7 || I2c2 || 0x02000002 || VddSoc
 +
|-
 +
|  8 || I2c3 || 0x02000003 || VddSoc
 +
|-
 +
|  9 || I2c4 || 0x02000004 || VddSoc
 +
|-
 +
| 10 || I2c5 || 0x02000005 || VddSoc
 +
|-
 +
| 11 || I2c6 || 0x02000006 || VddSoc
 +
|-
 +
| 12 || Spi1 || 0x07000000 || VddSoc
 +
|-
 +
| 13 || Spi2 || 0x07000001 || VddSoc
 +
|-
 +
| 14 || Spi3 || 0x07000002 || VddSoc
 +
|-
 +
| 15 || Spi4 || 0x07000003 || VddSoc
 +
|-
 +
| 16 || Disp1 || 0x40000011 || VddSoc
 +
|-
 +
| 17 || Disp2 || 0x40000012 || VddSoc
 +
|-
 +
| 18 || Isp || 0x40000013 || None
 +
|-
 +
| 19 || Vi || 0x40000014 || None
 +
|-
 +
| 20 || Sdmmc1 || 0x40000015 || VddSoc
 +
|-
 +
| 21 || Sdmmc2 || 0x40000016 || VddSoc
 +
|-
 +
| 22 || Sdmmc3 || 0x40000017 || VddSoc
 +
|-
 +
| 23 || Sdmmc4 || 0x40000018 || VddSoc
 +
|-
 +
| 24 || Owr || 0x40000019 || None
 +
|-
 +
| 25 || Csite || 0x4000001A || VddSoc
 +
|-
 +
| 26 || Tsec || 0x4000001B || VddSoc
 +
|-
 +
| 27 || Mselect || 0x4000001C || VddSoc
 +
|-
 +
| 28 || Hda2codec2x || 0x4000001D || VddSoc
 +
|-
 +
| 29 || Actmon || 0x4000001E || VddSoc
 +
|-
 +
| 30 || I2cSlow || 0x4000001F || VddSoc
 +
|-
 +
| 31 || Sor1 || 0x40000020 || VddSoc
 +
|-
 +
| 32 || Sata || 0x40000021 || None
 +
|-
 +
| 33 || Hda || 0x40000022 || VddSoc
 +
|-
 +
| 34 || XusbCoreHostSrc || 0x40000023 || VddSoc
 +
|-
 +
| 35 || XusbFalconSrc || 0x40000024 || VddSoc
 +
|-
 +
| 36 || XusbFsSrc || 0x40000025 || VddSoc
 +
|-
 +
| 37 || XusbCoreDevSrc || 0x40000026 || VddSoc
 +
|-
 +
| 38 || XusbSsSrc || 0x40000027 || VddSoc
 +
|-
 +
| 39 || UartA || 0x03000001 || VddSoc
 +
|-
 +
| 40 || UartB || 0x35000405 || VddSoc
 +
|-
 +
| 41 || UartC || 0x3500040F || VddSoc
 +
|-
 +
| 42 || UartD || 0x37000001 || VddSoc
 +
|-
 +
| 43 || Host1x || 0x4000002C || VddSoc
 +
|-
 +
| 44 || Entropy || 0x4000002D || VddSoc
 +
|-
 +
| 45 || SocTherm || 0x4000002E || VddSoc
 +
|-
 +
| 46 || Vic || 0x4000002F || VddSoc
 +
|-
 +
| 47 || Nvenc || 0x40000030 || VddSoc
 +
|-
 +
| 48 || Nvjpg || 0x40000031 || VddSoc
 +
|-
 +
| 49 || Nvdec || 0x40000032 || VddSoc
 +
|-
 +
| 50 || Qspi || 0x40000033 || VddSoc
 +
|-
 +
| 51 || ViI2c || 0x40000034 || None
 +
|-
 +
| 52 || Tsecb || 0x40000035 || VddSoc
 +
|-
 +
| 53 || Ape || 0x40000036 || VddSoc
 +
|-
 +
| 54 || AudioDsp || 0x40000037 || VddSoc
 +
|-
 +
| 55 || AudioUart || 0x40000038 || VddSoc
 +
|-
 +
| 56 || Emc || 0x40000039 || VddSoc
 +
|-
 +
| 57 || Plle || 0x4000003A || VddSoc
 +
|-
 +
| 58 || PlleHwSeq || 0x4000003B || VddSoc
 +
|-
 +
| 59 || Dsi || 0x4000003C || VddSoc
 +
|-
 +
| 60 || Maud || 0x4000003D || VddSoc
 +
|-
 +
| 61 || Dpaux1 || 0x4000003E || VddSoc
 +
|-
 +
| 62 || MipiCal || 0x4000003F || VddSoc
 +
|-
 +
| 63 || UartFstMipiCal || 0x40000040 || VddSoc
 +
|-
 +
| 64 || Osc || 0x40000041 || VddSoc
 +
|-
 +
| 65 || SysBus || 0x40000042 || VddSoc
 +
|-
 +
| 66 || SorSafe || 0x40000043 || VddSoc
 +
|-
 +
| 67 || XusbSs || 0x40000044 || VddSoc
 +
|-
 +
| 68 || XusbHost || 0x40000045 || VddSoc
 +
|-
 +
| 69 || XusbDevice || 0x40000046 || VddSoc
 +
|-
 +
| 70 || Extperiph1 || 0x40000047 || VddSoc
 +
|-
 +
| 71 || Ahub || 0x40000048 || VddSoc
 +
|-
 +
| 72 || Hda2hdmicodec || 0x40000049 || VddSoc
 +
|-
 +
| 73 || Gpuaux || 0x4000004A || VddSoc
 +
|-
 +
| 74 || UsbD || 0x4000004B || VddSoc
 +
|-
 +
| 75 || Usb2 || 0x4000004C || VddSoc
 +
|-
 +
| 76 || Pcie || 0x4000004D || VddSoc
 +
|-
 +
| 77 || Afi || 0x4000004E || VddSoc
 +
|-
 +
| 78 || PciExClk || 0x4000004F || VddSoc
 +
|-
 +
| 79 || PExUsbPhy || 0x40000050 || VddSoc
 +
|-
 +
| 80 || XUsbPadCtl || 0x40000051 || VddSoc
 +
|-
 +
| 81 || Apbdma || 0x40000052 || VddSoc
 +
|-
 +
| 82 || Usb2TrkClk || 0x40000053 || VddSoc
 +
|-
 +
| 83 || XUsbIoPll || 0x40000054 || VddSoc
 +
|-
 +
| 84 || XUsbIoPllHwSeq || 0x40000055 || VddSoc
 +
|-
 +
| 85 || Cec || 0x40000056 || VddSoc
 +
|-
 +
| [6.0.0+] 86 || Extperiph2 || 0x40000057 || VddSoc
 +
|}
 +
 +
= PowerDomain =
 +
This is "nn::pcv::PowerDomain".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Name || DeviceCode || Description
 +
|-
 +
|  0 || Max77620_Sd0 || 0x3A000080 ||
 +
|-
 +
|  1 || Max77620_Sd1 || 0x3A000081 ||
 +
|-
 +
|  2 || Max77620_Sd2 || 0x3A000082 ||
 +
|-
 +
|  3 || Max77620_Sd3 || 0x3A000083 ||
 +
|-
 +
|  4 || Max77620_Ldo0 || 0x3A0000A0 || 1.2v
 +
|-
 +
|  5 || Max77620_Ldo1 || 0x3A0000A1 ||
 +
|-
 +
|  6 || Max77620_Ldo2 || 0x3A0000A2 || SDcard power, 1.8v - 3.3v
 +
|-
 +
|  7 || Max77620_Ldo3 || 0x3A0000A3 || GC ASIC 3.1v
 +
|-
 +
|  8 || Max77620_Ldo4 || 0x3A0000A4 || RTC power, 0.85v
 +
|-
 +
|  9 || Max77620_Ldo5 || 0x3A0000A5 || GC ASIC 1.8v
 +
|-
 +
| 10 || Max77620_Ldo6 || 0x3A0000A6 || AVDD touchscreen, 2.9v
 +
|-
 +
| 11 || Max77620_Ldo7 || 0x3A0000A7 ||
 +
|-
 +
| 12 || Max77620_Ldo8 || 0x3A0000A8 || DisplayPort, 1.05v
 +
|-
 +
| 13 || Max77621_Cpu || 0x3A000003 ||
 +
|-
 +
| 14 || Max77621_Gpu || 0x3A000004 ||
 +
|-
 +
| [6.0.0+] 15 || Max77812_Cpu || 0x3A000003 ||
 +
|-
 +
| [6.0.0+] 16 || Max77812_Gpu || 0x3A000004 ||
 +
|-
 +
| [6.0.0+] 17 || Max77812_Dram || 0x3A000005 ||
 +
|-
 +
| [8.0.0+] - || || 0x3C000004 || SDCard
 +
|-
 +
| [8.0.0+] - || || 0x34000007 || HDMI
 +
|-
 +
| [8.0.0+] - || || 0x3500041A || MCU
 +
|}
  
 
[[Category:Services]]
 
[[Category:Services]]

Latest revision as of 17:14, 31 October 2020

bpc

This is "nn::bpc::IBoardPowerControlManager".

Cmd Name
0 ShutdownSystem
1 RebootSystem
2 GetWakeupReason
3 GetShutdownReason
4 GetAcOk
5 GetBoardPowerControlEvent
6 [2.0.0+] GetSleepButtonState
7 [2.0.0+] GetPowerEvent
8 [2.0.0-9.2.0] CreateWakeupTimer
9 [2.0.0-9.2.0] CancelWakeupTimer
10 [2.0.0-9.2.0] #EnableWakeupTimerOnDevice
11 [3.0.0-9.2.0] CreateWakeupTimerEx
12 [3.0.0-9.2.0] GetLastEnabledWakeupTimerType
13 [3.0.0-9.2.0] CleanAllWakeupTimers
14 [6.0.0+]
15 [10.0.0+]

EnableWakeupTimerOnDevice

No input, returns a total of 0x10-bytes of output. [3.0.0+] Now returns a total of 0xC-bytes of output.

bpc:r

This is "nn::bpc::IRtcManager".

Cmd Name
0 GetRtcTime
1 SetRtcTime
2 GetRtcResetDetected
3 [2.0.0+] ClearRtcResetDetected
4 [3.0.0+] SetUpRtcResetOnShutdown

bpc:c

This is "nn::bpc::IBoardPowerControlManager".

[2.0.0+] This service was replaced by bpc.

Cmd Name
0 ShutdownSystem
1 RebootSystem
2 GetWakeupReason
3 GetShutdownReason
4 GetAcOk
5 GetBoardPowerControlEvent

bpc:b

This is "nn::bpc::IPowerButtonManager".

[2.0.0+] This service was merged into bpc.

Cmd Name
0 GetSleepButtonState
1 GetPowerEvent

bpc:w

This is "nn::bpc::IWakeupConfigManager".

[2.0.0+] This service was merged into bpc.

Cmd Name
0 CreateWakeupTimer
1 CancelWakeupTimer
2 #EnableWakeupTimerOnDevice

pcv

This is "nn::pcv::detail::IPcvService".

Cmd Name
[1.0.0-7.0.1] 0 SetPowerEnabled
[1.0.0-7.0.1] 1 SetClockEnabled
[1.0.0-7.0.1] 2 SetClockRate
[1.0.0-7.0.1] 3 GetClockRate
[1.0.0-7.0.1] 4 GetState
[1.0.0-7.0.1] 5 GetPossibleClockRates
[1.0.0-7.0.1] 6 SetMinVClockRate
[1.0.0-7.0.1] 7 SetReset
[1.0.0-7.0.1] 8 SetVoltageEnabled
[1.0.0-7.0.1] 9 GetVoltageEnabled
[1.0.0-7.0.1] 10 GetVoltageRange
[1.0.0-7.0.1] 11 SetVoltageValue
[1.0.0-7.0.1] 12 GetVoltageValue
[1.0.0-7.0.1] 13 GetTemperatureThresholds
[1.0.0-7.0.1] 14 SetTemperature
[1.0.0-5.1.0] 15 Initialize
[1.0.0-5.1.0] 16 IsInitialized
[1.0.0-5.1.0] 17 Finalize
[3.0.0-7.0.1] 18 PowerOn
[3.0.0-7.0.1] 19 PowerOff
[3.0.0-7.0.1] 20 ChangeVoltage
[3.0.0-7.0.1] 21 GetPowerClockInfoEvent
[3.0.0-7.0.1] 22 GetOscillatorClock
[3.0.0-7.0.1] 23 GetDvfsTable
[3.0.0-7.0.1] 24 GetModuleStateTable
[3.0.0-7.0.1] 25 GetPowerDomainStateTable
26 [3.0.0+] GetFuseInfo
27 [5.0.0+] GetDramId
[6.0.0-7.0.1] 28 #IsPoweredOn
[6.0.0-7.0.1] 29 #GetVoltage

[7.0.0+] The type-0xA output buffers were replaced with type-0x22 output buffers, for the following: GetDvfsTable, GetModuleStateTable, and GetPowerDomainStateTable.

IsPoweredOn

Takes a PowerDomain and returns a bool indicating the status of the requested voltage block.

GetVoltage

Takes a PowerDomain and returns an u32 voltage value for the requested voltage block.

pcv:arb

This is "nn::pcv::IArbitrationManager".

This service no longer exists in [8.0.0+].

Cmd Name
0 ReleaseControl

pcv:imm

This is "nn::pcv::IImmediateManager".

This service no longer exists in [8.0.0+].

Cmd Name
0 SetClockRate

clkrst, clkrst:i

These are "nn::clkrst::IClkrstManager" and "nn::clkrst::IImmediateManager".

These were added with [8.0.0+].

Cmd Name
0 #OpenSession
1 GetTemperatureThresholds
2 SetTemperature
3 GetPossibleClockRates
4 GetClockInfoEvent
5 GetClockModuleNumLimit

OpenSession

Takes a DeviceCode and an u32. Returns an #IClkrstSession.

GetClockModuleNumLimit

Returns 0x1A.

IClkrstSession

This is "nn::clkrst::IClkrstSession".

Cmd Name
0 SetClockEnabled
1 SetClockDisabled
2 SetResetAsserted
3 SetResetDeasserted
4 SetPowerEnabled
5 SetPowerDisabled
6 GetState
7 SetClockRate
8 GetClockRate
9 SetMinVClockRate
10 GetPossibleClockRates
11 GetDvfsTable

clkrst:a

This is "nn::clkrst::IArbitrationManager".

This was added with [8.0.0+].

Cmd Name
0 #ReleaseControl

ReleaseControl

Takes a Module. No output.

rgltr

This is "nn::regulator::IRegulatorManager".

This was added with [8.0.0+].

Cmd Name
0 #OpenSession
1 GetPowerDomainStateTable
2 GetPowerInfoEvent
3 GetPowerModuleNumLimit

OpenSession

Takes a DeviceCode and returns an #IRegulatorSession.

GetPowerModuleNumLimit

Returns 0x3.

IRegulatorSession

This is "nn::regulator::IRegulatorSession".

Cmd Name
0 #SetVoltageEnabled
1
2 #GetVoltageEnabled
3 GetVoltageRange
4 GetVoltageValue
5 #SetVoltageValue
6 ChangeVoltage

SetVoltageEnabled

Takes a bool. Enables/disables the LDO this session was opened for.

GetVoltageEnabled

Returns a bool. True if voltage is enabled, false if not.

SetVoltageValue

Takes in a voltage in microvolts and sets the LDO to this voltage.

rtc

This was added with [8.0.0+].

Cmd Name
0 #GetRtcTime
1 #SetRtcTime
2 #SetUpRtcResetOnShutdown
3 #GetRtcResetDetected
4 #ClearRtcResetDetected

GetRtcTime

Same as GetRtcTime from bpc:r, but takes an extra DeviceCode, which bpc:r hardcodes to 0x3B000001 (max77620_rtc0) instead.

SetRtcTime

Same as SetRtcTime from bpc:r, but takes an extra DeviceCode, which bpc:r hardcodes to 0x3B000001 (max77620_rtc0) instead.

SetUpRtcResetOnShutdown

Takes an u8 DoReset and a DeviceCode. Similar to SetUpRtcResetOnShutdown from bpc:r, but this version assigns the provided boolean value on a per-client basis (instead of a global variable) and checks it when the current power state is "ReadyShutdown".

GetRtcResetDetected

Same as GetRtcResetDetected from bpc:r, but takes an extra DeviceCode, which bpc:r hardcodes to 0x3B000001 (max77620_rtc0) instead.

ClearRtcResetDetected

Same as ClearRtcResetDetected from bpc:r, but takes an extra DeviceCode, which bpc:r hardcodes to 0x3B000001 (max77620_rtc0) instead.

time:u, time:a, time:s

This is "nn::timesrv::detail::service::IStaticService".

[9.0.0+] These services were moved to Glue and PSC.

Cmd Name Notes
0 GetStandardUserSystemClock Returns an #ISystemClock.
1 GetStandardNetworkSystemClock Returns an #ISystemClock.
2 GetStandardSteadyClock Returns an #ISteadyClock.
3 GetTimeZoneService Returns an #ITimeZoneService.
4 GetStandardLocalSystemClock Returns an #ISystemClock.
5 [4.0.0+] GetEphemeralNetworkSystemClock Returns an #ISystemClock.
20 [6.0.0+] GetSharedMemoryNativeHandle
30 [6.0.0+] GetStandardNetworkClockOperationEventReadableHandle
31 [6.0.0+] GetEphemeralNetworkClockOperationEventReadableHandle
50 [4.0.0+] SetStandardSteadyClockInternalOffset
100 IsStandardUserSystemClockAutomaticCorrectionEnabled
101 SetStandardUserSystemClockAutomaticCorrectionEnabled
102 [5.0.0+] GetStandardUserSystemClockInitialYear
200 [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient
201 [6.0.0+] GetStandardUserSystemClockAutomaticCorrectionUpdatedTime
300 [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint
400 [4.0.0+] GetClockSnapshot
401 [4.0.0+] GetClockSnapshotFromSystemClockContext
500 [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser
501 [4.0.0+] CalculateSpanBetween

ISteadyClock

This is "nn::timesrv::detail::service::ISteadyClock".

Cmd Name Notes
0 GetCurrentTimePoint No input, returns an output #SteadyClockTimePoint.
2 GetTestOffset No input, returns an output #TimeSpanType.
3 SetTestOffset Takes an input #TimeSpanType, no output.
100 [2.0.0+] GetRtcValue No input, returns an output s64.
101 [2.0.0+] IsRtcResetDetected No input, returns an output u8 bool.
102 [2.0.0+] GetSetupResultValue No input, returns an output u32.
200 [3.0.0+] GetInternalOffset No input, returns an output #TimeSpanType.
201 [3.0.0-3.0.2] SetInternalOffset Takes an input #TimeSpanType, no output.

SteadyClockTimePoint

Offset Size Description
0x0 0x8 A u64 representing a point in time.
0x8 0x10 An ID representing the clock source.

This is a 0x18-byte struct.

TimeSpanType

This is an u64.

ISystemClock

This is "nn::timesrv::detail::service::ISystemClock".

Cmd Name Notes
0 GetCurrentTime Returns an output #PosixTime.
1 SetCurrentTime Takes an input #PosixTime.
2 GetSystemClockContext Returns an output #SystemClockContext.
3 SetSystemClockContext Takes an input #SystemClockContext.
4 [9.0.0+] GetOperationEventReadableHandle

PosixTime

This is an s64 for UTC POSIX time.

SystemClockContext

This is an 0x20-byte struct.

Offset Size Description
0x0 0x8 a #PosixTime representing the system clock epoch.
0x8 0x18 a #SteadyClockTimePoint

ITimeZoneService

This is "nn::timesrv::detail::service::ITimeZoneService".

Cmd Name Notes
0 GetDeviceLocationName No input, returns an output #LocationName.
1 SetDeviceLocationName Takes an input #LocationName, no output.
2 GetTotalLocationNameCount No input, returns an output s32.
3 LoadLocationNameList
4 LoadTimeZoneRule Takes an input #LocationName and a type-0x16 output buffer for #TimeZoneRule, no output.
5 [2.0.0+] GetTimeZoneRuleVersion No input, returns an output #TimeZoneRuleVersion.
6 [5.0.0+] GetDeviceLocationNameAndUpdatedTime
100 ToCalendarTime Takes an input #PosixTime and a type-0x15 input buffer for #TimeZoneRule, returns an output #CalendarTime and #CalendarAdditionalInfo.
101 ToCalendarTimeWithMyRule Takes an input #PosixTime, returns an output #CalendarTime and #CalendarAdditionalInfo.
201 ToPosixTime Takes an input #CalendarTime, a type-0x15 input buffer for #TimeZoneRule, an type-0xA output buffer for #PosixTime array, and returns an output s32.
202 ToPosixTimeWithMyRule Takes an input #CalendarTime, an type-0xA output buffer for #PosixTime array, and returns an output s32.

LoadLocationNameList

Takes an input s32 LocationName_index and a type-0x6 output buffer for #LocationName, returns an output s32 for total output entries.

LocationName

This contains a TimeZone location string with a max size of 0x24 bytes.

TimeZoneRule

This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.

This is loaded from the TimeZoneBinary title with the specified LocationName under the zoneinfo/ directory, the content is then converted into this TimeZoneRule structure.

The files contained under zoneinfo/ directory are Tzif2 files without Tzif1 header and data at the begining of them (see RFC8536 for more information).

The conversion of a Tzif2 file to a TimeZoneRule structure is based on tz database code with some custom modifications (Leap seconds aren't handled, no usage of "posixrules" and Tzif1 support stripped out).

Offset Size Description
0x0 0x4 timecnt
0x4 0x4 typecnt
0x8 0x4 charcnt
0xC 0x1 goback
0xD 0x1 goahead
0xE 0x2 Padding
0x10 0x8 * 1000 ats
0x1f50 0x1 * 1000 types
0x2338 0x10 * 128 ttis (time type information), struct ttinfo[1000]
0x2b38 0x1 * 512 chars
0x2d38 0x4 defaulttype
0x2d3c 0x12c4 Reserved / Unused

ttinfo

This is an 0x10-byte struct. Represent a Time Type Information used in #TimeZoneRule.

Offset Size Description
0x0 0x4 tt_gmtoff
0x4 0x1 tt_isdst
0x5 0x3 Padding
0x8 0x4 tt_abbrind
0xC 0x1 tt_ttisstd
0xD 0x1 tt_ttisgmt
0xE 0x2 Padding

TimeZoneRuleVersion

This is an u128.

CalendarTime

Offset Size Description
0x0 0x2 Year
0x2 0x1 Month
0x3 0x1 Day
0x4 0x1 Hour
0x5 0x1 Minute
0x6 0x1 Second
0x7 0x1 Padding / unknown?

This is an 0x8-byte struct.

CalendarAdditionalInfo

Offset Size Description
0x0 0x4 0-based day-of-week.
0x4 0x4 0-based day-of-year.
0x8 0x8 Timezone name string.
0x10 0x4 0 = no DST, 1 = DST.
0x14 0x4 s32 seconds relative to UTC for this timezone.

This is an 0x18-byte struct. This stores timezone info.

Module

This is "nn::pcv::Module".

Value Name DeviceCode Rail
0 Cpu 0x40000001 VddCpu
1 Gpu 0x40000002 VddGpu
2 I2s1 0x40000003 VddSoc
3 I2s2 0x40000004 VddSoc
4 I2s3 0x40000005 VddSoc
5 Pwm 0x40000006 VddSoc
6 I2c1 0x02000001 VddSoc
7 I2c2 0x02000002 VddSoc
8 I2c3 0x02000003 VddSoc
9 I2c4 0x02000004 VddSoc
10 I2c5 0x02000005 VddSoc
11 I2c6 0x02000006 VddSoc
12 Spi1 0x07000000 VddSoc
13 Spi2 0x07000001 VddSoc
14 Spi3 0x07000002 VddSoc
15 Spi4 0x07000003 VddSoc
16 Disp1 0x40000011 VddSoc
17 Disp2 0x40000012 VddSoc
18 Isp 0x40000013 None
19 Vi 0x40000014 None
20 Sdmmc1 0x40000015 VddSoc
21 Sdmmc2 0x40000016 VddSoc
22 Sdmmc3 0x40000017 VddSoc
23 Sdmmc4 0x40000018 VddSoc
24 Owr 0x40000019 None
25 Csite 0x4000001A VddSoc
26 Tsec 0x4000001B VddSoc
27 Mselect 0x4000001C VddSoc
28 Hda2codec2x 0x4000001D VddSoc
29 Actmon 0x4000001E VddSoc
30 I2cSlow 0x4000001F VddSoc
31 Sor1 0x40000020 VddSoc
32 Sata 0x40000021 None
33 Hda 0x40000022 VddSoc
34 XusbCoreHostSrc 0x40000023 VddSoc
35 XusbFalconSrc 0x40000024 VddSoc
36 XusbFsSrc 0x40000025 VddSoc
37 XusbCoreDevSrc 0x40000026 VddSoc
38 XusbSsSrc 0x40000027 VddSoc
39 UartA 0x03000001 VddSoc
40 UartB 0x35000405 VddSoc
41 UartC 0x3500040F VddSoc
42 UartD 0x37000001 VddSoc
43 Host1x 0x4000002C VddSoc
44 Entropy 0x4000002D VddSoc
45 SocTherm 0x4000002E VddSoc
46 Vic 0x4000002F VddSoc
47 Nvenc 0x40000030 VddSoc
48 Nvjpg 0x40000031 VddSoc
49 Nvdec 0x40000032 VddSoc
50 Qspi 0x40000033 VddSoc
51 ViI2c 0x40000034 None
52 Tsecb 0x40000035 VddSoc
53 Ape 0x40000036 VddSoc
54 AudioDsp 0x40000037 VddSoc
55 AudioUart 0x40000038 VddSoc
56 Emc 0x40000039 VddSoc
57 Plle 0x4000003A VddSoc
58 PlleHwSeq 0x4000003B VddSoc
59 Dsi 0x4000003C VddSoc
60 Maud 0x4000003D VddSoc
61 Dpaux1 0x4000003E VddSoc
62 MipiCal 0x4000003F VddSoc
63 UartFstMipiCal 0x40000040 VddSoc
64 Osc 0x40000041 VddSoc
65 SysBus 0x40000042 VddSoc
66 SorSafe 0x40000043 VddSoc
67 XusbSs 0x40000044 VddSoc
68 XusbHost 0x40000045 VddSoc
69 XusbDevice 0x40000046 VddSoc
70 Extperiph1 0x40000047 VddSoc
71 Ahub 0x40000048 VddSoc
72 Hda2hdmicodec 0x40000049 VddSoc
73 Gpuaux 0x4000004A VddSoc
74 UsbD 0x4000004B VddSoc
75 Usb2 0x4000004C VddSoc
76 Pcie 0x4000004D VddSoc
77 Afi 0x4000004E VddSoc
78 PciExClk 0x4000004F VddSoc
79 PExUsbPhy 0x40000050 VddSoc
80 XUsbPadCtl 0x40000051 VddSoc
81 Apbdma 0x40000052 VddSoc
82 Usb2TrkClk 0x40000053 VddSoc
83 XUsbIoPll 0x40000054 VddSoc
84 XUsbIoPllHwSeq 0x40000055 VddSoc
85 Cec 0x40000056 VddSoc
[6.0.0+] 86 Extperiph2 0x40000057 VddSoc

PowerDomain

This is "nn::pcv::PowerDomain".

Value Name DeviceCode Description
0 Max77620_Sd0 0x3A000080
1 Max77620_Sd1 0x3A000081
2 Max77620_Sd2 0x3A000082
3 Max77620_Sd3 0x3A000083
4 Max77620_Ldo0 0x3A0000A0 1.2v
5 Max77620_Ldo1 0x3A0000A1
6 Max77620_Ldo2 0x3A0000A2 SDcard power, 1.8v - 3.3v
7 Max77620_Ldo3 0x3A0000A3 GC ASIC 3.1v
8 Max77620_Ldo4 0x3A0000A4 RTC power, 0.85v
9 Max77620_Ldo5 0x3A0000A5 GC ASIC 1.8v
10 Max77620_Ldo6 0x3A0000A6 AVDD touchscreen, 2.9v
11 Max77620_Ldo7 0x3A0000A7
12 Max77620_Ldo8 0x3A0000A8 DisplayPort, 1.05v
13 Max77621_Cpu 0x3A000003
14 Max77621_Gpu 0x3A000004
[6.0.0+] 15 Max77812_Cpu 0x3A000003
[6.0.0+] 16 Max77812_Gpu 0x3A000004
[6.0.0+] 17 Max77812_Dram 0x3A000005
[8.0.0+] - 0x3C000004 SDCard
[8.0.0+] - 0x34000007 HDMI
[8.0.0+] - 0x3500041A MCU