summaryrefslogtreecommitdiff
path: root/Chipset/SB/RRIORDMA.asl
blob: a5358865a09663284a23894df111c0fbbaaf919c (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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//*************************************************************************
// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/RRIORDMA.asl 1     2/08/12 8:24a Yurenlai $
//
// $Revision: 1 $
//
// $Date: 2/08/12 8:24a $
//*************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/RRIORDMA.asl $
// 
// 1     2/08/12 8:24a Yurenlai
// Intel Lynx Point/SB eChipset initially releases.
// 
//*************************************************************************
//<AMI_FHDR_START>
//
// Name:        RRIORDMA.ASL
//
// Description: The ASL file for South Bridge LPC I/O Decoding & DMA
//              assignment.
//
//<AMI_FHDR_END>
//*************************************************************************

    OperationRegion(\_SB.PCI0.LPCB.LPCR, PCI_Config, 0x80, 4)
    Field(\_SB.PCI0.LPCB.LPCR, ByteAcc, NoLock, Preserve) {
        CADR, 3,        // COMA Decode Range
        , 1,
        CBDR, 3,        // COMB Decode Range
        , 1,
        LTDR, 2,        // LPT Decode Range
        , 2,
        FDDR, 1,        // FDD Decode Range
        , 3,
        CALE, 1,        // COM Port A Enable
        CBLE, 1,        // COM Port B Enable
        LTLE, 1,        // Parallel Port Enable
        FDLE, 1,        // Floppy Drive Enable
        , 4,
        GLLE, 1,        // Low Game Port Enable
        GHLE, 1,        // High Game Port Enable
        KCLE, 1,        // Keyboard Enable
        MCLE, 1,        // Microcontroller Enable
        C1LE, 1,        // Super I/O Enable 1
        C2LE, 1,        // Super I/O Enable 2
        , 2,
    }

/*
;<AMI_PHDR_START>
;------------------------------------------------------------------------
;
; Procedure:    UXDV
;
; Description:  Convert UART port address to the decoded value in LPC bridge
;
; Input:        Arg0 = Port to Route/Release 
;
; Output:       UART Port Decoded Value in the LPC bridge
;
;------------------------------------------------------------------------
;<AMI_PHDR_END>
*/

    Method(UXDV, 1) {
        Store(0xff, Local0) // Unknown
        Switch (Add(Arg0, 0)) {
            Case (0x3F8) { Store(0, Local0) }
            Case (0x2F8) { Store(1, Local0) }
            Case (0x220) { Store(2, Local0) }
            Case (0x228) { Store(3, Local0) }
            Case (0x238) { Store(4, Local0) }
            Case (0x2E8) { Store(5, Local0) }
            Case (0x338) { Store(6, Local0) }
            Case (0x3E8) { Store(7, Local0) }
        }
        return (Local0)
    }

/*
;<AMI_PHDR_START>
;------------------------------------------------------------------------
;
; Procedure:    RRIO
;
; Description:  Route/Release I/O resources from/to EIO/LPC Bus 
;
; Input:        Arg0 = Device Category
;               Arg1 = 0/1 Disable/Enable resource decoding
;               Arg2 = Port to Route/Release
;               Arg3 = Port SIZE to Route
;
; Output:       Nothing
;
;------------------------------------------------------------------------
;<AMI_PHDR_END>
*/
    Method(RRIO, 4) {
        Switch (Add(Arg0, 0)) {
            Case (0) {  // UART 0 or 2
                Store(0, CALE) // Disable the decoding
                Store (UXDV(Arg2), Local0)
                If (LNotEqual(Local0, 0xff)) { Store(Local0, CADR)}
                If (Arg1) { Store(1, CALE) }
            }
            Case (1) {  // UART 1 or 3
                Store(0, CBLE) // Disable the decoding
                Store (UXDV(Arg2), Local0)
                If (LNotEqual(Local0, 0xff)) { Store(Local0, CBDR)}
                If (Arg1) { Store(1, CBLE) }
            }
            Case (2) {  // LPT
                Store(0, LTLE) // Disable the decoding
                If (LEqual(Arg2, 0x378)) { Store(0, LTDR) }
                If (LEqual(Arg2, 0x278)) { Store(1, LTDR) }
                If (LEqual(Arg2, 0x3BC)) { Store(2, LTDR) }
                If (Arg1) { Store(1, LTLE) }
            }
            Case (3) {  // FDD
                Store(0, FDLE) // Disable the decoding
                If (LEqual(Arg2, 0x3F0)) { Store(0, FDDR) }
                If (LEqual(Arg2, 0x370)) { Store(1, FDDR) }
                If (Arg1) { Store(1, FDLE) }
            }
            Case (8) {  // Game 1
                If (LEqual(Arg2, 0x200)) {
                    If (Arg1) { Store(1, GLLE) }
                    Else { Store(0, GLLE) }
                }
                If (LEqual(Arg2, 0x208)) {
                    If (Arg1) { Store(1, GHLE) }
                    Else { Store(0, GHLE) }
                }
            }
            Case (9) {  // Game 2
                If (LEqual(Arg2, 0x200)) {
                    If (Arg1) { Store(1, GLLE) }
                    Else { Store(0, GLLE) }
                }
                If (LEqual(Arg2, 0x208)) {
                    If (Arg1) { Store(1, GHLE) }
                    Else { Store(0, GHLE) }
                }
            }
            Case (10) {  // Keyboard Controller
                If (LOr(LEqual(Arg2, 0x60), LEqual(Arg2, 0x64))) {
                    If (Arg1) { Store(1, KCLE) }
                    Else { Store(0, KCLE) }
                }
            }
            Case (11) {  // MicroController
                If (LOr(LEqual(Arg2, 0x62), LEqual(Arg2, 0x66))) {
                    If (Arg1) { Store(1, MCLE) }
                    Else { Store(0, MCLE) }
                }
            }
            Case (12) {  // Super I/O Enable 1
                If (LEqual(Arg2, 0x2E)) {
                    If (Arg1) { Store(1, C1LE) }
                    Else { Store(0, C1LE) }
                }
                If (LEqual(Arg2, 0x4E)) {
                    If (Arg1) { Store(1, C2LE) }
                    Else { Store(0, C2LE) }
                }
            }
            Case (13) {  // Super I/O Enable 2
                If (LEqual(Arg2, 0x2E)) {
                    If (Arg1) { Store(1, C1LE) }
                    Else { Store(0, C1LE) }
                }
                If (LEqual(Arg2, 0x4E)) {
                    If (Arg1) { Store(1, C2LE) }
                    Else { Store(0, C2LE) }
                }
            }

        }
        
    }

/*
;<AMI_PHDR_START>
;------------------------------------------------------------------------
;
; Procedure:    rDMA
;
; Description:  Route/Release DMA channel from/to being ISA/PCI mode
;
; Input:        Arg0 = Device Category
;               Arg1 = 0/1 Disable/Enable resource decoding
;               Arg2 = DMA channel to Route/Release
;
; Output:       Nothing
;
;------------------------------------------------------------------------
;<AMI_PHDR_END>
*/
    Method(rDMA, 3) {
    // Porting If needed.
    }

//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************