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.
17 /* Get Pad Configuration DW0 register value */
18 Method (GPC0, 0x1, Serialized)
20 /* Arg0 - GPIO DW0 address */
22 OperationRegion (PDW0, SystemMemory, Local0, 4)
23 Field (PDW0, AnyAcc, NoLock, Preserve) {
29 /* Set Pad Configuration DW0 register value */
30 Method (SPC0, 0x2, Serialized)
32 /* Arg0 - GPIO DW0 address */
33 /* Arg1 - Value for DW0 register */
35 OperationRegion (PDW0, SystemMemory, Local0, 4)
36 Field (PDW0, AnyAcc, NoLock, Preserve) {
42 /* Get Pad Configuration DW1 register value */
43 Method (GPC1, 0x1, Serialized)
45 /* Arg0 - GPIO DW0 address */
46 Store (Add (Arg0, 0x4), Local0)
47 OperationRegion (PDW1, SystemMemory, Local0, 4)
48 Field (PDW1, AnyAcc, NoLock, Preserve) {
54 /* Set Pad Configuration DW1 register value */
55 Method (SPC1, 0x2, Serialized)
57 /* Arg0 - GPIO DW0 address */
58 /* Arg1 - Value for DW1 register */
59 Store (Add (Arg0, 0x4), Local0)
60 OperationRegion (PDW1, SystemMemory, Local0, 4)
61 Field(PDW1, AnyAcc, NoLock, Preserve) {
67 /* Get DW0 address of a given pad */
68 Method (GDW0, 0x2, Serialized)
70 /* Arg0 - GPIO portid */
71 /* Arg1 - GPIO pad offset relative to the community */
73 Or( Or (ShiftLeft (Arg0, 16), CONFIG_PCR_BASE_ADDRESS),
75 Or( Add (PAD_CFG_BASE, Multiply (Arg1, Multiply (
76 GPIO_NUM_PAD_CFG_REGS, 4))), Local1, Local1)
80 /* Calculate HOSTSW_REG address */
81 Method (CHSA, 0x1, Serialized)
83 /* Arg0 - GPIO pad offset relative to the community */
84 Add (HOSTSW_OWN_REG_0, Multiply (Divide (Arg0, 32), 4), Local1)
88 /* Get Host ownership register of GPIO Community */
89 Method (GHO, 0x2, Serialized)
91 /* Arg0 - GPIO portid */
92 /* Arg1 - GPIO pad offset relative to the community */
93 Store (CHSA (Arg1), Local1)
95 OperationRegion (SHO0, SystemMemory, Or ( Or
96 (CONFIG_PCR_BASE_ADDRESS, ShiftLeft (Arg0, 16)), Local1), 4)
97 Field (SHO0, AnyAcc, NoLock, Preserve) {
103 /* Set Host ownership register of GPIO Community */
104 Method (SHO, 0x3, Serialized)
106 /* Arg0 - GPIO portid */
107 /* Arg1 - GPIO pad offset relative to the community */
108 /* Arg2 - Value for Host own register */
109 Store (CHSA (Arg1), Local1)
111 OperationRegion (SHO0, SystemMemory, Or ( Or
112 (CONFIG_PCR_BASE_ADDRESS, ShiftLeft (Arg0, 16)), Local1), 4)
113 Field (SHO0, AnyAcc, NoLock, Preserve) {