summaryrefslogtreecommitdiff
path: root/src/mainboard/amd/serengeti_cheetah/acpi/amd8111.asl
blob: 7509a340d4add042d8a33a339119ccddf0ec96b3 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*
 * Copyright 2005 AMD
 */
//AMD8111
            Name (APIC, Package (0x04)
            {
                Package (0x04) { 0x0004FFFF, 0x00, 0x00, 0x10},// 0x0004ffff : assusme 8131 is present
                Package (0x04) { 0x0004FFFF, 0x01, 0x00, 0x11},
                Package (0x04) { 0x0004FFFF, 0x02, 0x00, 0x12},
                Package (0x04) { 0x0004FFFF, 0x03, 0x00, 0x13}
            })

            Name (PICM, Package (0x04)
            {
                Package (0x04) { 0x0004FFFF, 0x00, \_SB.PCI0.LNKA, 0x00},
                Package (0x04) { 0x0004FFFF, 0x01, \_SB.PCI0.LNKB, 0x00},
                Package (0x04) { 0x0004FFFF, 0x02, \_SB.PCI0.LNKC, 0x00},
                Package (0x04) { 0x0004FFFF, 0x03, \_SB.PCI0.LNKD, 0x00}
            })

	    Name (DNCG, Ones)

            Method (_PRT, 0, NotSerialized)
            {
		If (LEqual (^DNCG, Ones)) {
			Store (DADD(\_SB.PCI0.SBDN, 0x0001ffff), Local0)
			// Update the Device Number according to SBDN
                        Store(Local0, Index (DeRefOf (Index (PICM, 0)), 0))
                        Store(Local0, Index (DeRefOf (Index (PICM, 1)), 0))
                        Store(Local0, Index (DeRefOf (Index (PICM, 2)), 0))
                        Store(Local0, Index (DeRefOf (Index (PICM, 3)), 0))

                        Store(Local0, Index (DeRefOf (Index (APIC, 0)), 0))
                        Store(Local0, Index (DeRefOf (Index (APIC, 1)), 0))
                        Store(Local0, Index (DeRefOf (Index (APIC, 2)), 0))
                        Store(Local0, Index (DeRefOf (Index (APIC, 3)), 0))

			Store (0x00, ^DNCG)

		}

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

            Device (SBC3)
            {
                /*  acpi smbus   it should be 0x00040003 if 8131 present */
		Method (_ADR, 0, NotSerialized)
		{
			Return (DADD(\_SB.PCI0.SBDN, 0x00010003))
		}
                OperationRegion (PIRQ, PCI_Config, 0x56, 0x02)
                Field (PIRQ, ByteAcc, Lock, Preserve)
                {
                    PIBA,   8,
                    PIDC,   8
                }
/*
                OperationRegion (TS3_, PCI_Config, 0xC4, 0x02)
                Field (TS3_, DWordAcc, NoLock, Preserve)
                {
                    PTS3,   16
                }
*/
            }

            Device (HPET)
            {
                Name (HPT, 0x00)
                Name (_HID, EisaId ("PNP0103"))
                Name (_UID, 0x00)
                Method (_STA, 0, NotSerialized)
                {
                    Return (0x0F)
                }

                Method (_CRS, 0, NotSerialized)
                {
                    Name (BUF0, ResourceTemplate ()
                    {
                        Memory32Fixed (ReadWrite, 0xFED00000, 0x00000400)
                    })
                    Return (BUF0)
                }
            }

	    #include "amd8111_pic.asl"

	    #include "amd8111_isa.asl"

            Device (TP2P)
            {
                /* 8111 P2P and it should 0x00030000 when 8131 present*/
                Method (_ADR, 0, NotSerialized)
                {
			Return (DADD(\_SB.PCI0.SBDN, 0x00000000))
                }

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

                Device (USB0)
                {
                    Name (_ADR, 0x00000000)
                    Method (_PRW, 0, NotSerialized)
                    {
                        If (CondRefOf (\_S3, Local0)) { Return (Package (0x02) { 0x0F, 0x03 }) }
                        Else { Return (Package (0x02) { 0x0F, 0x01 }) }
                    }
                }

                Device (USB1)
                {
                    Name (_ADR, 0x00000001)
                    Method (_PRW, 0, NotSerialized)
                    {
                        If (CondRefOf (\_S3, Local0)) { Return (Package (0x02) { 0x0F, 0x03 }) }
                        Else { Return (Package (0x02) { 0x0F, 0x01 }) }
                    }
                }

                Name (APIC, Package (0x0C)
                {
                    Package (0x04) { 0x0000FFFF, 0x00, 0x00, 0x10 }, //USB
                    Package (0x04) { 0x0000FFFF, 0x01, 0x00, 0x11 },
                    Package (0x04) { 0x0000FFFF, 0x02, 0x00, 0x12 },
                    Package (0x04) { 0x0000FFFF, 0x03, 0x00, 0x13 },

                    Package (0x04) { 0x0004FFFF, 0x00, 0x00, 0x10 }, //Slot 4
                    Package (0x04) { 0x0004FFFF, 0x01, 0x00, 0x11 },
                    Package (0x04) { 0x0004FFFF, 0x02, 0x00, 0x12 },
                    Package (0x04) { 0x0004FFFF, 0x03, 0x00, 0x13 },

                    Package (0x04) { 0x0005FFFF, 0x00, 0x00, 0x11 }, //Slot 3
                    Package (0x04) { 0x0005FFFF, 0x01, 0x00, 0x12 },
                    Package (0x04) { 0x0005FFFF, 0x02, 0x00, 0x13 },
                    Package (0x04) { 0x0005FFFF, 0x03, 0x00, 0x10 }
                })

                Name (PICM, Package (0x0C)
                {
                    Package (0x04) { 0x0000FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 }, //USB
                    Package (0x04) { 0x0000FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 },
                    Package (0x04) { 0x0000FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 },
                    Package (0x04) { 0x0000FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 },

                    Package (0x04) { 0x0004FFFF, 0x00, \_SB.PCI0.LNKA, 0x00 }, //Slot 4
                    Package (0x04) { 0x0004FFFF, 0x01, \_SB.PCI0.LNKB, 0x00 },
                    Package (0x04) { 0x0004FFFF, 0x02, \_SB.PCI0.LNKC, 0x00 },
                    Package (0x04) { 0x0004FFFF, 0x03, \_SB.PCI0.LNKD, 0x00 },

                    Package (0x04) { 0x0005FFFF, 0x00, \_SB.PCI0.LNKB, 0x00 }, //Slot 3
                    Package (0x04) { 0x0005FFFF, 0x01, \_SB.PCI0.LNKC, 0x00 },
                    Package (0x04) { 0x0005FFFF, 0x02, \_SB.PCI0.LNKD, 0x00 },
                    Package (0x04) { 0x0005FFFF, 0x03, \_SB.PCI0.LNKA, 0x00 }
                })

                Method (_PRT, 0, NotSerialized)
                {
                    If (LNot (PICF)) { Return (PICM) }
                    Else { Return (APIC) }
                }
            }