2 /* be warned, this file will be used other cores and core 0 / node 0 */
3 static inline __attribute__((always_inline)) void disable_cache_as_ram(void)
6 /* We don't need cache as ram for now on */
8 "movl %%cr0, %%eax\n\t"
9 "orl $(0x1<<30),%%eax\n\t"
10 "movl %%eax, %%cr0\n\t"
13 "movl $0x269, %%ecx\n\t" /* fix4k_c8000*/
14 "xorl %%edx, %%edx\n\t"
15 "xorl %%eax, %%eax\n\t"
17 #if CONFIG_DCACHE_RAM_SIZE > 0x8000
18 "movl $0x268, %%ecx\n\t" /* fix4k_c0000*/
22 /* disable fixed mtrr from now on, it will be enabled by coreboot_ram again*/
23 "movl $0xC0010010, %%ecx\n\t"
24 // "movl $SYSCFG_MSR, %ecx\n\t"
26 "andl $(~(3<<18)), %%eax\n\t"
27 // "andl $(~(SYSCFG_MSR_MtrrFixDramModEn | SYSCFG_MSR_MtrrFixDramEn)), %eax\n\t"
30 /* Set the default memory type and disable fixed and enable variable MTRRs */
31 "movl $0x2ff, %%ecx\n\t"
32 // "movl $MTRRdefType_MSR, %ecx\n\t"
33 "xorl %%edx, %%edx\n\t"
34 /* Enable Variable and Disable Fixed MTRRs */
35 "movl $0x00000800, %%eax\n\t"
39 "movl %%cr0, %%eax\n\t"
40 "andl $0x9fffffff,%%eax\n\t"
41 "movl %%eax, %%cr0\n\t"
42 ::: "memory", "eax", "ecx", "edx"
46 static void disable_cache_as_ram_bsp(void)
48 disable_cache_as_ram();