Difference between revisions of "Config Services"

From 3dbrew
Jump to navigation Jump to search
m (Add anchors)
 
(28 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Services]]
+
__TOC__
 +
{{Anchor|Cfg}}{{Anchor|CfgU}}{{Anchor|CFG}}{{Anchor|CFGU}}{{Anchor|cfg:u}}
 +
= Config service "cfg:u" =
  
= Config services =
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 10: Line 11:
 
| 0x00010082
 
| 0x00010082
 
|  
 
|  
| [[CfgS:GetConfigInfoBlk2|GetConfigInfoBlk2]]
+
| [[CfgS:GetConfigInfoBlk2|GetConfigInfoBlk2]]/GetConfig
 
|-
 
|-
 
| 0x00020000
 
| 0x00020000
 
|  
 
|  
| [[Cfg:SecureInfoGetRegion|SecureInfoGetRegion]]
+
| [[Cfg:SecureInfoGetRegion|SecureInfoGetRegion]]/GetRegion
 
|-
 
|-
 
| 0x00030040
 
| 0x00030040
Line 38: Line 39:
 
| 0x00080080
 
| 0x00080080
 
| [[7.0.0-13]]
 
| [[7.0.0-13]]
| (u32 value, u8 type) This goes through a table containing 5 entries, each entry is 2-words. Type0: compare entry-word0 with input value, on match write entry-word1 to cmdreply+8 output. Type1: compare entry-word1 with input value, on match write entry-word0 to output.
+
| [[Cfg:TranslateCountryInfo|TranslateCountryInfo]]
 
|-
 
|-
 
| 0x00090040
 
| 0x00090040
Line 49: Line 50:
 
|-
 
|-
 
| 0x000B0000
 
| 0x000B0000
| [[9.6.0-24|9.6.0-X]]
+
| [[9.3.0-21|9.3.0-X]]
| This writes u8 value 0x1 to cmdreply[2].
+
| IsFangateSupported
 
|}
 
|}
  
 +
{{Anchor|CfgS}}{{Anchor|CFGS}}{{Anchor|cfg:s}}
 
= Config service "cfg:s" =
 
= Config service "cfg:s" =
 +
cfg:s contains all the commands in [[#cfg:u|cfg:u]], in addition to the following:
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 109: Line 113:
 
|-
 
|-
 
| 0x040D0040
 
| 0x040D0040
| ?
+
|  
| ?
+
| SetUUIDClockSequence
 
|-
 
|-
 
| 0x040E0000
 
| 0x040E0000
| ?
+
|  
| ?
+
| GetUUIDClockSequence
 
|-
 
|-
 
| 0x040F0000
 
| 0x040F0000
| ?
+
|  
| ?
+
| [[CfgS:ClearParentalControls|ClearParentalControls]]
 
|}
 
|}
  
 
CfgS command 0x04060000(SecureInfoGetRegion) is used by NIM module to determine the SOAP RegionId, when sending SOAP requests. See [[Nandrw/sys/SecureInfo_A|here]].
 
CfgS command 0x04060000(SecureInfoGetRegion) is used by NIM module to determine the SOAP RegionId, when sending SOAP requests. See [[Nandrw/sys/SecureInfo_A|here]].
  
 +
{{Anchor|CfgI}}{{Anchor|CFGI}}{{Anchor|cfg:i}}
 
= Config service "cfg:i" =
 
= Config service "cfg:i" =
 +
cfg:i contains all the commands in [[#cfg:u|cfg:u]] and [[#cfg:s|cfg:s]], in addition to the following:
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
!  Command Header
 
!  Command Header
 +
!  Available since system version
 
!  Description
 
!  Description
|-
 
| 0x04010082
 
| [[CfgS:GetConfigInfoBlk8|GetConfigInfoBlk8]]
 
|-
 
| 0x04020082
 
| [[CfgS:SetConfigInfoBlk4|SetConfigInfoBlk4]]
 
|-
 
| 0x04030000
 
| [[Cfg:UpdateConfigNANDSavegame|UpdateConfigNANDSavegame]]
 
|-
 
| 0x04040042
 
| [[Cfg:GetLocalFriendCodeSeedData|GetLocalFriendCodeSeedData]]
 
|-
 
| 0x04050000
 
| [[CfgS:GetLocalFriendCodeSeed|GetLocalFriendCodeSeed]]
 
|-
 
| 0x04060000
 
| [[Cfg:SecureInfoGetRegion|SecureInfoGetRegion]]
 
|-
 
| 0x04070000
 
| [[CfgS:SecureInfoGetByte101|SecureInfoGetByte101]]
 
|-
 
| 0x04080042
 
| [[CfgS:SecureInfoGetSerialNo|SecureInfoGetSerialNo]]
 
|-
 
| 0x04090000
 
| [[Cfg:UpdateConfigBlk00040003|UpdateConfigBlk00040003]]
 
 
|-
 
|-
 
| 0x08010082
 
| 0x08010082
 +
|
 
| [[CfgS:GetConfigInfoBlk8|GetConfigInfoBlk8]]
 
| [[CfgS:GetConfigInfoBlk8|GetConfigInfoBlk8]]
 
|-
 
|-
 
| 0x08020082
 
| 0x08020082
 +
|
 
| [[CfgS:SetConfigInfoBlk4|SetConfigInfoBlk4]]
 
| [[CfgS:SetConfigInfoBlk4|SetConfigInfoBlk4]]
 
|-
 
|-
 
| 0x08030000
 
| 0x08030000
 +
|
 
| [[Cfg:UpdateConfigNANDSavegame|UpdateConfigNANDSavegame]]
 
| [[Cfg:UpdateConfigNANDSavegame|UpdateConfigNANDSavegame]]
 
|-
 
|-
 
| 0x080400C2
 
| 0x080400C2
 +
|
 
| [[CfgI:CreateConfigInfoBlk|CreateConfigInfoBlk]]
 
| [[CfgI:CreateConfigInfoBlk|CreateConfigInfoBlk]]
 
|-
 
|-
 
| 0x08050000
 
| 0x08050000
 +
|
 
| [[CfgI:DeleteConfigNANDSavefile|DeleteConfigNANDSavefile]]
 
| [[CfgI:DeleteConfigNANDSavefile|DeleteConfigNANDSavefile]]
 
|-
 
|-
 
| 0x08060000
 
| 0x08060000
 +
|
 
| [[CfgI:FormatConfig|FormatConfig]]
 
| [[CfgI:FormatConfig|FormatConfig]]
 
|-
 
|-
 
| 0x08070000
 
| 0x08070000
 +
|
 
| This basically just returns result-code value 0x0, due to code this eventually executes being NOPed out.
 
| This basically just returns result-code value 0x0, due to code this eventually executes being NOPed out.
 
|-
 
|-
 
| 0x08080000
 
| 0x08080000
 +
|
 
| This updates the config blocks for blkIDs 0x0 and 0x20000. In certain cases this may call the code for [[CfgI:FormatConfig|FormatConfig]].
 
| This updates the config blocks for blkIDs 0x0 and 0x20000. In certain cases this may call the code for [[CfgI:FormatConfig|FormatConfig]].
 
|-
 
|-
 
| 0x08090000
 
| 0x08090000
 +
|
 
| This updates the config block for blkID 0x60000.
 
| This updates the config block for blkID 0x60000.
 
|-
 
|-
 
| 0x080A0000
 
| 0x080A0000
| This updates the config block for blkID 0x00040001.
+
|  
 +
| ResetAnalogStickCalibrationParam? This updates the config block for blkID 0x00040001.
 
|-
 
|-
 
| 0x080B0082
 
| 0x080B0082
 +
|
 
| [[CfgI:SetGetLocalFriendCodeSeedData|SetGetLocalFriendCodeSeedData]]
 
| [[CfgI:SetGetLocalFriendCodeSeedData|SetGetLocalFriendCodeSeedData]]
 
|-
 
|-
 
| 0x080C0042
 
| 0x080C0042
 +
|
 
| [[CfgI:SetLocalFriendCodeSeedSignature|SetLocalFriendCodeSeedSignature]]
 
| [[CfgI:SetLocalFriendCodeSeedSignature|SetLocalFriendCodeSeedSignature]]
 
|-
 
|-
 
| 0x080D0000
 
| 0x080D0000
 +
|
 
| [[CfgI:DeleteCreateNANDLocalFriendCodeSeed|DeleteCreateNANDLocalFriendCodeSeed]]
 
| [[CfgI:DeleteCreateNANDLocalFriendCodeSeed|DeleteCreateNANDLocalFriendCodeSeed]]
 
|-
 
|-
 
| 0x080E0000
 
| 0x080E0000
 +
|
 
| [[CfgI:VerifySigLocalFriendCodeSeed|VerifySigLocalFriendCodeSeed]]  
 
| [[CfgI:VerifySigLocalFriendCodeSeed|VerifySigLocalFriendCodeSeed]]  
 
|-
 
|-
 
| 0x080F0042
 
| 0x080F0042
 +
|
 
| [[Cfg:GetLocalFriendCodeSeedData|GetLocalFriendCodeSeedData]]
 
| [[Cfg:GetLocalFriendCodeSeedData|GetLocalFriendCodeSeedData]]
 
|-
 
|-
 
| 0x08100000
 
| 0x08100000
 +
|
 
| [[CfgS:GetLocalFriendCodeSeed|GetLocalFriendCodeSeed]]
 
| [[CfgS:GetLocalFriendCodeSeed|GetLocalFriendCodeSeed]]
 
|-
 
|-
 
| 0x08110084
 
| 0x08110084
 +
|
 
| [[CfgI:SetSecureInfo|SetSecureInfo]]
 
| [[CfgI:SetSecureInfo|SetSecureInfo]]
 
|-
 
|-
 
| 0x08120000
 
| 0x08120000
 +
|
 
| [[CfgI:DeleteCreateNANDSecureInfo|DeleteCreateNANDSecureInfo]]
 
| [[CfgI:DeleteCreateNANDSecureInfo|DeleteCreateNANDSecureInfo]]
 
|-
 
|-
 
| 0x08130000
 
| 0x08130000
 +
|
 
| [[CfgI:VerifySigSecureInfo|VerifySigSecureInfo]]
 
| [[CfgI:VerifySigSecureInfo|VerifySigSecureInfo]]
 
|-
 
|-
 
| 0x08140042
 
| 0x08140042
 +
|
 
| [[CfgI:SecureInfoGetData|SecureInfoGetData]]
 
| [[CfgI:SecureInfoGetData|SecureInfoGetData]]
 
|-
 
|-
 
| 0x08150042
 
| 0x08150042
 +
|
 
| [[CfgI:SecureInfoGetSignature|SecureInfoGetSignature]]
 
| [[CfgI:SecureInfoGetSignature|SecureInfoGetSignature]]
 
|-
 
|-
 
| 0x08160000
 
| 0x08160000
 +
|
 
| [[Cfg:SecureInfoGetRegion|SecureInfoGetRegion]]
 
| [[Cfg:SecureInfoGetRegion|SecureInfoGetRegion]]
 
|-
 
|-
 
| 0x08170000
 
| 0x08170000
 +
|
 
| [[CfgS:SecureInfoGetByte101|SecureInfoGetByte101]]
 
| [[CfgS:SecureInfoGetByte101|SecureInfoGetByte101]]
 
|-
 
|-
 
| 0x08180042
 
| 0x08180042
 +
|
 
| [[CfgS:SecureInfoGetSerialNo|SecureInfoGetSerialNo]]
 
| [[CfgS:SecureInfoGetSerialNo|SecureInfoGetSerialNo]]
 +
|-
 +
| 0x0819....
 +
| ?
 +
| ?
 +
|-
 +
| 0x081A....
 +
| ?
 +
| ?
 +
|-
 +
| 0x081B....
 +
| ?
 +
| ?
 +
|-
 +
| 0x081C....
 +
| ?
 +
| ?
 +
|-
 +
| 0x081D....
 +
| ?
 +
| ?
 +
|-
 +
| 0x081E....
 +
| ?
 +
| ?
 +
|-
 +
| 0x081F....
 +
| ?
 +
| ?
 +
|-
 +
| 0x0820....
 +
| ?
 +
| ?
 
|}
 
|}
  
= Config service "cfg:u" =
+
{{Anchor|CfgNor}}{{Anchor|CFGNOR}}{{Anchor|cfg:nor}}
This only handles the commands listed under the above "Config services", no additional commands.
 
 
 
 
= Config NVRAM service "cfg:nor" =
 
= Config NVRAM service "cfg:nor" =
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 243: Line 278:
 
| 0x00020000
 
| 0x00020000
 
| [[CfgNor:Shutdown|Shutdown]]
 
| [[CfgNor:Shutdown|Shutdown]]
 +
|-
 +
| 0x00030040
 +
| (u8 flag) Writes the input flag to state. Uses SPI service command [[SPI_Services|EnableSpiBus]].
 +
|-
 +
| 0x00040000
 +
| Writes the u8 from the state written by 0x00030040 to cmdreply[2].
 
|-
 
|-
 
| 0x00050082
 
| 0x00050082
Line 249: Line 290:
 
| 0x00060082
 
| 0x00060082
 
| [[CfgNor:WriteData|WriteData]]
 
| [[CfgNor:WriteData|WriteData]]
 +
|-
 +
| 0x00070000
 +
| This just uses the WREN command.
 +
|-
 +
| 0x00080000
 +
| This just uses the WRDI command.
 +
|-
 +
| 0x00090000
 +
| [[CfgNor:ReadIdentification|ReadIdentification]]
 +
|-
 +
| 0x000A0000
 +
| This waits for the WIP bit in the status register to clear(wait for writing to finish).
 +
|-
 +
| 0x000B0000
 +
| This waits for the WEL bit in the status register to become set(write enabled).
 +
|-
 +
| 0x000C0000
 +
| This writes the value of the WIP bit in the status register to u8 cmdreply[2].
 +
|-
 +
| 0x000D0000
 +
| This writes the value of the WIP bit in the status register to u8 cmdreply[2].
 +
|-
 +
| 0x000E0000
 +
| [[CfgNor:ReadStatusRegister|ReadStatusRegister]]
 +
|-
 +
| 0x000F0082
 +
| [[CfgNor:ReadDataOther|ReadDataOther]]
 +
|-
 +
| 0x00100082
 +
| [[CfgNor:WriteDataOther|WriteDataOther]]
 +
|-
 +
| 0x00110040
 +
| (u32 offset) Uses command WREN then waits for WEL to become enabled. Sends command 0xDB to SPI followed by the specified flash offset.
 +
|-
 +
| 0x00120040
 +
| (u32 offset) Identical to 0x00110040 except this uses SPI-command 0xD8 instead("block erase").
 +
|-
 +
| 0x00130000
 +
| This uses SPI command 0xB9 for "Deep power down".
 +
|-
 +
| 0x00140000
 +
| This uses SPI command 0xAB for "Release from deep power down".
 
|}
 
|}
This is an interface for the "SPI::NOR" service, for accessing the Wifi NVRAM/SPI Flash.
+
This is an interface for the [[SPI::NOR]] service, for accessing the Wifi NVRAM/SPI Flash.
 +
 
 +
[[Category:Services]]

Latest revision as of 12:33, 18 September 2024

Config service "cfg:u"[edit]

Command Header Available since system version Description
0x00010082 GetConfigInfoBlk2/GetConfig
0x00020000 SecureInfoGetRegion/GetRegion
0x00030040 GenHashConsoleUnique/GetTransferableId
0x00040000 3.0.0-5 GetRegionCanadaUSA/IsCoppacsSupported
0x00050000 5.0.0-11 GetSystemModel
0x00060000 6.0.0-11 GetModelNintendo2DS
0x00070040 7.0.0-13 (u8 val) This writes the input u8 to the first byte in the config-block for blkID 0x00160000.
0x00080080 7.0.0-13 TranslateCountryInfo
0x00090040 7.0.0-13 GetCountryCodeString
0x000A0040 7.0.0-13 GetCountryCodeID
0x000B0000 9.3.0-X IsFangateSupported

Config service "cfg:s"[edit]

cfg:s contains all the commands in cfg:u, in addition to the following:

Command Header Available since system version Description
0x04010082 GetConfigInfoBlk8
0x04020082 SetConfigInfoBlk4
0x04030000 UpdateConfigNANDSavegame
0x04040042 GetLocalFriendCodeSeedData
0x04050000 GetLocalFriendCodeSeed
0x04060000 SecureInfoGetRegion
0x04070000 SecureInfoGetByte101
0x04080042 SecureInfoGetSerialNo
0x04090000 UpdateConfigBlk00040003
0x040A0000 ? ?
0x040B0000 ? ?
0x040C0000 ? ?
0x040D0040 SetUUIDClockSequence
0x040E0000 GetUUIDClockSequence
0x040F0000 ClearParentalControls

CfgS command 0x04060000(SecureInfoGetRegion) is used by NIM module to determine the SOAP RegionId, when sending SOAP requests. See here.

Config service "cfg:i"[edit]

cfg:i contains all the commands in cfg:u and cfg:s, in addition to the following:

Command Header Available since system version Description
0x08010082 GetConfigInfoBlk8
0x08020082 SetConfigInfoBlk4
0x08030000 UpdateConfigNANDSavegame
0x080400C2 CreateConfigInfoBlk
0x08050000 DeleteConfigNANDSavefile
0x08060000 FormatConfig
0x08070000 This basically just returns result-code value 0x0, due to code this eventually executes being NOPed out.
0x08080000 This updates the config blocks for blkIDs 0x0 and 0x20000. In certain cases this may call the code for FormatConfig.
0x08090000 This updates the config block for blkID 0x60000.
0x080A0000 ResetAnalogStickCalibrationParam? This updates the config block for blkID 0x00040001.
0x080B0082 SetGetLocalFriendCodeSeedData
0x080C0042 SetLocalFriendCodeSeedSignature
0x080D0000 DeleteCreateNANDLocalFriendCodeSeed
0x080E0000 VerifySigLocalFriendCodeSeed
0x080F0042 GetLocalFriendCodeSeedData
0x08100000 GetLocalFriendCodeSeed
0x08110084 SetSecureInfo
0x08120000 DeleteCreateNANDSecureInfo
0x08130000 VerifySigSecureInfo
0x08140042 SecureInfoGetData
0x08150042 SecureInfoGetSignature
0x08160000 SecureInfoGetRegion
0x08170000 SecureInfoGetByte101
0x08180042 SecureInfoGetSerialNo
0x0819.... ? ?
0x081A.... ? ?
0x081B.... ? ?
0x081C.... ? ?
0x081D.... ? ?
0x081E.... ? ?
0x081F.... ? ?
0x0820.... ? ?

Config NVRAM service "cfg:nor"[edit]

Command Header Description
0x00010040 Initialize
0x00020000 Shutdown
0x00030040 (u8 flag) Writes the input flag to state. Uses SPI service command EnableSpiBus.
0x00040000 Writes the u8 from the state written by 0x00030040 to cmdreply[2].
0x00050082 ReadData
0x00060082 WriteData
0x00070000 This just uses the WREN command.
0x00080000 This just uses the WRDI command.
0x00090000 ReadIdentification
0x000A0000 This waits for the WIP bit in the status register to clear(wait for writing to finish).
0x000B0000 This waits for the WEL bit in the status register to become set(write enabled).
0x000C0000 This writes the value of the WIP bit in the status register to u8 cmdreply[2].
0x000D0000 This writes the value of the WIP bit in the status register to u8 cmdreply[2].
0x000E0000 ReadStatusRegister
0x000F0082 ReadDataOther
0x00100082 WriteDataOther
0x00110040 (u32 offset) Uses command WREN then waits for WEL to become enabled. Sends command 0xDB to SPI followed by the specified flash offset.
0x00120040 (u32 offset) Identical to 0x00110040 except this uses SPI-command 0xD8 instead("block erase").
0x00130000 This uses SPI command 0xB9 for "Deep power down".
0x00140000 This uses SPI command 0xAB for "Release from deep power down".

This is an interface for the SPI::NOR service, for accessing the Wifi NVRAM/SPI Flash.