Vol. 3 11-39
MEMORY CACHE CONTROL
3FFFFFH (2 MBytes to 4 MBytes), a mask value of FFFE00000H is required. Again, the
12 least-significant bits of this mask value are truncated, so that the value entered in
the PhysMask field of IA32_MTRR_PHYSMASK3 is FFFE00H. This mask is chosen so
that when any address in the 200000H to 3FFFFFH range is AND’d with the mask
value, it will return the same value as when the base address is AND’d with the mask
value (which is 200000H).
To map the address range from 400000H to 7FFFFFH (4 MBytes to 8 MBytes), a base
value of 000400H is entered in the PhysBase field and a mask value of FFFC00H is
entered in the PhysMask field.
Example 11-2. Setting-Up Memory for a System
Here is an example of setting up the MTRRs for an system. Assume that the system
has the following characteristics:
• 96 MBytes of system memory is mapped as write-back memory (WB) for highest
system performance.
• A custom 4-MByte I/O card is mapped to uncached memory (UC) at a base
address of 64 MBytes. This restriction forces the 96 MBytes of system memory to
be addressed from 0 to 64 MBytes and from 68 MBytes to 100 MBytes, leaving a
4-MByte hole for the I/O card.
• An 8-MByte graphics card is mapped to write-combining memory (WC) beginning
at address A0000000H.
• The BIOS area from 15 MBytes to 16 MBytes is mapped to UC memory.
The following settings for the MTRRs will yield the proper mapping of the physical
address space for this system configuration.
IA32_MTRR_PHYSBASE0 = 0000 0000 0000 0006H
IA32_MTRR_PHYSMASK0 = 0000 000F FC00 0800H
Caches 0-64 MByte as WB cache type.
IA32_MTRR_PHYSBASE1 = 0000 0000 0400 0006H
IA32_MTRR_PHYSMASK1 = 0000 000F FE00 0800H
Caches 64-96 MByte as WB cache type.
IA32_MTRR_PHYSBASE2 = 0000 0000 0600 0006H
IA32_MTRR_PHYSMASK2 = 0000 000F FFC0 0800H
Caches 96-100 MByte as WB cache type.
IA32_MTRR_PHYSBASE3 = 0000 0000 0400 0000H
IA32_MTRR_PHYSMASK3 = 0000 000F FFC0 0800H
Caches 64-68 MByte as UC cache type.
IA32_MTRR_PHYSBASE4 = 0000 0000 00F0 0000H
IA32_MTRR_PHYSMASK4 = 0000 000F FFF0 0800H
Caches 15-16 MByte as UC cache type.