System Configuration

# System Configuration (SCFG) Overview

The TWL system has features that can be configured for each hardware block. You can control the existence of a clock supply, compatibility with the Nintendo DS system, and other settings.

Because NITRO hardware does not include a system configuration (SCFG) block, these functions are generally assumed to be called to run on TWL hardware. However, the `SCFG_GetCpuSpeed` function has been designed to return the correct value regardless of the environment in which it is called.

## System ROM Settings

> The TWL system provides 64 KB of ARM9 system ROM for the TWL CPU and 8 KB of ARM9 system ROM for the NITRO CPU. This is switched by the ARM7. The ARM9 can determine which of these settings is in effect.

> This is obtained with the `SCFG_GetSystemRomType` function.

## Secure ROM Settings

> You can determine if ARM9 secure ROM is accessible from AHB. This is configured by the ARM7.

> This is obtained with the `SCFG_IsSecureRomAccessible` function.

## Clock Control for New Blocks

The TWL system can control the clock supply to the blocks below.

Camera CAM_CKI

> This is set by the `SCFG_SetCameraCKIClock` function, and its state is obtained with the `SCFG_IsCameraCKIClockEnable` function.

New WRAM (WRAM-A/B/C) Blocks

> The `SCFG_IsClockSuppliedToWram` function gets the state.
> This setting is configured by the ARM7 and fixed at startup and cannot be changed.

Camera I/F Block

> This is set by the `SCFG_SupplyClockToCamera` function, and its state is obtained with the `SCFG_IsClockSuppliedToCamera` function.

DSP Block

> This is set with the `SCFG_SupplyClockToDSP` function, and the state is obtained with the `SCFG_IsClockSuppliedToDSP` function.

## ARM9 Operating Frequency

> The TWL console can switch the operating frequency for the ARM9 processor to one of the following.
> - 67.03 MHz (equal to NITRO)
> - 134.06 MHz (double speed)
> This is set by the `SCFG_SetCpuSpeed` function, and its state is obtained with the `SCFG_GetCpuSpeed` function.

> This is switched safely by running code with necessary empty loops on the ITCM.

> In TWL mode, the frequency becomes double-speed when the process enters the `NitroMain` function, and this setting is not changed even by the `OS_Init` function.

## Access Settings

System Configuration Block

> You can control the SCFG library's access to the system configuration blocks. Access is disabled by the `SCFG_SetConfigBlockInaccessible` function.
> Once it has been disabled, all configuration blocks (including this access control) become inaccessible. Applications should not normally set this to be disabled.Call the `SCFG_IsConfigBlockAccessible` function to get the current state.

New WRAM (WRAM-A/B/C)

> Controls access to the new WRAM (WRAM-A/B/C). This is configured by the ARM7. The ARM9 can get the state with the `SCFG_IsWRamAccessible` function, but cannot change it.

New DMA

> Controls access to the new DMA block.
> This is set by the `SCFG_SetNDmaAccessible` function, and its state is obtained with the `SCFG_IsNDmaAccessible` function.
> This is set to be accessible in TWL mode by default.

Camera

> Controls access to the camera I/F block.
> This is set by the `SCFG_SetCameraAccessible` function, and its state is obtained with the `SCFG_IsCameraAccessible` function.
> This is set to be accessible in TWL mode by default.

DSP

> Controls access to the DSP block.
> This is set by the `SCFG_SetDSPAccessible` function, and its state is obtained with the `SCFG_IsDSPAccessible` function.
> This is set to be accessible in TWL mode by default.

## Extended Feature Settings

INTC Circuit

> The ARM9 interrupt controller can be configured to use extensions.
> This is set by the `SCFG_SetIntcExpanded` function, and its state is obtained with the `SCFG_IsIntcExpanded` function.
> Extensions are used in TWL mode by default.

LCDC Circuit

> The LCDC circuit can be configured to use extensions (INI loads).
> This is set by the `SCFG_SetLCDCExpanded` function, and its state is obtained with the `SCFG_IsLCDCExpanded` function.
> Extensions are used in TWL mode by default.

VRAM Access

> VRAM access can be configured to use extensions (per-byte writes and word access without wait states).
> This is set by the `SCFG_SetVramExpanded` function, and its state is obtained with the `SCFG_IsVramExpanded` function.
> Extensions are used in TWL mode by default.

## PSRAM Access Boundaries

> PSRAM access boundaries can be configured. The available choices are 4 MB, 16 MB, and 32 MB.
> This is set by the `SCFG_SetPsramBoundary` function, and its state is obtained with the `SCFG_GetPsramBoundary` function. You should not change this setting.

## NITRO Block Circuit Revisions

Old DMA Circuit

> You can use a revised version of the old NITRO DMA circuit.
> This is set by the `SCFG_SetDmacFixed` function, and its state is obtained with the `SCFG_IsDmacFixed` function.
> Revisions are not used by default.

Geometry Circuit

> You can use a revised version of the NITRO geometry circuit.
> This is set by the `SCFG_SetGeometryFixed` function, and its state is obtained with the `SCFG_IsGeometryFixed` function.
> Revisions are not used by default.

Renderer Circuit

> You can use a revised version of the NITRO renderer circuit.
> This is set by the `SCFG_SetRendererFixed` function, and its state is obtained with the `SCFG_IsRendererFixed` function.
> Revisions are not used by default.

2D Engine Circuit

> You can use a revised version of the NITRO 2D engine circuit.
> This is set by the `SCFG_Set2DEngineFixed` function, and its state is obtained with the `SCFG_Is2DEngineFixed` function.
> Revisions are not used by default.

Division Circuit

> You can use a revised version of the NITRO divider circuit.
> This is set by the `SCFG_SetDividerFixed` function, and its state is obtained with the `SCFG_IsDividerFixed` function.
> Revisions are not used by default.

Memory Card I/F Circuit

> You can use a revised version of the NITRO memory card I/F circuit.
> This is set by the `SCFG_SetCardFixed` function, and its state is obtained with the `SCFG_IsCardFixed` function.
> Revisions are not used by default.

## See Also

SCFG Function List

## Revision History

2009/01/19 Added an explanation about ARM9 operating frequency.
2008/07/15 Added See Also and Revision History.
2007/09/06 Initial version.

CONFIDENTIAL