diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-07-13 13:14:16 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-08-22 20:24:31 +0000 |
commit | b98391c0ee3d9d95b3c256e3ce170ff52b98b2c4 (patch) | |
tree | 95db27ec9a2a183f935bd1f3c62103d71be425d2 /src/cpu/amd/car/disable_cache_as_ram.c | |
parent | a429761b7befa46f638e6fa2e5dc83fc2a2d46cb (diff) |
AMD K8 fam10-15: Tidy up CAR disable
Avoid conflicting disable_cache_as_ram() declaration and tidy
up include for inlined function.
Change-Id: Iba77c711f5eb023566b7d8ba148583948661bc99
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/20563
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/cpu/amd/car/disable_cache_as_ram.c')
-rw-r--r-- | src/cpu/amd/car/disable_cache_as_ram.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/cpu/amd/car/disable_cache_as_ram.c b/src/cpu/amd/car/disable_cache_as_ram.c index a8ff1cc17a..af5a2e985d 100644 --- a/src/cpu/amd/car/disable_cache_as_ram.c +++ b/src/cpu/amd/car/disable_cache_as_ram.c @@ -33,7 +33,7 @@ static inline __attribute__((always_inline)) uint32_t amd_fam1x_cpu_family(void) } static inline __attribute__((always_inline)) -void disable_cache_as_ram(uint8_t skip_sharedc_config) +void disable_cache_as_ram_real(uint8_t skip_sharedc_config) { msr_t msr; uint32_t family; @@ -45,15 +45,13 @@ void disable_cache_as_ram(uint8_t skip_sharedc_config) msr.lo = 0; msr.hi = 0; wrmsr(MTRR_FIX_4K_C8000, msr); -#if CONFIG_DCACHE_RAM_SIZE > 0x8000 - wrmsr(MTRR_FIX_4K_C0000, msr); -#endif -#if CONFIG_DCACHE_RAM_SIZE > 0x10000 - wrmsr(MTRR_FIX_4K_D0000, msr); -#endif -#if CONFIG_DCACHE_RAM_SIZE > 0x18000 - wrmsr(MTRR_FIX_4K_D8000, msr); -#endif + if (CONFIG_DCACHE_RAM_SIZE > 0x8000) + wrmsr(MTRR_FIX_4K_C0000, msr); + if (CONFIG_DCACHE_RAM_SIZE > 0x10000) + wrmsr(MTRR_FIX_4K_D0000, msr); + if (CONFIG_DCACHE_RAM_SIZE > 0x18000) + wrmsr(MTRR_FIX_4K_D8000, msr); + /* disable fixed mtrr from now on, * it will be enabled by ramstage again */ @@ -110,8 +108,3 @@ void disable_cache_as_ram(uint8_t skip_sharedc_config) } #endif } - -static void disable_cache_as_ram_bsp(void) -{ - disable_cache_as_ram(0); -} |