x86: unify amd and non-amd MTRR routines
commit57686f848597f6b133c9d45a9b98a54638399b32
authorAaron Durbin <adurbin@chromium.org>
Wed, 20 Mar 2013 20:50:59 +0000 (20 15:50 -0500)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Fri, 22 Mar 2013 03:06:42 +0000 (22 04:06 +0100)
tree22c21ddc2f81cb3616a255061876042c8caf6a74
parentc8eab2c0441851a141ef47d10022fb385d0eacad
x86: unify amd and non-amd MTRR routines

The amd_mtrr.c file contains a copy of the fixed MTRR algorithm.
However, the AMD code needs to handle the RdMem and WrMem attribute
bits in the fixed MTRR MSRs. Instead of duplicating the code
with the one slight change introduce a Kconfig option,
X86_AMD_FIXED_MTRRS, which indicates that the RdMem and WrMem fields
need to be handled for writeback fixed MTRR ranges.

The order of how the AMD MTRR setup routine is maintained by providing
a x86_setup_fixed_mtrrs_no_enable() function which does not enable
the fixed MTRRs after setting them up. All Kconfig files which had a
Makefile that included amd/mtrr in the subdirs-y now have a default
X86_AMD_FIXED_MTRRS selection. There may be some overlap with the
agesa and socket code, but I didn't know the best way to tease out
the interdependency.

Change-Id: I256d0210d1eb3004e2043b46374dcc0337432767
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/2866
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
20 files changed:
src/cpu/amd/agesa/family10/Kconfig
src/cpu/amd/agesa/family12/Kconfig
src/cpu/amd/agesa/family14/Kconfig
src/cpu/amd/agesa/family15/Kconfig
src/cpu/amd/agesa/family15tn/Kconfig
src/cpu/amd/mtrr/amd_mtrr.c
src/cpu/amd/socket_754/Kconfig
src/cpu/amd/socket_939/Kconfig
src/cpu/amd/socket_940/Kconfig
src/cpu/amd/socket_AM2/Kconfig
src/cpu/amd/socket_AM2r2/Kconfig
src/cpu/amd/socket_AM3/Kconfig
src/cpu/amd/socket_ASB2/Kconfig
src/cpu/amd/socket_C32/Kconfig
src/cpu/amd/socket_F/Kconfig
src/cpu/amd/socket_F_1207/Kconfig
src/cpu/amd/socket_S1G1/Kconfig
src/cpu/x86/Kconfig
src/cpu/x86/mtrr/mtrr.c
src/include/cpu/x86/mtrr.h