summaryrefslogtreecommitdiff
path: root/gpio/samples/simdevice/umdf/GpioSampleUMDF.asl
blob: 0ceb96208ec6b9952fb504482e81502c7ac4ff9a (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

/*++

Copyright (c) Microsoft Corporation.  All rights reserved.

    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
    KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
    PURPOSE.

Module Name:

    GpioSample.asl

Abstract:

    This sample ASL file describes a sample GPIO device and a sample peripheral
    device (managed by the sample KMDF device driver) which consumes IO and interrupt
    resources from the GPIO device. Please note that:

    1. The memory and IO descriptor under the GPIO device are simply examples of
       what can be described. They are commented out to illustrate this point. Actual
       values will vary according to the platform specifications (e.g. GIC and memory)

    2. The sample ASL DSDT definition block defines only the components relevant
       to demonstrate GPIO IO and interrupt resource usage. Rest of the DSDT will vary
       according to platform specifications.

    3. The PNP IDs for the GPIO and peripheral device are for demonstration purposes
       only. Actual values need to reflect those chosen for the actual GPIO or
       peripheral device.

    This ASL file is identical to the KMDF one except for the PNP ID used for the 
    sample peripheral device and GPIO IO/interrupt pins used in its _CRS.

--*/


DefinitionBlock ("DSDT.AML", "DSDT", 0x02, "MSFT", "SAMPLE", 0x1) {

  //
  //  System Bus
  //

  Scope (\_SB) {

    //
    // Sample GPIO device
    //

    Device(GPIO) {
       Name (_ADR, 0)
       Name (_HID, "TEST0001")
       Name (_CID, "TEST0001")
       Name(_UID, 4)

       Method (_CRS, 0x0, NotSerialized) {
         Name (RBUF, ResourceTemplate () {

           //
           // Interrupt resource. In this example, banks 0 & 1 share the same
           // interrupt to the parent controller and similarly banks 2 & 3.
           //
           // N.B. The definition below is chosen for an arbitrary
           //      test platform. It needs to be changed to reflect the hardware
           //      configuration of the actual platform.
           //

           Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, , , ) {50}
           Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, , , ) {50}
           Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, , , ) {51}
           Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, , , ) {51}

           //
           // Memory resource. The definition below is chosen for an arbitrary
           // test platform. It needs to be changed to reflect the hardware
           // configuration of the actual platform.
           //

           Memory32Fixed(ReadWrite, 0x00100000, 0x18)
        })

        Return (RBUF)
       }

       Method (_STA, 0x0, NotSerialized) {
         Return(0xf)
       }

       //
       // Sample peripheral device
       //

       Device (TDEV) {
         Name (_ADR, 0)
         Name (_HID, "TEST0004")
         Name (_CID, "TEST0004")
         Name (_UID, 1)

         Method (_CRS, 0x0, NotSerialized) {
           Name (RBUF, ResourceTemplate () {

             //
             // GPIO Interrupt Resources
             //

             GpioInt(Edge, ActiveHigh, Exclusive, PullUp, 0, "\\_SB.GPIO", 0, ResourceConsumer,, RawDataBuffer() {1}) {2}

             //
             // GPIO IO Resources
             //

             GpioIo(Exclusive, PullUp, 0, 0,, "\\_SB.GPIO",0, ResourceConsumer, , RawDataBuffer() {1}) {12}
             GpioIo(Exclusive, PullUp, 0, 0,, "\\_SB.GPIO",0, ResourceConsumer, , RawDataBuffer() {1}) {13}
           })

           Return (RBUF)
         }

         Method (_STA, 0x0, NotSerialized) {
             Return(0xf)
         }
       }
     }
   }
 }