Add support for A-Open DXPL Plus-U motherboard
[coreboot.git] / src / mainboard / aopen / dxplplusu / acpi / e7505_pri.asl
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2011 Kyösti Mälkki <kyosti.malkki@gmail.com>
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 Device (MBRS)
21 {
22         Name (_HID, EisaId ("PNP0C01"))
23         Name (_UID, 0x01)
24         Name (MSBF, ResourceTemplate ()
25         {
26                 /* System memory */
27                 QWordMemory (ResourceProducer, PosDecode, MinFixed,
28                         MaxNotFixed, Prefetchable, ReadWrite,
29                         0x0, 0x100000000, 0x400000000, 0x0, 0x0, ,, _Y1C,
30                         AddressRangeMemory, TypeStatic)
31
32                 /* Top Of Low Memory */
33                 Memory32 (ReadOnly, 0x0, 0x0, 0x1, 0x0, _Y1D)
34
35                 /* 640kB who wants more? */
36                 Memory32Fixed (ReadWrite, 0x0, 0xA0000, )
37
38                 /* 64k BIOS bootblock */
39                 Memory32Fixed (ReadOnly, 0xF0000, 0x10000,)
40
41                 /* ISA memory hole 15-16 MB ? */
42                 /* Memory32Fixed (ReadOnly, 0x100000, 0xF00000,) */
43                 /* ISA memory hole 14-15 MB ? */
44                 /* Memory32Fixed (ReadOnly, 0x100000, 0xE00000,) */
45
46                 /* Local APIC */
47                 Memory32Fixed (ReadWrite, 0xFEE00000, 0x00001000,)
48         })
49
50         Method (_CRS, 0, NotSerialized)
51         {
52                 CreateQWordField (MSBF, \_SB.MBRS._Y1C._MIN, MEML)
53                 CreateQWordField (MSBF, \_SB.MBRS._Y1C._MAX, MEMM)
54                 CreateQWordField (MSBF, \_SB.MBRS._Y1C._LEN, LELM)
55
56                 And (\_SB.PCI0.RLAR, 0x03FF, Local1)
57                 Increment (Local1)
58                 If (LGreater (Local1, 0x40))
59                 {
60                         ShiftLeft (Local1, 0x1A, LELM)
61                 }
62
63
64                 CreateDWordField (MSBF, \_SB.MBRS._Y1D._MIN, MS00)
65                 CreateDWordField (MSBF, \_SB.MBRS._Y1D._MAX, MS01)
66                 CreateDWordField (MSBF, \_SB.MBRS._Y1D._LEN, MEM2)
67                 And (\_SB.PCI0.TOLM, 0xF800, Local1)
68                 ShiftRight (Local1, 0x04, Local1)
69                 Decrement (Local1)
70                 If (LGreater (Local1, 0x10))
71                 {
72                         Subtract (Local1, 0x0F, Local1)
73                         Store (ShiftLeft (Local1, 0x14), MEM2)
74                         Store (0x01000000, MS00)
75                         Store (MS00, MS01)
76                 }
77
78                 Return (MSBF)
79         }
80
81         Method (_STA, 0, NotSerialized)
82         {
83                 Return (0x0F)
84         }
85 }
86