Difference between revisions of "CONFIG11 Registers"

From 3dbrew
Jump to navigation Jump to search
 
(103 intermediate revisions by 14 users not shown)
Line 8: Line 8:
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| [[#PDN_SPI_CNT|PDN_SPI_CNT]]
+
| [[#CFG11_SHAREDWRAM_32K_CODE|CFG11_SHAREDWRAM_32K_CODE]]<0-7>
| 0x101401C0
+
| 0x10140000
| 4
+
| 1*8
| [[SPI Services]]
+
| Boot11, Process9, [[DSP Services]]
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| [[#PDN_SHAREDWRAM_32K_DATA|PDN_SHAREDWRAM_32K_DATA]]<0-7>
+
| [[#CFG11_SHAREDWRAM_32K_DATA|CFG11_SHAREDWRAM_32K_DATA]]<0-7>
| 0x10141000
+
| 0x10140008
 
| 1*8
 
| 1*8
|  
+
| Boot11, Process9, [[DSP Services]]
|-
+
|-style="border-top: double"
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| [[#PDN_SHAREDWRAM_32K_CODE|PDN_SHAREDWRAM_32K_CODE]]<0-7>
+
| [[#CFG11_NULLPAGE_CNT|CFG11_NULLPAGE_CNT]]
| 0x10141008
+
| 0x10140100
| 1*8
+
| 4
 
|  
 
|  
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| ?
+
| [[#CFG11_FIQ_MASK|CFG11_FIQ_MASK]]
| 0x10141100
+
| 0x10140104
 
| 1
 
| 1
|
+
| Kernel11.
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| ?
+
| Debug related bitfield?
| 0x10141103
+
Observed: 0b1100(N3DS)/0b0000(O3DS)
 +
| 0x10140105
 
| 1
 
| 1
|
+
|  
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| ?
+
| [[#CFG11_CDMA_CNT|CFG_CDMA_CNT]]
| 0x10141104
+
| 0x1014010C
| 1
+
| 2
|
+
| TwlBg
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| ?
+
| [[#CFG11_GPUPROT|CFG11_GPUPROT]]
| 0x10141105
+
| 0x10140140
| 1
+
| 4
|
+
| Kernel11
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| ?
+
| [[#CFG11_WIFICNT|CFG11_WIFICNT]]
| 0x10141108
+
| 0x10140180
 
| 1
 
| 1
|
+
| TwlBg, [[NWM Services]]
 
|-
 
|-
 
| style="background: green" | Yes
 
| style="background: green" | Yes
| PDN_WIFI?
+
| [[#CFG11_SPI_CNT|CFG11_SPI_CNT]]
| 0x1014110C
+
| 0x101401C0
| 1
+
| 2
|
+
| [[SPI Services]], TwlBg
|-
+
|-style="border-top: double"
 
| style="background: green" | Yes
 
| style="background: green" | Yes
 
| ?
 
| ?
| 0x10141140
+
| 0x10140200
| 1
+
| 4
 
|
 
|
|-
+
|-style="border-top: double"
| style="background: green" | Yes
+
| style="background: red" | No
| ?
+
| [[#CFG11_GPU_N3DS_CNT|CFG11_GPU_N3DS_CNT]]
| 0x10141141
+
| 0x10140400
 
| 1
 
| 1
|
+
| NewKernel11
 
|-
 
|-
| style="background: green" | Yes
+
| style="background: red" | No
| [[#PDN_WIFI_CNT|PDN_WIFI_CNT]]
+
| [[#CFG11_CDMA_PERIPHERALS|CFG11_CDMA_PERIPHERALS]]
| 0x10141180
+
| 0x10140410
| 1
+
| 4
|
+
| NewKernel11
 
|-
 
|-
| style="background: green" | Yes
+
| style="background: red" | No
| [[#PDN_HID_CNT|PDN_HID_CNT]]
+
| [[#CFG11_BOOTROM_OVERLAY_CNT|CFG11_BOOTROM_OVERLAY_CNT]]
| 0x101411C0
+
| 0x10140420
 
| 1
 
| 1
|
+
| NewKernel11
 
|-
 
|-
| style="background: green" | Yes
+
| style="background: red" | No
| ?
+
| [[#CFG11_BOOTROM_OVERLAY_VAL|CFG11_BOOTROM_OVERLAY_VAL]]
| 0x10141200
+
| 0x10140424
 
| 4
 
| 4
|
+
| NewKernel11
 
|-
 
|-
| style="background: green" | Yes
+
| style="background: red" | No
 
| ?
 
| ?
| 0x10141FFC
+
| 0x10140428
 
| 4
 
| 4
 
|
 
|
 +
|-style="border-top: double"
 +
| style="background: green" | Yes
 +
| [[#CFG11_SOCINFO|CFG11_SOCINFO]]
 +
| 0x10140FFC
 +
| 2
 +
| Boot11, Kernel11
 +
|}
 +
 +
== CFG11_SHAREDWRAM_32K_CODE ==
 +
Used for mapping 32K chunks of shared WRAM for DSP data.
 +
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 +
|-
 +
| 0-1
 +
| Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/code)
 
|-
 
|-
| style="background: green" | Yes
+
| 2-4
| PDN_PTM_0
+
| Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)
| 0x10141008
+
|-
| 4
+
| 5-6
| [[PTM Services]]
+
| Not used (0)
 
|-
 
|-
| style="background: green" | Yes
+
| 7
| PDN_PTM_1
+
| Enable (0=Disable, 1=Enable)
| 0x1014100C
+
|}
| 4
+
 
| [[PTM Services]]
+
== CFG11_SHAREDWRAM_32K_DATA ==
 +
Used for mapping 32K chunks of shared WRAM for DSP data.
 +
 
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 
|-
 
|-
| style="background: green" | Yes
+
| 0-1
| [[#PDN_TWLMODE|PDN_TWLMODE]]
+
| Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/data)
| 0x10141100
 
| 2
 
|
 
 
|-
 
|-
| style="background: green" | Yes
+
| 2-4
| ?
+
| Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)
| 0x10141104
 
| 2
 
|
 
 
|-
 
|-
| style="background: green" | Yes
+
| 5-6
| ?
+
| Not used (0)
| 0x10141110
 
| 2
 
|
 
 
|-
 
|-
| style="background: green" | Yes
+
| 7
| ?
+
| Enable (0=Disable, 1=Enable)
| 0x10141112
+
|}
| 2
+
 
|
+
== CFG11_NULLPAGE_CNT ==
 +
{| class="wikitable" border="1"
 +
!  Bit
 +
!  Description
 
|-
 
|-
| style="background: green" | Yes
+
| 0
| [[#PDN_CODEC|PDN_CODEC_0]]
+
| Trap all ''data'' accesses to physmem addresses 0x0000 to 0x1000
| 0x10141114
 
| 2
 
| [[CODEC Services]]
 
 
|-
 
|-
| style="background: green" | Yes
+
| 16
| [[#PDN_CODEC|PDN_CODEC_1]]
+
| Unknown
| 0x10141116
+
|}
| 2
+
 
| [[CODEC Services]]
+
The reset value of this register is 0x10000.
 +
 
 +
== CFG11_FIQ_MASK ==
 +
Write bit N to mask FIQ interrutps on core N? (judging from what Kernel11 does -- it only ever configures FIQ for core1)
 +
 
 +
Reset value: 0xF
 +
 
 +
== CFG11_CDMA_CNT ==
 +
Write 1 to enable, to disable.
 +
 
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 
|-
 
|-
| style="background: green" | Yes
+
| 0
| [[#PDN_LCD_CNT|PDN_LCD_CNT]]
+
| Enable Microphone DMA (CDMA 0x00)
| 0x10141200
 
| 1
 
| Boot11 sets/clears bit16, bit0.
 
 
|-
 
|-
| style="background: green" | Yes
 
| [[#PDN_BACKLIGHT_CNT|PDN_BACKLIGHT_CNT]]
 
| 0x10141202
 
 
| 1
 
| 1
|
+
| Enable NTRCARD DMA on Arm11 side (CDMA 0x01)
 
|-
 
|-
| style="background: green" | Yes
+
| 2-4
 
| ?
 
| ?
| 0x10141204
 
| 1
 
| Boot11 sets/clears bit0.
 
 
|-
 
|-
| style="background: green" | Yes
+
| 5
| ?
+
| WiFi. Enabled during kernel init since 11.4.
| 0x10141210
+
|}
 +
 
 +
== CFG11_SPI_CNT ==
 +
When the corresponding bit is 0, the bus has to be accessed using the DS SPI registers. Otherwise it has to be accessed using the 3DS SPI registers.
 +
{| class="wikitable" border="1"
 +
!  Bit
 +
!  Description
 +
|-
 +
| 0
 +
| Enable [[SPI Registers]] 0x10160800.
 +
|-
 
| 1
 
| 1
|
+
| Enable [[SPI Registers]] 0x10142800.
 
|-
 
|-
| style="background: green" | Yes
+
| 2
| [[#PDN_CODEC_CNT|PDN_CODEC_CNT]]
+
| Enable [[SPI Registers]] 0x10143800.
| 0x10141220
+
|}
| 1
+
 
|
+
== CFG11_GPU_N3DS_CNT ==
 +
{| class="wikitable" border="1"
 +
!  Bit
 +
!  Description
 
|-
 
|-
| style="background: green" | Yes
+
| 0
| [[#PDN_CAMERA_CNT|PDN_CAMERA_CNT]]
+
| Enable N3DS mode? (enables access to the extra N3DS FCRAM banks, etc.)
| 0x10141224
 
| 1
 
|
 
 
|-
 
|-
| style="background: green" | Yes
 
| ?
 
| 0x10141230
 
 
| 1
 
| 1
|
+
| Texture related? (observing texture glitches when disabling this bit)
 
|}
 
|}
  
== PDN_SPI_CNT ==
+
== CFG11_CDMA_PERIPHERALS ==
Bit0-3: Enable SPI bus.
+
{| class="wikitable" border="1"
 +
!  Bit
 +
!  Description
 +
|-
 +
| 0-17
 +
| CDMA Peripheral 0x00-0x11 data request target (0=Old CDMA, 1=New CDMA)
 +
|-
 +
| 18-31
 +
| Unused
 +
|}
  
== PDN_SHAREDWRAM_32K_DATA ==
+
== CFG11_BOOTROM_OVERLAY_CNT ==
Used for mapping 32K chunks of shared WRAM for DSP code.
+
Bit0: Enable bootrom overlay functionality.
  
  0-1  Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/code)
+
== CFG11_BOOTROM_OVERLAY_VAL ==
  2-4  Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)
+
The 32-bit value to overlay data-reads to bootrom with. See [[PDN Registers#PDN_LGR_CPU_CNT<0-3>|PDN_LGR_CPU_CNT]]<0-3>.
  5-6  Not used (0)
 
  7    Enable (0=Disable, 1=Enable)
 
  
== PDN_SHAREDWRAM_32K_CODE ==
+
== CFG11_SOCINFO ==
Used for mapping 32K chunks of shared WRAM for DSP data.
+
Read-only register. Identifies the maximum mode-switching capabilities of the SoC.
  
  0-1  Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/data)
+
* CTR: O3DS
  2-4 Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)
+
* LGR1: N3DS prototype, 4 cores (orginally 2), up to 535MHz, no L2C (see below)
  5-6  Not used (0)
+
* LGR2: retail N3DS, 4 cores, up to 804MHz, has L2C
  7    Enable (0=Disable, 1=Enable)
 
  
==PDN_WIFI_CNT==
+
Kernel code suggests that devices that support LGR1 but not LGR2 only had 2 cores. All cores (the number of which can be read from MPCORE SCU registers) are usable in LGR1 mode.
Bit0: Enable wifi.
 
  
==PDN_HID_CNT==
+
{| class="wikitable" border="1"
Bit0: Enable [[HID Registers]].
+
!  Bits
 +
!  Description
 +
!  Used by
 +
|-
 +
| 0
 +
| CTR mode (1 on all 3DSes)
 +
| Boot11
 +
|-
 +
| 1
 +
| LGR1 (1 on all N3DSes, orginally 2 cores, and 2x clockrate)
 +
| Kernel11
 +
|-
 +
| 2
 +
| LGR2 (1 on all released N3DSes, 4 cores and 3x clockrate)
 +
| Kernel11
 +
|}
  
==PDN_TWLMODE==
+
==CFG11_GPUPROT==
The very last 3DS-mode register poke the [[FIRM|TWL_FIRM]] Process9 does before it gets switched into TWL-mode, is writing 0x8000 to this register. Before writing this register, TWL Process9 waits for the value of this register to become non-zero. The Process9 code for this runs from ITCM, since switching into TWL-mode includes remapping all ARM9 physical memory.
+
{| class="wikitable" border="1"
 +
!  Old3DS
 +
!  Bits
 +
!  Description
 +
|-
 +
| style="background: green" | Yes
 +
| 3-0
 +
| Old FCRAM DMA cutoff size, 0 = no protection.
 +
|-
 +
| style="background: red" | No
 +
| 7-4
 +
| New FCRAM DMA cutoff size, 0 = no protection.
 +
|-
 +
| style="background: green" | Yes
 +
| 8
 +
| AXIWRAM protection, 0 = accessible.
 +
|-
 +
| style="background: red" | No
 +
| 10-9
 +
| QTM DMA cutoff size
 +
|-
 +
| style="background: green" | Yes
 +
| 31-11
 +
| Zeroes
 +
|}
  
Writing 0x8000 to here from the ARM9 with NATIVE_FIRM running doesn't seem to do anything, other reg-pokes likely need done first.
+
For the old FCRAM DMA cutoff, it protects starting from 0x28000000-(0x800000*x) until end of FCRAM. There is no way to protect the first 0x800000-bytes.
  
==PDN_LCD_CNT==
+
For the new FCRAM DMA cutoff, it protects starting from 0x30000000-(0x800000*x) until end of FCRAM. When the old FCRAM cutoff is set to non-zero, the first 0x800000-bytes bytes of new FCRAM are protected.
This one seems to control the LCD displays?
 
  
==PDN_BACKLIGHT_CNT==
+
On New3DS the old+new FCRAM cutoff can be used at the same time, however this isn't done officially.
This is the power register used for the LCD backlights.
 
  
bit0 = turn on/off LCD backlight, rest = always 0.
+
For the QTM DMA cutoff, it protects starting from 0x1F400000-(0x100000*x) until end of QTM mem.
  
==PDN_CODEC==
+
On cold boot this reg is set to 0.
The following is the only time the ARM11 CODEC module uses any 0x1EC41XXX registers. In one case CODEC module clears bit1 in register 0x1EC41114, in the other case CODEC module sets bit1 in registers 0x1EC41114 and 0x1EC41116.
 
  
==PDN_CODEC_CNT==
+
When this register is set to value 0, the GPU can access the entire FCRAM, AXIWRAM, and on New3DS all QTM-mem.
This is the power register used for the [[PDN_Services|PDN]] CODEC service.
 
  
bit0 = unknown, bit1 = turn on/off DSP, rest = always 0.
+
[[SVC|Initialized]] during kernel boot, and used with [[SVC]] 0x59 which was implemented with [[11.3.0-36|v11.3]].
  
==PDN_CAMERA_CNT==
+
==CFG11_WIFICNT==
This is the power register used for the [[PDN_Services|PDN]] camera service.
+
{| class="wikitable" border="1"
 
+
!  Old3DS
bit0 = unknown, bit1 = turn on/off cameras, rest = always 0.
+
!  Bits
 +
!  Description
 +
|-
 +
| style="background: green" | Yes
 +
| 0
 +
| Enable wifi subsystem
 +
|}

Latest revision as of 00:56, 27 January 2021

Registers[edit]

Old3DS Name Address Width Used by
Yes CFG11_SHAREDWRAM_32K_CODE<0-7> 0x10140000 1*8 Boot11, Process9, DSP Services
Yes CFG11_SHAREDWRAM_32K_DATA<0-7> 0x10140008 1*8 Boot11, Process9, DSP Services
Yes CFG11_NULLPAGE_CNT 0x10140100 4
Yes CFG11_FIQ_MASK 0x10140104 1 Kernel11.
Yes Debug related bitfield?

Observed: 0b1100(N3DS)/0b0000(O3DS)

0x10140105 1
Yes CFG_CDMA_CNT 0x1014010C 2 TwlBg
Yes CFG11_GPUPROT 0x10140140 4 Kernel11
Yes CFG11_WIFICNT 0x10140180 1 TwlBg, NWM Services
Yes CFG11_SPI_CNT 0x101401C0 2 SPI Services, TwlBg
Yes ? 0x10140200 4
No CFG11_GPU_N3DS_CNT 0x10140400 1 NewKernel11
No CFG11_CDMA_PERIPHERALS 0x10140410 4 NewKernel11
No CFG11_BOOTROM_OVERLAY_CNT 0x10140420 1 NewKernel11
No CFG11_BOOTROM_OVERLAY_VAL 0x10140424 4 NewKernel11
No ? 0x10140428 4
Yes CFG11_SOCINFO 0x10140FFC 2 Boot11, Kernel11

CFG11_SHAREDWRAM_32K_CODE[edit]

Used for mapping 32K chunks of shared WRAM for DSP data.

Bits Description
0-1 Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/code)
2-4 Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)
5-6 Not used (0)
7 Enable (0=Disable, 1=Enable)

CFG11_SHAREDWRAM_32K_DATA[edit]

Used for mapping 32K chunks of shared WRAM for DSP data.

Bits Description
0-1 Master (0=ARM9?, 1=ARM11?, 2 or 3=DSP/data)
2-4 Offset (0..7) (slot 0..7) (LSB of address in 32Kbyte units)
5-6 Not used (0)
7 Enable (0=Disable, 1=Enable)

CFG11_NULLPAGE_CNT[edit]

Bit Description
0 Trap all data accesses to physmem addresses 0x0000 to 0x1000
16 Unknown

The reset value of this register is 0x10000.

CFG11_FIQ_MASK[edit]

Write bit N to mask FIQ interrutps on core N? (judging from what Kernel11 does -- it only ever configures FIQ for core1)

Reset value: 0xF

CFG11_CDMA_CNT[edit]

Write 1 to enable, to disable.

Bits Description
0 Enable Microphone DMA (CDMA 0x00)
1 Enable NTRCARD DMA on Arm11 side (CDMA 0x01)
2-4 ?
5 WiFi. Enabled during kernel init since 11.4.

CFG11_SPI_CNT[edit]

When the corresponding bit is 0, the bus has to be accessed using the DS SPI registers. Otherwise it has to be accessed using the 3DS SPI registers.

Bit Description
0 Enable SPI Registers 0x10160800.
1 Enable SPI Registers 0x10142800.
2 Enable SPI Registers 0x10143800.

CFG11_GPU_N3DS_CNT[edit]

Bit Description
0 Enable N3DS mode? (enables access to the extra N3DS FCRAM banks, etc.)
1 Texture related? (observing texture glitches when disabling this bit)

CFG11_CDMA_PERIPHERALS[edit]

Bit Description
0-17 CDMA Peripheral 0x00-0x11 data request target (0=Old CDMA, 1=New CDMA)
18-31 Unused

CFG11_BOOTROM_OVERLAY_CNT[edit]

Bit0: Enable bootrom overlay functionality.

CFG11_BOOTROM_OVERLAY_VAL[edit]

The 32-bit value to overlay data-reads to bootrom with. See PDN_LGR_CPU_CNT<0-3>.

CFG11_SOCINFO[edit]

Read-only register. Identifies the maximum mode-switching capabilities of the SoC.

  • CTR: O3DS
  • LGR1: N3DS prototype, 4 cores (orginally 2), up to 535MHz, no L2C (see below)
  • LGR2: retail N3DS, 4 cores, up to 804MHz, has L2C

Kernel code suggests that devices that support LGR1 but not LGR2 only had 2 cores. All cores (the number of which can be read from MPCORE SCU registers) are usable in LGR1 mode.

Bits Description Used by
0 CTR mode (1 on all 3DSes) Boot11
1 LGR1 (1 on all N3DSes, orginally 2 cores, and 2x clockrate) Kernel11
2 LGR2 (1 on all released N3DSes, 4 cores and 3x clockrate) Kernel11

CFG11_GPUPROT[edit]

Old3DS Bits Description
Yes 3-0 Old FCRAM DMA cutoff size, 0 = no protection.
No 7-4 New FCRAM DMA cutoff size, 0 = no protection.
Yes 8 AXIWRAM protection, 0 = accessible.
No 10-9 QTM DMA cutoff size
Yes 31-11 Zeroes

For the old FCRAM DMA cutoff, it protects starting from 0x28000000-(0x800000*x) until end of FCRAM. There is no way to protect the first 0x800000-bytes.

For the new FCRAM DMA cutoff, it protects starting from 0x30000000-(0x800000*x) until end of FCRAM. When the old FCRAM cutoff is set to non-zero, the first 0x800000-bytes bytes of new FCRAM are protected.

On New3DS the old+new FCRAM cutoff can be used at the same time, however this isn't done officially.

For the QTM DMA cutoff, it protects starting from 0x1F400000-(0x100000*x) until end of QTM mem.

On cold boot this reg is set to 0.

When this register is set to value 0, the GPU can access the entire FCRAM, AXIWRAM, and on New3DS all QTM-mem.

Initialized during kernel boot, and used with SVC 0x59 which was implemented with v11.3.

CFG11_WIFICNT[edit]

Old3DS Bits Description
Yes 0 Enable wifi subsystem