summaryrefslogtreecommitdiffstats
path: root/src/mainboard/amd/serengeti_cheetah_fam10/acpi/amd8131_2.asl
blob: d810726e581cca3430a2b3af883cde1ec77eccfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//
// This file is part of the coreboot project.
//
// Copyright (C) 2007 Advanced Micro Devices, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
//
	Device (PG0A)
	{
		// 8132 pcix bridge
		Method (_ADR, 0, NotSerialized)
		{
			Return (DADD(GHCD(HCIN, 0), 0x00000000))
		}

		Method (_PRW, 0, NotSerialized)
		{
			If (CondRefOf (\_S3, Local0)) { Return (Package (0x02) { 0x29, 0x03 }) }
			Else { Return (Package (0x02) { 0x29, 0x01 }) }
		}

		Name (APIC, Package (0x04)
		{
			// Slot A - PIRQ BCDA
			Package (0x04) { 0x0001FFFF, 0x00, 0x00, 0x0018 }, //Slot 2
			Package (0x04) { 0x0001FFFF, 0x01, 0x00, 0x0019 },
			Package (0x04) { 0x0001FFFF, 0x02, 0x00, 0x001A },
			Package (0x04) { 0x0001FFFF, 0x03, 0x00, 0x001B },
		})
		Name (PICM, Package (0x04)
		{
			Package (0x04) { 0x0001FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 },//Slot 2
			Package (0x04) { 0x0001FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 },
			Package (0x04) { 0x0001FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 },
			Package (0x04) { 0x0001FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 },
		})

		Name (DNCG, Ones)

		Method (_PRT, 0, NotSerialized)
		{
			If (LEqual (^DNCG, Ones))
			{
				Multiply (HCIN, 0x0008, Local2) // GSI for 8132 is 4 so we get 8
				Store (0x00, Local1)
				While (LLess (Local1, 0x04))
				{
					// Update the GSI according to HCIN
					Store(DeRefOf(Index (DeRefOf (Index (APIC, Local1)), 3)), Local0)
					Add(Local2, Local0, Local0)
					Store(Local0, Index (DeRefOf (Index (APIC, Local1)), 3))
					Increment (Local1)
				}
				Store (0x00, ^DNCG)
			}
			If (LNot (PICF)) { Return (PICM) }
			Else { Return (APIC) }
		}
	}

	Device (PG0B)
	{
		// 8132 pcix bridge 2
		Method (_ADR, 0, NotSerialized)
		{
			Return (DADD(GHCD(HCIN, 0), 0x00010000))
		}

		Method (_PRW, 0, NotSerialized)
		{
			If (CondRefOf (\_S3, Local0)) { Return (Package (0x02) { 0x22, 0x03 }) }
			Else { Return (Package (0x02) { 0x22, 0x01 }) }
		}

		Name (APIC, Package (0x04)
		{
			// Slot A - PIRQ ABCD
			Package (0x04) { 0x0001FFFF, 0x00, 0x00, 0x001F },// Slot 1
			Package (0x04) { 0x0001FFFF, 0x01, 0x00, 0x0020 },
			Package (0x04) { 0x0001FFFF, 0x02, 0x00, 0x0021 },
			Package (0x04) { 0x0001FFFF, 0x03, 0x00, 0x0022 }
		})
		Name (PICM, Package (0x04)
		{
			Package (0x04) { 0x0001FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 },//Slot 1
			Package (0x04) { 0x0001FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 },
			Package (0x04) { 0x0001FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 },
			Package (0x04) { 0x0001FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 }
		})

		Name (DNCG, Ones)

		Method (_PRT, 0, NotSerialized)
		{
			If (LEqual (^DNCG, Ones))
			{
				Multiply (HCIN, 0x0008, Local2) // GSI for 8132 is 4 so we get 8
				Store (0x00, Local1)
				While (LLess (Local1, 0x04))
				{
					// Update the GSI according to HCIN
					Store(DeRefOf(Index (DeRefOf (Index (APIC, Local1)), 3)), Local0)
					Add(Local2, Local0, Local0)
					Store(Local0, Index (DeRefOf (Index (APIC, Local1)), 3))
					Increment (Local1)
				}

				Store (0x00, ^DNCG)

			}

			If (LNot (PICF)) { Return (PICM) }
			Else { Return (APIC) }
		}
	}