Unify Local APIC address definitions
[coreboot.git] / src / mainboard / amd / serengeti_cheetah_fam10 / acpi / amd8111_isa.asl
1 //
2 // This file is part of the coreboot project.
3 //
4 // Copyright (C) 2007 Advanced Micro Devices, Inc.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; version 2 of the License.
9 //
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.
14 //
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
18 //
19
20 #include <arch/ioapic.h>
21 #include <cpu/x86/lapic_def.h>
22
23 //AMD8111 isa
24
25         Device (ISA)
26         {
27                 // lpc 0x00040000
28                 Method (_ADR, 0, NotSerialized)
29                 {
30                         Return (DADD(\_SB.PCI0.SBDN, 0x00010000))
31                 }
32
33                 OperationRegion (PIRY, PCI_Config, 0x51, 0x02) // LPC Decode Registers
34                 Field (PIRY, ByteAcc, NoLock, Preserve)
35                 {
36                         Z000,   2,       // Parallel Port Range
37                          ,   1,
38                         ECP,    1,       // ECP Enable
39                         FDC1,   1,       // Floppy Drive Controller 1
40                         FDC2,   1,       // Floppy Drive Controller 2
41                         Offset (0x01),
42                         Z001,   3,       // Serial Port A Range
43                         SAEN,   1,       // Serial Post A Enabled
44                         Z002,   3,       // Serial Port B Range
45                         SBEN,   1       // Serial Post B Enabled
46                 }
47
48                 Device (PIC)
49                 {
50                         Name (_HID, EisaId ("PNP0000"))
51                         Name (_CRS, ResourceTemplate ()
52                         {
53                                 IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
54                                 IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
55                                 IRQ (Edge, ActiveHigh, Exclusive) {2}
56                         })
57                 }
58
59                 Device (DMA1)
60                 {
61                         Name (_HID, EisaId ("PNP0200"))
62                         Name (_CRS, ResourceTemplate ()
63                         {
64                                 IO (Decode16, 0x0000, 0x0000, 0x01, 0x10)
65                                 IO (Decode16, 0x0080, 0x0080, 0x01, 0x10)
66                                 IO (Decode16, 0x00C0, 0x00C0, 0x01, 0x20)
67                                 DMA (Compatibility, NotBusMaster, Transfer16) {4}
68                         })
69                 }
70
71                 Device (TMR)
72                 {
73                         Name (_HID, EisaId ("PNP0100"))
74                         Name (_CRS, ResourceTemplate ()
75                         {
76                                 IO (Decode16, 0x0040, 0x0040, 0x01, 0x04)
77                                 IRQ (Edge, ActiveHigh, Exclusive) {0}
78                         })
79                 }
80
81                 Device (RTC)
82                 {
83                         Name (_HID, EisaId ("PNP0B00"))
84                         Name (_CRS, ResourceTemplate ()
85                         {
86                                 IO (Decode16, 0x0070, 0x0070, 0x01, 0x06)
87                                 IRQ (Edge, ActiveHigh, Exclusive) {8}
88                         })
89                 }
90
91                 Device (SPKR)
92                 {
93                         Name (_HID, EisaId ("PNP0800"))
94                         Name (_CRS, ResourceTemplate ()
95                         {
96                                 IO (Decode16, 0x0061, 0x0061, 0x01, 0x01)
97                         })
98                 }
99
100                 Device (COPR)
101                 {
102                         Name (_HID, EisaId ("PNP0C04"))
103                         Name (_CRS, ResourceTemplate ()
104                         {
105                                 IO (Decode16, 0x00F0, 0x00F0, 0x01, 0x10)
106                                 IRQ (Edge, ActiveHigh, Exclusive) {13}
107                         })
108                 }
109
110                 Device (SYSR)
111                 {
112                         Name (_HID, EisaId ("PNP0C02"))
113                         Name (_UID, 0x00)
114                         Name (SYR1, ResourceTemplate ()
115                         {
116                                 IO (Decode16, 0x04D0, 0x04D0, 0x01, 0x02) //report Thor NVRAM
117                                 IO (Decode16, 0x1100, 0x117F, 0x01, 0x80) //report Thor NVRAM
118                                 IO (Decode16, 0x1180, 0x11FF, 0x01, 0x80)
119                                 IO (Decode16, 0x0010, 0x0010, 0x01, 0x10)
120                                 IO (Decode16, 0x0022, 0x0022, 0x01, 0x1E)
121                                 IO (Decode16, 0x0044, 0x0044, 0x01, 0x1C)
122                                 IO (Decode16, 0x0062, 0x0062, 0x01, 0x02)
123                                 IO (Decode16, 0x0065, 0x0065, 0x01, 0x0B)
124                                 IO (Decode16, 0x0076, 0x0076, 0x01, 0x0A)
125                                 IO (Decode16, 0x0090, 0x0090, 0x01, 0x10)
126                                 IO (Decode16, 0x00A2, 0x00A2, 0x01, 0x1E)
127                                 IO (Decode16, 0x00E0, 0x00E0, 0x01, 0x10)
128                                 IO (Decode16, 0x0B78, 0x0B78, 0x01, 0x04) // Added this to remove ACPI Unrepoted IO Error
129                                 IO (Decode16, 0x0190, 0x0190, 0x01, 0x04) // Added this to remove ACPI Unrepoted IO Error
130                                 })
131                         Method (_CRS, 0, NotSerialized)
132                         {
133                                 Return (SYR1)
134                         }
135                 }
136
137                 Device (MEM)
138                 {
139                         Name (_HID, EisaId ("PNP0C02"))
140                         Name (_UID, 0x01)
141                         Method (_CRS, 0, NotSerialized)
142                         {
143                                 Name (BUF0, ResourceTemplate ()
144                                 {
145                                         Memory32Fixed (ReadWrite, 0x000E0000, 0x00020000) // BIOS E4000-FFFFF
146                                         Memory32Fixed (ReadWrite, 0x000C0000, 0x00010000) // video BIOS c0000-c8404
147                                         Memory32Fixed (ReadWrite, IO_APIC_ADDR, 0x00001000)
148                                         Memory32Fixed (ReadWrite, 0xFFC00000, 0x00380000) // LPC forwarded, 4 MB w/ROM
149                                         Memory32Fixed (ReadWrite, LOCAL_APIC_ADDR, 0x00001000)
150                                         Memory32Fixed (ReadWrite, 0xFFF80000, 0x00080000) // Overlay BIOS
151                                         Memory32Fixed (ReadWrite, 0x00000000, 0x00000000) // Overlay BIOS
152                                         Memory32Fixed (ReadWrite, 0x00000000, 0x00000000) // Overlay BIOS
153                                         Memory32Fixed (ReadWrite, 0x00000000, 0x00000000) // Overlay BIOS
154                                         Memory32Fixed (ReadWrite, 0x00000000, 0x00000000) // Overlay BIOS
155                                 })
156                                 // Read the Video Memory length
157                                 CreateDWordField (BUF0, 0x14, CLEN)
158                                 CreateDWordField (BUF0, 0x10, CBAS)
159
160                                 ShiftLeft (VGA1, 0x09, Local0)
161                                 Store (Local0, CLEN)
162
163                                 Return (BUF0)
164                         }
165                 }
166
167                 Device (PS2M)
168                 {
169                         Name (_HID, EisaId ("PNP0F13"))
170                         Name (_CRS, ResourceTemplate ()
171                         {
172                                 IRQNoFlags () {12}
173                         })
174                         Method (_STA, 0, NotSerialized)
175                         {
176                                 And (FLG0, 0x04, Local0)
177                                 If (LEqual (Local0, 0x04)) { Return (0x0F) }
178                                 Else { Return (0x00) }
179                         }
180                 }
181
182                 Device (PS2K)
183                 {
184                         Name (_HID, EisaId ("PNP0303"))
185                         Name (_CRS, ResourceTemplate ()
186                         {
187                                 IO (Decode16, 0x0060, 0x0060, 0x01, 0x01)
188                                 IO (Decode16, 0x0064, 0x0064, 0x01, 0x01)
189                                 IRQNoFlags () {1}
190                         })
191                 }
192                 #include "superio.asl"
193
194         }
195