summaryrefslogtreecommitdiffstats
path: root/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchXhci.asl
blob: 696a5411d511c6114911d65eec261960ce3638f5 (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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
/**************************************************************************;
;*                                                                        *;
;*                                                                        *;
;*    Intel Corporation - ACPI Reference Code for the Haswell             *;
;*    Family of Customer Reference Boards.                                *;
;*                                                                        *;
;*                                                                        *;
;*    Copyright (c)  2010  - 2014, Intel Corporation. All rights reserved   *;
;
; This program and the accompanying materials are licensed and made available under
; the terms and conditions of the BSD License that accompanies this distribution.
; The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
;*                                                                        *;
;*                                                                        *;
;**************************************************************************/

//scope is \_SB.PCI0.XHC
Device(XHC1)
{
  Name(_ADR, 0x00140000)                     //Device 20, Function 0

  //When it is in Host mode, USH core is connected to USB3 microAB(USB3 P1 and USB2 P0)
  Name (_DDN, "Baytrail XHCI controller (CCG core/Host only)" )

  Method(XDEP, 0)
  {
    If(LEqual(OSYS,2013))
    {
      Name(_DEP, Package(0x1)
      {
        PEPD
      })
    }
  }

  Name (_STR, Unicode ("Baytrail XHCI controller (CCG core/Host only)"))
  Name(_PRW, Package() {0xD,4})

  Method(_PSW,1)
  {
    If (LAnd (PMES, PMEE)) {
       Store (0, PMEE)
       Store (1, PMES)
    }
  }

  OperationRegion (PMEB, PCI_Config, 0x74, 0x04)  // Power Management Control/Status
  Field (PMEB, WordAcc, NoLock, Preserve)
  {
    ,   8,
    PMEE,   1,   //bit8 PME_En
    ,   6,
    PMES,   1    //bit15 PME_Status
  }

  Method(_STA, 0)
  {
    If(LNotEqual(XHCI, 0))      //NVS variable controls present of XHCI controller
    {
      Return (0xF)
    } Else
    {
      Return (0x0)
    }
  }

  OperationRegion(XPRT,PCI_Config,0xD0,0x10)
  Field(XPRT,DWordAcc,NoLock,Preserve)       //usbx_top.doc.xml
  {
    PR2,  32,                              //bit[8:0] USB2HCSEL
    PR2M, 32,                              //bit[8:0] USB2HCSELM
    PR3,  32,                              //bit[3:0] USB3SSEN
    PR3M, 32                               //bit[3:0] USB3SSENM
  }

  Device(RHUB)
  {
    Name(_ADR, Zero)         //address 0 is reserved for root hub

    //
    // Super Speed Ports - must match _UPC declarations of the coresponding Full Speed Ports.
    //   Paired with Port 1
    Device(SSP1)
    {
      Name(_ADR, 0x07)

      Method(_UPC,0,Serialized)
      {
        Name(UPCP, Package()
        {
          0xFF,                                      // Port is connectable if non-zero
          0x06,                                      // USB3 uAB connector
          0x00,
          0x00
        })
        Return(UPCP)
      }

      Method(_PLD,0,Serialized)
      {
        Name(PLDP, Package()       //pls check ACPI 5.0 section 6.1.8
        {
          Buffer(0x14)
          {
            //31:0   - Bit[6:0]=2 revision is 0x2, Bit[7]=1 Ignore Color Bit[31:8]=0 RGB color is ignored
            0x82, 0x00, 0x00, 0x00,
            //63:32 - Bit[47:32]=0 width: 0x0000  Bit[63:48]=0 Height:0x0000
            0x00, 0x00, 0x00, 0x00,
            //95:64 - bit[66:64]=b'011 visiable/docking/no lid bit[69:67]=b'001 bottom panel bit[71:70]=b'01 Center  bit[73:72]=b'01 Center
            //           bit[77:74]=6 Horizontal Trapezoid bit[78]=0 bit[86:79]=0 bit[94:87]='0 no group info' bit[95]=0 not a bay
            0x4B, 0x19, 0x00, 0x00,
            //127:96 -bit[96]=1 Ejectable bit[97]=1 OSPM Ejection required Bit[105:98]=0 no Cabinet Number
            //            bit[113:106]=0 no Card cage Number bit[114]=0 no reference shape Bit[118:115]=0 no rotation Bit[123:119]=0 no order
            0x03, 0x00, 0x00, 0x00,
            //159:128  Vert. and Horiz. Offsets not supplied
            0xFF, 0xFF, 0xFF, 0xFF
          }
        })
        Return (PLDP)
      }
    }
    //
    // High Speed Ports
    // pair port with port 7 (SS)
    //    The UPC declarations for LS/FS/HS and SS ports that are paired to form a USB3.0 compatible connector.
    //    A "pair" is defined by two ports that declare _PLDs with identical Panel, Vertical Position, Horizontal Postion, Shape, Group Orientation
    //    and Group Token
    Device(HS01)
    {
      Name(_ADR, 0x01)

      Method(_UPC,0,Serialized)
      {
        Name(UPCP, Package() { 0xFF,0x06,0x00,0x00 })
        Return(UPCP)
      }

      Method(_PLD,0,Serialized)
      {
        Name(PLDP, Package()       //pls check ACPI 5.0 section 6.1.8
        {
          Buffer(0x14)
          {
            //31:0   - Bit[6:0]=2 revision is 0x2, Bit[7]=1 Ignore Color Bit[31:8]=0 RGB color is ignored
            0x82, 0x00, 0x00, 0x00,
            //63:32 - Bit[47:32]=0 width: 0x0000  Bit[63:48]=0 Height:0x0000
            0x00, 0x00, 0x00, 0x00,
            //95:64 - bit[66:64]=b'011 visiable/docking/no lid bit[69:67]=b'001 bottom panel bit[71:70]=b'01 Center  bit[73:72]=b'01 Center
            //           bit[77:74]=6 Horizontal Trapezoid bit[78]=0 bit[86:79]=0 bit[94:87]='0 no group info' bit[95]=0 not a bay
            0x4B, 0x19, 0x00, 0x00,
            //127:96 -bit[96]=1 Ejectable bit[97]=1 OSPM Ejection required Bit[105:98]=0 no Cabinet Number
            //            bit[113:106]=0 no Card cage Number bit[114]=0 no reference shape Bit[118:115]=0 no rotation Bit[123:119]=0 no order
            0x03, 0x00, 0x00, 0x00,
            //159:128  Vert. and Horiz. Offsets not supplied
            0xFF, 0xFF, 0xFF, 0xFF
          }
        })
        Return (PLDP)
      }
    }//end of HS01

    // USB2 Type-A/USB2 only
    // EHCI debug capable
    Device(HS02)
    {
      Name(_ADR, 0x02)                                   // 0 is for root hub so physical port index starts from 1 (it is port1 in schematic)

      Method(_UPC,0,Serialized)
      {
        Name(UPCP, Package()
        {
          0xFF,                     // connectable
          0xFF,                     //
          0x00,
          0x00
        })

        Return(UPCP)
      }

      Method(_PLD,0,Serialized)
      {
        Name(PLDP, Package()
        {
          Buffer(0x14)
          {
            //31:0   - Bit[6:0]=2 revision is 0x2, Bit[7]=1 Ignore Color Bit[31:8]=0 RGB color is ignored
            0x82, 0x00, 0x00, 0x00,
            //63:32 - Bit[47:32]=0 width: 0x0000  Bit[63:48]=0 Height:0x0000
            0x00, 0x00, 0x00, 0x00,
            //95:64 - bit[66:64]=b'000 not visiable/no docking/no lid bit[69:67]=b'000 top bit[71:70]=b'01 Center  bit[73:72]=b'00 Left
            //           bit[77:74]=2 Square bit[78]=0 bit[86:79]=0 bit[94:87]='0 no group info' bit[95]=0 not a bay
            0x40, 0x08, 0x00, 0x00,
            //127:96 -bit[96]=0 not Ejectable bit[97]=0 no OSPM Ejection required Bit[105:98]=0 no Cabinet Number
            //            bit[113:106]=0 no Card cage Number bit[114]=0 no reference shape Bit[118:115]=0 no rotation Bit[123:119]=0 no order
            0x00, 0x00, 0x00, 0x00,
            //159:128  Vert. and Horiz. Offsets not supplied
            0xFF, 0xFF, 0xFF, 0xFF
          }
        })

        Return (PLDP)
      }
    }//end of HS02
    // high speed port 3
    Device(HS03)
    {
      Name(_ADR, 0x03)

      Method(_UPC,0,Serialized)
      {
        Name(UPCP, Package()
        {
          0xFF,                     //  connectable
          0xFF,
          0x00,
          0x00
        })

        Return(UPCP)
      }

      Method(_RMV, 0)                                    // for XHCICV debug purpose
      {
        Return(0x0)
      }

      Method(_PLD,0,Serialized)
      {
        Name(PLDP, Package()
        {
          Buffer(0x14)
          {
            //31:0   - Bit[6:0]=2 revision is 0x2, Bit[7]=1 Ignore Color Bit[31:8]=0 RGB color is ignored
            0x82, 0x00, 0x00, 0x00,
            //63:32 - Bit[47:32]=0 width: 0x0000  Bit[63:48]=0 Height:0x0000
            0x00, 0x00, 0x00, 0x00,
            //95:64 - bit[66:64]=b'000 not Visible/no docking/no lid bit[69:67]=6 (b'110) unknown(Vertical Position and  Horizontal Position will be ignored)
            //           bit[71:70]=b'00 Vertical Position ignore bit[73:72]=b'00 Horizontal Position ignore
            //           bit[77:74]=2 Square bit[78]=0 bit[86:79]=0 bit[94:87]='0 no group info' bit[95]=0 not a bay
            0x30, 0x08, 0x00, 0x00,
            //127:96 -bit[96]=0 not Ejectable bit[97]=0 OSPM Ejection not required Bit[105:98]=0 no Cabinet Number
            //            bit[113:106]=0 no Card cage Number bit[114]=0 no reference shape Bit[118:115]=0 no rotation Bit[123:119]=0 no order
            0x00, 0x00, 0x00, 0x00,
            //159:128  Vert. and Horiz. Offsets not supplied
            0xFF, 0xFF, 0xFF, 0xFF
          }
        })
        Return (PLDP)
      }
    }

    Device(HS04)
    {
      Name(_ADR, 0x04)

      Method(_UPC,0,Serialized)
      {
        Name(UPCP, Package()
        {
          0xFF,                     //connectable
          0xFF,                     //Proprietary connector (FPC connector)
          0x00,
          0x00
        })

        Return(UPCP)
      }
      Method(_PLD,0,Serialized)
      {
        Name(PLDP, Package()
        {
          Buffer(0x14)
          {
            //31:0   - Bit[6:0]=2 revision is 0x2, Bit[7]=1 Ignore Color Bit[31:8]=0 RGB color is ignored
            0x82, 0x00, 0x00, 0x00,
            //63:32 - Bit[47:32]=0 width: 0x0000  Bit[63:48]=0 Height:0x0000
            0x00, 0x00, 0x00, 0x00,
            //95:64 - bit[66:64]=b'000 not Visible/no docking/no lid bit[69:67]=6 (b'110) unknown(Vertical Position and  Horizontal Position will be ignored)
            //           bit[71:70]=b'00 Vertical Position ignore bit[73:72]=b'00 Horizontal Position ignore
            //           bit[77:74]=2 Square bit[78]=0 bit[86:79]=0 bit[94:87]='0 no group info' bit[95]=0 not a bay
            0x30, 0x08, 0x00, 0x00,
            //127:96 -bit[96]=0 not Ejectable bit[97]=0 OSPM Ejection not required Bit[105:98]=0 no Cabinet Number
            //            bit[113:106]=0 no Card cage Number bit[114]=0 no reference shape Bit[118:115]=0 no rotation Bit[123:119]=0 no order
            0x00, 0x00, 0x00, 0x00,
            //159:128  Vert. and Horiz. Offsets not supplied
            0xFF, 0xFF, 0xFF, 0xFF
          }
        })

        Return (PLDP)
      }
    }


    Device(HSC1)                                           // USB2 HSIC 01
    {
      Name(_ADR, 0x05)

      Method(_UPC,0,Serialized)
      {
        Name(UPCP, Package()
        {
          0xFF,                     //connectable
          0xFF,                     //Proprietary connector (FPC connector)
          0x00,
          0x00
        })

        Return(UPCP)
      }
      Method(_PLD,0,Serialized)
      {
        Name(PLDP, Package()
        {
          Buffer(0x14)
          {
            //31:0   - Bit[6:0]=2 revision is 0x2, Bit[7]=1 Ignore Color Bit[31:8]=0 RGB color is ignored
            0x82, 0x00, 0x00, 0x00,
            //63:32 - Bit[47:32]=0 width: 0x0000  Bit[63:48]=0 Height:0x0000
            0x00, 0x00, 0x00, 0x00,
            //95:64 - bit[66:64]=b'000 not Visible/no docking/no lid bit[69:67]=6 (b'110) unknown(Vertical Position and  Horizontal Position will be ignored)
            //           bit[71:70]=b'00 Vertical Position ignore bit[73:72]=b'00 Horizontal Position ignore
            //           bit[77:74]=2 Square bit[78]=0 bit[86:79]=0 bit[94:87]='0 no group info' bit[95]=0 not a bay
            0x30, 0x08, 0x00, 0x00,
            //127:96 -bit[96]=0 not Ejectable bit[97]=0 OSPM Ejection not required Bit[105:98]=0 no Cabinet Number
            //            bit[113:106]=0 no Card cage Number bit[114]=0 no reference shape Bit[118:115]=0 no rotation Bit[123:119]=0 no order
            0x00, 0x00, 0x00, 0x00,
            //159:128  Vert. and Horiz. Offsets not supplied
            0xFF, 0xFF, 0xFF, 0xFF
          }
        })
        Return (PLDP)
      }
    }

    Device(HSC2)                                           // USB2 HSIC 02
    {
      Name(_ADR, 0x06)

      Method(_UPC,0,Serialized)
      {
        Name(UPCP, Package()
        {
          0xFF,                     //connectable
          0xFF,                     //Proprietary connector (FPC connector)
          0x00,
          0x00
        })

        Return(UPCP)
      }
      Method(_PLD,0,Serialized)
      {
        Name(PLDP, Package()
        {
          Buffer(0x14)
          {
            //31:0   - Bit[6:0]=2 revision is 0x2, Bit[7]=1 Ignore Color Bit[31:8]=0 RGB color is ignored
            0x82, 0x00, 0x00, 0x00,
            //63:32 - Bit[47:32]=0 width: 0x0000  Bit[63:48]=0 Height:0x0000
            0x00, 0x00, 0x00, 0x00,
            //95:64 - bit[66:64]=b'000 not Visible/no docking/no lid bit[69:67]=6 (b'110) unknown(Vertical Position and  Horizontal Position will be ignored)
            //           bit[71:70]=b'00 Vertical Position ignore bit[73:72]=b'00 Horizontal Position ignore
            //           bit[77:74]=2 Square bit[78]=0 bit[86:79]=0 bit[94:87]='0 no group info' bit[95]=0 not a bay
            0x30, 0x08, 0x00, 0x00,
            //127:96 -bit[96]=0 not Ejectable bit[97]=0 OSPM Ejection not required Bit[105:98]=0 no Cabinet Number
            //            bit[113:106]=0 no Card cage Number bit[114]=0 no reference shape Bit[118:115]=0 no rotation Bit[123:119]=0 no order
            0x00, 0x00, 0x00, 0x00,
            //159:128  Vert. and Horiz. Offsets not supplied
            0xFF, 0xFF, 0xFF, 0xFF
          }
        })
        Return (PLDP)
      }
    }
  }  //end of root hub

} // end of XHC1