a3ef49b00cb39244683b1d2dfd316b624b0ca300
[coreboot.git] / src / mainboard / amd / serengeti_cheetah_fam10 / dx / amd8131_2.asl
1 //
2 // This file is part of the LinuxBIOS 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         Device (PG0A)
20         {
21                 // 8132 pcix bridge
22                 Method (_ADR, 0, NotSerialized)
23                 {
24                         Return (DADD(GHCD(HCIN, 0), 0x00000000))
25                 }
26
27                 Method (_PRW, 0, NotSerialized)
28                 {
29                         If (CondRefOf (\_S3, Local0)) { Return (Package (0x02) { 0x29, 0x03 }) }
30                         Else { Return (Package (0x02) { 0x29, 0x01 }) }
31                 }
32
33                 Name (APIC, Package (0x04)
34                 {
35                         // Slot A - PIRQ BCDA
36                         Package (0x04) { 0x0001FFFF, 0x00, 0x00, 0x0018 }, //Slot 2
37                         Package (0x04) { 0x0001FFFF, 0x01, 0x00, 0x0019 },
38                         Package (0x04) { 0x0001FFFF, 0x02, 0x00, 0x001A },
39                         Package (0x04) { 0x0001FFFF, 0x03, 0x00, 0x001B },
40                 })
41                 Name (PICM, Package (0x04)
42                 {
43                         Package (0x04) { 0x0001FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 },//Slot 2
44                         Package (0x04) { 0x0001FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 },
45                         Package (0x04) { 0x0001FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 },
46                         Package (0x04) { 0x0001FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 },
47                 })
48
49                 Name (DNCG, Ones)
50
51                 Method (_PRT, 0, NotSerialized)
52                 {
53                         If (LEqual (^DNCG, Ones))
54                         {
55                                 Multiply (HCIN, 0x0008, Local2) // GSI for 8132 is 4 so we get 8
56                                 Store (0x00, Local1)
57                                 While (LLess (Local1, 0x04))
58                                 {
59                                         // Update the GSI according to HCIN
60                                         Store(DeRefOf(Index (DeRefOf (Index (APIC, Local1)), 3)), Local0)
61                                         Add(Local2, Local0, Local0)
62                                         Store(Local0, Index (DeRefOf (Index (APIC, Local1)), 3))
63                                         Increment (Local1)
64                                 }
65                                 Store (0x00, ^DNCG)
66                         }
67                         If (LNot (PICF)) { Return (PICM) }
68                         Else { Return (APIC) }
69                 }
70         }
71
72         Device (PG0B)
73         {
74                 // 8132 pcix bridge 2
75                 Method (_ADR, 0, NotSerialized)
76                 {
77                         Return (DADD(GHCD(HCIN, 0), 0x00010000))
78                 }
79
80                 Method (_PRW, 0, NotSerialized)
81                 {
82                         If (CondRefOf (\_S3, Local0)) { Return (Package (0x02) { 0x22, 0x03 }) }
83                         Else { Return (Package (0x02) { 0x22, 0x01 }) }
84                 }
85
86                 Name (APIC, Package (0x04)
87                 {
88                         // Slot A - PIRQ ABCD
89                         Package (0x04) { 0x0001FFFF, 0x00, 0x00, 0x001F },// Slot 1
90                         Package (0x04) { 0x0001FFFF, 0x01, 0x00, 0x0020 },
91                         Package (0x04) { 0x0001FFFF, 0x02, 0x00, 0x0021 },
92                         Package (0x04) { 0x0001FFFF, 0x03, 0x00, 0x0022 }
93                 })
94                 Name (PICM, Package (0x04)
95                 {
96                         Package (0x04) { 0x0001FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 },//Slot 1
97                         Package (0x04) { 0x0001FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 },
98                         Package (0x04) { 0x0001FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 },
99                         Package (0x04) { 0x0001FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 }
100                 })
101
102                 Name (DNCG, Ones)
103
104                 Method (_PRT, 0, NotSerialized)
105                 {
106                         If (LEqual (^DNCG, Ones))
107                         {
108                                 Multiply (HCIN, 0x0008, Local2) // GSI for 8132 is 4 so we get 8
109                                 Store (0x00, Local1)
110                                 While (LLess (Local1, 0x04))
111                                 {
112                                         // Update the GSI according to HCIN
113                                         Store(DeRefOf(Index (DeRefOf (Index (APIC, Local1)), 3)), Local0)
114                                         Add(Local2, Local0, Local0)
115                                         Store(Local0, Index (DeRefOf (Index (APIC, Local1)), 3))
116                                         Increment (Local1)
117                                 }
118
119                                 Store (0x00, ^DNCG)
120
121                         }
122
123                         If (LNot (PICF)) { Return (PICM) }
124                         Else { Return (APIC) }
125                 }
126         }