You copied the Doc URL to your clipboard.

3.3.11. c2, Translation Table Base Control Register, TTBCR

The purpose of the Translation Table Base Control Register is to determine whether a page table miss for a specific Virtual Address uses Translation Table Base Register 0 or Translation Table Base Register 1.

  • Use of Translation Table Base Register 0 is recommended for task-specific addresses.

  • Use of Translation Table Base Register 1 is recommended use for operating system and I/O addresses.

The Translation Table Base Control Register is:

  • in CP15 c2

  • a 32 bit read/write register

  • accessible in privileged mode only.

Figure 3.31 shows the arrangement of bits in the register.

Figure 3.31. Translation Table Base Control Register format

Figure 3.31. Translation Table Base Control Register
format

Figure 3.31 shows that there is a single bit field in the register. This holds a three-bit value, N. When N is greater than zero it specifies the boundary size of the Transition Table Base Register 0, see c2, Translation Table Base Register 0, TTBR0. Table 3.56 shows the meaning of different values of N.

Table 3.56. Values of N for Translation Table Base Register 0
NTranslation Table Base Register 0 page table boundary size
016KB
18KB
24KB
32KB
41KB
5512-byte
6256-byte
7128-byte

Accessing the Translation Table Base Control Register

Table 3.57 shows the results of attempted accesses to the Translation Table Base Control Register for each mode.

Table 3.57. Results of accesses to the Translation Table Base Control Register
Privileged readPrivileged writeUser read or write
Data readData writeUndefined Instruction exception

To access the Translation Table Base Control Register you read or write CP15 with:

  • Opcode_1 set to 0

  • CRn set to c2

  • CRm set to c0

  • Opcode_2 set to 2.

For example:

MRC p15, 0, <Rd>, c2, c0, 2      ; Read Translation Table Base Control Register
MCR p15, 0, <Rd>, c2, c0, 2      ; Write Translation Table Base Control Register

Reading from CP15 c2 returns the size of the page table boundary for Translation Table Base Register 0. Bits [31:3] Read As Zero.

Writing to CP15 c2 updates the size, N, of the first-level translation table base boundary for Translation Table Base Register 0.

Selecting which Translation Table Base Register is used

The Translation Table Base Register is selected as follows:

  1. If N = 0, always use Translation Table Base Register 0.

    This is the default case at reset. It is backwards compatible with ARMv5 or earlier processors.

  2. If N is greater than 0, then:

    • if bits [31:32-N] of the Virtual Address are all 0, use Translation Table Base Register 0

    • otherwise use Translation Table Base Register 1.

Note

N must be in the range 0 to 7.