2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2008 coresystems GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 "movb $0x30, %al\noutb %al, $0x80\n"
26 "orl $(1 << 30), %eax\n"
29 "movb $0x31, %al\noutb %al, $0x80\n"
32 "movl $MTRRdefType_MSR, %ecx\n"
34 "andl $(~(1 << 11)), %eax\n"
37 "movb $0x32, %al\noutb %al, $0x80\n"
43 "movl $MTRRphysBase_MSR(0), %ecx\n"
45 "movl $MTRRphysMask_MSR(0), %ecx\n"
47 "movl $MTRRphysBase_MSR(1), %ecx\n"
49 "movl $MTRRphysMask_MSR(1), %ecx\n"
53 "movb $0x33, %al\noutb %al, $0x80\n"
54 #ifdef CLEAR_FIRST_1M_RAM
55 "movb $0x34, %al\noutb %al, $0x80\n"
56 /* Enable Write Combining and Speculative Reads for the first 1MB */
57 "movl $MTRRphysBase_MSR(0), %ecx\n"
58 "movl $(0x00000000 | MTRR_TYPE_WRCOMB), %eax\n"
61 "movl $MTRRphysMask_MSR(0), %ecx\n"
62 "movl $(~(1024*1024 -1) | (1 << 11)), %eax\n"
65 "movb $0x35, %al\noutb %al, $0x80\n"
70 "andl $~( (1 << 30) | (1 << 29) ), %eax\n"
73 "movb $0x36, %al\noutb %al, $0x80\n"
74 #ifdef CLEAR_FIRST_1M_RAM
76 /* Clear first 1MB of RAM */
77 "movl $0x00000000, %edi\n"
80 "movl $((1024*1024) / 4), %ecx\n"
83 "movb $0x37, %al\noutb %al, $0x80\n"
88 "orl $(1 << 30), %eax\n"
91 "movb $0x38, %al\noutb %al, $0x80\n"
93 /* Enable Write Back and Speculative Reads for the first 1MB */
94 "movl $MTRRphysBase_MSR(0), %ecx\n"
95 "movl $(0x00000000 | MTRR_TYPE_WRBACK), %eax\n"
98 "movl $MTRRphysMask_MSR(0), %ecx\n"
99 "movl $(~(1024*1024 -1) | (1 << 11)), %eax\n"
103 "movb $0x39, %al\noutb %al, $0x80\n"
105 /* And Enable Cache again after setting MTRRs */
107 "andl $~( (1 << 30) | (1 << 29) ), %eax\n"
110 "movb $0x3a, %al\noutb %al, $0x80\n"
113 "movl $MTRRdefType_MSR, %ecx\n"
115 "orl $(1 << 11), %eax\n"
118 "movb $0x3b, %al\noutb %al, $0x80\n"
120 /* Invalidate the cache again */
122 "movb $0x3c, %al\noutb %al, $0x80\n"