2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 #include <soc/gpio_defs.h>
16 #include <soc/pcr_ids.h>
17 #include <intelblocks/gpio.h>
18 #include "gpio_op.asl"
22 Name (_HID, CROS_GPIO_NAME)
24 Name (_DDN, "GPIO Controller Community 0")
26 Name (RBUF, ResourceTemplate()
28 Memory32Fixed (ReadWrite, 0, GPIO_BASE_SIZE, COM0)
29 Interrupt (ResourceConsumer, Level, ActiveLow, Shared,,, GIRQ)
32 Method (_CRS, 0, NotSerialized)
34 CreateDWordField (^RBUF, ^COM0._BAS, BAS0)
35 BAS0 = ^^PCRB (PID_GPIOCOM0)
46 Name (_HID, CROS_GPIO_NAME)
48 Name (_DDN, "GPIO Controller Community 1")
50 Name (RBUF, ResourceTemplate()
52 Memory32Fixed (ReadWrite, 0, GPIO_BASE_SIZE, COM1)
53 Interrupt (ResourceConsumer, Level, ActiveLow, Shared,,, GIRQ)
56 Method (_CRS, 0, NotSerialized)
58 CreateDWordField (^RBUF, ^COM1._BAS, BAS1)
59 BAS1 = ^^PCRB (PID_GPIOCOM1)
70 Name (_HID, CROS_GPIO_NAME)
72 Name (_DDN, "GPIO Controller Community 4")
74 Name (RBUF, ResourceTemplate()
76 Memory32Fixed (ReadWrite, 0, GPIO_BASE_SIZE, COM4)
77 Interrupt (ResourceConsumer, Level, ActiveLow, Shared,,, GIRQ)
80 Method (_CRS, 0, NotSerialized)
82 CreateDWordField (^RBUF, ^COM4._BAS, BAS4)
83 BAS4 = ^^PCRB (PID_GPIOCOM4)
94 Name (_HID, CROS_GPIO_NAME)
96 Name (_DDN, "GPIO Controller Community 5")
98 Name (RBUF, ResourceTemplate()
100 Memory32Fixed (ReadWrite, 0, GPIO_BASE_SIZE, COM5)
101 Interrupt (ResourceConsumer, Level, ActiveLow, Shared,,, GIRQ)
104 Method (_CRS, 0, NotSerialized)
106 CreateDWordField (^RBUF, ^COM5._BAS, BAS5)
107 BAS5 = ^^PCRB (PID_GPIOCOM5)
117 * Get GPIO DW0 Address
120 Method (GADD, 1, NotSerialized)
122 /* GPIO Community 0 */
123 If (Arg0 >= GPIO_COM0_START && Arg0 <= GPIO_COM0_END)
125 Local0 = PID_GPIOCOM0
126 Local1 = Arg0 - GPIO_COM0_START
128 /* GPIO Community 1 */
129 If (Arg0 >= GPIO_COM1_START && Arg0 <= GPIO_COM1_END)
131 Local0 = PID_GPIOCOM1
132 Local1 = Arg0 - GPIO_COM1_START
134 /* GPIO Community 2 */
135 If (Arg0 >= GPIO_COM2_START && Arg0 <= GPIO_COM2_END)
137 Local0 = PID_GPIOCOM2
138 Local1 = Arg0 - GPIO_COM2_START
140 /* GPIO Community 4 */
141 If (Arg0 >= GPIO_COM4_START && Arg0 <= GPIO_COM4_END)
143 Local0 = PID_GPIOCOM4
144 Local1 = Arg0 - GPIO_COM4_START
146 /* GPIO Community 05*/
147 If (Arg0 >= GPIO_COM5_START && Arg0 <= GPIO_COM5_END)
149 Local0 = PID_GPIOCOM5
150 Local1 = Arg0 - GPIO_COM5_START
153 Local2 = PCRB(Local0) + PAD_CFG_BASE + (Local1 * 16)