Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 2 | |
| 3 | /* |
| 4 | * ACPI - create the Fixed ACPI Description Tables (FADT) |
| 5 | */ |
| 6 | |
| 7 | #include <string.h> |
| 8 | #include <console/console.h> |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 9 | #include <acpi/acpi.h> |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 10 | #include <acpi/acpi_gnvs.h> |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 11 | #include <acpi/acpigen.h> |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 12 | #include <device/pci_ops.h> |
Marc Jones | 5ebc865 | 2017-06-19 23:34:04 -0600 | [diff] [blame] | 13 | #include <arch/ioapic.h> |
Marshall Dawson | e9b862e | 2017-09-22 15:14:46 -0600 | [diff] [blame] | 14 | #include <cpu/x86/smm.h> |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 15 | #include <device/device.h> |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 16 | #include <device/pci.h> |
Marshall Dawson | 69486ca | 2019-05-02 12:03:45 -0600 | [diff] [blame] | 17 | #include <amdblocks/acpimmio.h> |
Marshall Dawson | 4ee83b2 | 2019-05-03 11:44:22 -0600 | [diff] [blame] | 18 | #include <amdblocks/acpi.h> |
Felix Held | 604ffa6 | 2021-02-12 00:43:20 +0100 | [diff] [blame^] | 19 | #include <amdblocks/ioapic.h> |
Marc Jones | 257db58 | 2017-06-18 17:33:30 -0600 | [diff] [blame] | 20 | #include <soc/acpi.h> |
Chris Ching | 6a35fab | 2017-10-19 11:45:30 -0600 | [diff] [blame] | 21 | #include <soc/pci_devs.h> |
Marc Jones | dfeb1c4 | 2017-08-07 19:08:24 -0600 | [diff] [blame] | 22 | #include <soc/southbridge.h> |
Patrick Georgi | 4fbefc5 | 2018-10-23 14:35:37 +0200 | [diff] [blame] | 23 | #include <soc/northbridge.h> |
Marc Jones | 257db58 | 2017-06-18 17:33:30 -0600 | [diff] [blame] | 24 | #include <soc/nvs.h> |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 25 | #include <soc/gpio.h> |
Elyes HAOUAS | 26071aa | 2019-02-15 08:21:33 +0100 | [diff] [blame] | 26 | #include <version.h> |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 27 | |
Marc Jones | 5ebc865 | 2017-06-19 23:34:04 -0600 | [diff] [blame] | 28 | unsigned long acpi_fill_madt(unsigned long current) |
| 29 | { |
| 30 | /* create all subtables for processors */ |
| 31 | current = acpi_create_madt_lapics(current); |
| 32 | |
| 33 | /* Write Kern IOAPIC, only one */ |
| 34 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, |
Felix Held | 604ffa6 | 2021-02-12 00:43:20 +0100 | [diff] [blame^] | 35 | FCH_IOAPIC_ID, IO_APIC_ADDR, 0); |
Marc Jones | 5ebc865 | 2017-06-19 23:34:04 -0600 | [diff] [blame] | 36 | |
| 37 | current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, |
Felix Held | 604ffa6 | 2021-02-12 00:43:20 +0100 | [diff] [blame^] | 38 | GNB_IOAPIC_ID, IO_APIC2_ADDR, 24); |
Marc Jones | 5ebc865 | 2017-06-19 23:34:04 -0600 | [diff] [blame] | 39 | |
| 40 | /* 0: mean bus 0--->ISA */ |
| 41 | /* 0: PIC 0 */ |
| 42 | /* 2: APIC 2 */ |
| 43 | /* 5 mean: 0101 --> Edge-triggered, Active high */ |
| 44 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
| 45 | current, 0, 0, 2, 0); |
| 46 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
Marshall Dawson | ecce847 | 2018-10-05 15:41:03 -0600 | [diff] [blame] | 47 | current, 0, 9, 9, 0xf); |
Marc Jones | 5ebc865 | 2017-06-19 23:34:04 -0600 | [diff] [blame] | 48 | |
| 49 | /* create all subtables for processors */ |
| 50 | current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current, |
| 51 | 0xff, 5, 1); |
| 52 | /* 1: LINT1 connect to NMI */ |
| 53 | |
| 54 | return current; |
| 55 | } |
| 56 | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 57 | /* |
| 58 | * Reference section 5.2.9 Fixed ACPI Description Table (FADT) |
| 59 | * in the ACPI 3.0b specification. |
| 60 | */ |
Kyösti Mälkki | 61ef71b | 2020-05-30 18:54:39 +0300 | [diff] [blame] | 61 | void acpi_fill_fadt(acpi_fadt_t *fadt) |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 62 | { |
Felix Held | 2f8228d | 2021-02-05 01:03:45 +0100 | [diff] [blame] | 63 | printk(BIOS_DEBUG, "pm_base: 0x%04x\n", ACPI_IO_BASE); |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 64 | |
Marc Jones | dfeb1c4 | 2017-08-07 19:08:24 -0600 | [diff] [blame] | 65 | fadt->sci_int = 9; /* IRQ 09 - ACPI SCI */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 66 | |
Kyösti Mälkki | 0a9e72e | 2019-08-11 01:22:28 +0300 | [diff] [blame] | 67 | if (permanent_smi_handler()) { |
Marshall Dawson | e9b862e | 2017-09-22 15:14:46 -0600 | [diff] [blame] | 68 | fadt->smi_cmd = APM_CNT; |
| 69 | fadt->acpi_enable = APM_CNT_ACPI_ENABLE; |
| 70 | fadt->acpi_disable = APM_CNT_ACPI_DISABLE; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | fadt->pm1a_evt_blk = ACPI_PM_EVT_BLK; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 74 | fadt->pm1a_cnt_blk = ACPI_PM1_CNT_BLK; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 75 | fadt->pm_tmr_blk = ACPI_PM_TMR_BLK; |
| 76 | fadt->gpe0_blk = ACPI_GPE0_BLK; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 77 | |
| 78 | fadt->pm1_evt_len = 4; /* 32 bits */ |
| 79 | fadt->pm1_cnt_len = 2; /* 16 bits */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 80 | fadt->pm_tmr_len = 4; /* 32 bits */ |
| 81 | fadt->gpe0_blk_len = 8; /* 64 bits */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 82 | |
| 83 | fadt->p_lvl2_lat = ACPI_FADT_C2_NOT_SUPPORTED; |
| 84 | fadt->p_lvl3_lat = ACPI_FADT_C3_NOT_SUPPORTED; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 85 | fadt->duty_offset = 1; /* CLK_VAL bits 3:1 */ |
| 86 | fadt->duty_width = 3; /* CLK_VAL bits 3:1 */ |
| 87 | fadt->day_alrm = 0; /* 0x7d these have to be */ |
| 88 | fadt->mon_alrm = 0; /* 0x7e added to cmos.layout */ |
| 89 | fadt->century = 0; /* 0x7f to make rtc alarm work */ |
| 90 | fadt->iapc_boot_arch = FADT_BOOT_ARCH; /* See table 5-10 */ |
| 91 | fadt->res2 = 0; /* reserved, MUST be 0 ACPI 3.0 */ |
Angel Pons | a208c6c | 2020-07-13 00:02:34 +0200 | [diff] [blame] | 92 | fadt->flags |= ACPI_FADT_WBINVD | /* See table 5-10 ACPI 3.0a spec */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 93 | ACPI_FADT_C1_SUPPORTED | |
| 94 | ACPI_FADT_SLEEP_BUTTON | |
| 95 | ACPI_FADT_S4_RTC_WAKE | |
| 96 | ACPI_FADT_32BIT_TIMER | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 97 | ACPI_FADT_PCI_EXPRESS_WAKE | |
| 98 | ACPI_FADT_PLATFORM_CLOCK | |
| 99 | ACPI_FADT_S4_RTC_VALID | |
| 100 | ACPI_FADT_REMOTE_POWER_ON; |
| 101 | |
Elyes HAOUAS | f5b974e | 2018-11-10 20:29:08 +0100 | [diff] [blame] | 102 | fadt->ARM_boot_arch = 0; /* MUST be 0 ACPI 3.0 */ |
| 103 | fadt->FADT_MinorVersion = 0; /* MUST be 0 ACPI 3.0 */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 104 | |
| 105 | fadt->x_firmware_ctl_l = 0; /* set to 0 if firmware_ctrl is used */ |
| 106 | fadt->x_firmware_ctl_h = 0; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 107 | |
| 108 | fadt->x_pm1a_evt_blk.space_id = ACPI_ADDRESS_SPACE_IO; |
| 109 | fadt->x_pm1a_evt_blk.bit_width = 32; |
| 110 | fadt->x_pm1a_evt_blk.bit_offset = 0; |
| 111 | fadt->x_pm1a_evt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS; |
| 112 | fadt->x_pm1a_evt_blk.addrl = ACPI_PM_EVT_BLK; |
| 113 | fadt->x_pm1a_evt_blk.addrh = 0x0; |
| 114 | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 115 | fadt->x_pm1a_cnt_blk.space_id = ACPI_ADDRESS_SPACE_IO; |
| 116 | fadt->x_pm1a_cnt_blk.bit_width = 16; |
| 117 | fadt->x_pm1a_cnt_blk.bit_offset = 0; |
Patrick Rudolph | c02bda0 | 2020-02-28 10:19:41 +0100 | [diff] [blame] | 118 | fadt->x_pm1a_cnt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 119 | fadt->x_pm1a_cnt_blk.addrl = ACPI_PM1_CNT_BLK; |
| 120 | fadt->x_pm1a_cnt_blk.addrh = 0x0; |
| 121 | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 122 | fadt->x_pm_tmr_blk.space_id = ACPI_ADDRESS_SPACE_IO; |
| 123 | fadt->x_pm_tmr_blk.bit_width = 32; |
| 124 | fadt->x_pm_tmr_blk.bit_offset = 0; |
| 125 | fadt->x_pm_tmr_blk.access_size = ACPI_ACCESS_SIZE_DWORD_ACCESS; |
| 126 | fadt->x_pm_tmr_blk.addrl = ACPI_PM_TMR_BLK; |
| 127 | fadt->x_pm_tmr_blk.addrh = 0x0; |
| 128 | |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 129 | fadt->x_gpe0_blk.space_id = ACPI_ADDRESS_SPACE_IO; |
| 130 | fadt->x_gpe0_blk.bit_width = 64; /* EventStatus + Event Enable */ |
| 131 | fadt->x_gpe0_blk.bit_offset = 0; |
Angel Pons | a23aff3 | 2020-06-21 20:47:54 +0200 | [diff] [blame] | 132 | fadt->x_gpe0_blk.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 133 | fadt->x_gpe0_blk.addrl = ACPI_GPE0_BLK; |
| 134 | fadt->x_gpe0_blk.addrh = 0x0; |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 135 | } |
Marc Jones | 257db58 | 2017-06-18 17:33:30 -0600 | [diff] [blame] | 136 | |
Furquan Shaikh | 7536a39 | 2020-04-24 21:59:21 -0700 | [diff] [blame] | 137 | void generate_cpu_entries(const struct device *device) |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 138 | { |
Richard Spiegel | 3f16a0f | 2018-08-06 11:06:08 -0700 | [diff] [blame] | 139 | int cores, cpu; |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 140 | |
| 141 | /* Stoney Ridge is single node, just report # of cores */ |
Patrick Georgi | 4fbefc5 | 2018-10-23 14:35:37 +0200 | [diff] [blame] | 142 | cores = pci_read_config32(SOC_NB_DEV, NB_CAPABILITIES2) & CMP_CAP_MASK; |
| 143 | cores++; /* number of cores is CmpCap+1 */ |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 144 | |
Michał Żygowski | 9550e97 | 2020-03-20 13:56:46 +0100 | [diff] [blame] | 145 | printk(BIOS_DEBUG, "ACPI \\_SB report %d core(s)\n", cores); |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 146 | |
Michał Żygowski | 9550e97 | 2020-03-20 13:56:46 +0100 | [diff] [blame] | 147 | /* Generate BSP \_SB.P000 */ |
Richard Spiegel | 3f16a0f | 2018-08-06 11:06:08 -0700 | [diff] [blame] | 148 | acpigen_write_processor(0, ACPI_GPE0_BLK, 6); |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 149 | acpigen_pop_len(); |
| 150 | |
Michał Żygowski | 9550e97 | 2020-03-20 13:56:46 +0100 | [diff] [blame] | 151 | /* Generate AP \_SB.Pxxx */ |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 152 | for (cpu = 1; cpu < cores; cpu++) { |
Richard Spiegel | 3f16a0f | 2018-08-06 11:06:08 -0700 | [diff] [blame] | 153 | acpigen_write_processor(cpu, 0, 0); |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 154 | acpigen_pop_len(); |
| 155 | } |
Kyösti Mälkki | da321d8 | 2021-01-27 20:22:33 +0200 | [diff] [blame] | 156 | |
| 157 | acpigen_write_scope("\\"); |
| 158 | acpigen_write_name_integer("PCNT", cores); |
| 159 | acpigen_pop_len(); |
Marc Jones | 6bfcf66 | 2017-08-06 17:42:35 -0600 | [diff] [blame] | 160 | } |
| 161 | |
Kyösti Mälkki | e1ff3cd | 2020-06-29 03:17:05 +0300 | [diff] [blame] | 162 | void soc_fill_gnvs(struct global_nvs *gnvs) |
Marc Jones | 257db58 | 2017-06-18 17:33:30 -0600 | [diff] [blame] | 163 | { |
Marc Jones | 257db58 | 2017-06-18 17:33:30 -0600 | [diff] [blame] | 164 | /* Set unknown wake source */ |
| 165 | gnvs->pm1i = ~0ULL; |
Richard Spiegel | dbee8ae | 2018-05-09 17:34:04 -0700 | [diff] [blame] | 166 | gnvs->gpei = ~0ULL; |
Marc Jones | 257db58 | 2017-06-18 17:33:30 -0600 | [diff] [blame] | 167 | } |
| 168 | |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 169 | static void acpigen_soc_get_gpio_in_local5(uintptr_t addr) |
| 170 | { |
| 171 | /* |
| 172 | * Store (\_SB.GPR2 (addr), Local5) |
| 173 | * \_SB.GPR2 is used to read control byte 2 from control register. |
| 174 | * / It is defined in gpio_lib.asl. |
| 175 | */ |
| 176 | acpigen_write_store(); |
| 177 | acpigen_emit_namestring("\\_SB.GPR2"); |
| 178 | acpigen_write_integer(addr); |
| 179 | acpigen_emit_byte(LOCAL5_OP); |
| 180 | } |
| 181 | |
| 182 | static int acpigen_soc_get_gpio_val(unsigned int gpio_num, uint32_t mask) |
| 183 | { |
Marshall Dawson | 251d305 | 2019-05-02 17:27:57 -0600 | [diff] [blame] | 184 | if (gpio_num >= SOC_GPIO_TOTAL_PINS) { |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 185 | printk(BIOS_WARNING, "Warning: Pin %d should be smaller than" |
Marshall Dawson | 251d305 | 2019-05-02 17:27:57 -0600 | [diff] [blame] | 186 | " %d\n", gpio_num, SOC_GPIO_TOTAL_PINS); |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 187 | return -1; |
| 188 | } |
Kyösti Mälkki | 39bd46f | 2020-06-18 19:18:21 +0300 | [diff] [blame] | 189 | uintptr_t addr = gpio_get_address(gpio_num); |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 190 | |
| 191 | acpigen_soc_get_gpio_in_local5(addr); |
| 192 | |
| 193 | /* If (And (Local5, mask)) */ |
| 194 | acpigen_write_if_and(LOCAL5_OP, mask); |
| 195 | |
| 196 | /* Store (One, Local0) */ |
| 197 | acpigen_write_store_ops(ONE_OP, LOCAL0_OP); |
| 198 | |
| 199 | acpigen_pop_len(); /* If */ |
| 200 | |
| 201 | /* Else */ |
| 202 | acpigen_write_else(); |
| 203 | |
| 204 | /* Store (Zero, Local0) */ |
| 205 | acpigen_write_store_ops(ZERO_OP, LOCAL0_OP); |
| 206 | |
| 207 | acpigen_pop_len(); /* Else */ |
| 208 | |
| 209 | return 0; |
| 210 | } |
| 211 | |
| 212 | static int acpigen_soc_set_gpio_val(unsigned int gpio_num, uint32_t val) |
| 213 | { |
Marshall Dawson | 251d305 | 2019-05-02 17:27:57 -0600 | [diff] [blame] | 214 | if (gpio_num >= SOC_GPIO_TOTAL_PINS) { |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 215 | printk(BIOS_WARNING, "Warning: Pin %d should be smaller than" |
Marshall Dawson | 251d305 | 2019-05-02 17:27:57 -0600 | [diff] [blame] | 216 | " %d\n", gpio_num, SOC_GPIO_TOTAL_PINS); |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 217 | return -1; |
| 218 | } |
Kyösti Mälkki | 39bd46f | 2020-06-18 19:18:21 +0300 | [diff] [blame] | 219 | uintptr_t addr = gpio_get_address(gpio_num); |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 220 | |
Kevin Chiu | d837e66 | 2018-07-03 19:13:34 +0800 | [diff] [blame] | 221 | /* Store (0x40, Local0) */ |
| 222 | acpigen_write_store(); |
| 223 | acpigen_write_integer(GPIO_PIN_OUT); |
| 224 | acpigen_emit_byte(LOCAL0_OP); |
| 225 | |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 226 | acpigen_soc_get_gpio_in_local5(addr); |
| 227 | |
| 228 | if (val) { |
| 229 | /* Or (Local5, GPIO_PIN_OUT, Local5) */ |
Kevin Chiu | d837e66 | 2018-07-03 19:13:34 +0800 | [diff] [blame] | 230 | acpigen_write_or(LOCAL5_OP, LOCAL0_OP, LOCAL5_OP); |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 231 | } else { |
| 232 | /* Not (GPIO_PIN_OUT, Local6) */ |
Kevin Chiu | d837e66 | 2018-07-03 19:13:34 +0800 | [diff] [blame] | 233 | acpigen_write_not(LOCAL0_OP, LOCAL6_OP); |
Richard Spiegel | 93459d6 | 2018-05-16 14:08:33 -0700 | [diff] [blame] | 234 | |
| 235 | /* And (Local5, Local6, Local5) */ |
| 236 | acpigen_write_and(LOCAL5_OP, LOCAL6_OP, LOCAL5_OP); |
| 237 | } |
| 238 | |
| 239 | /* |
| 240 | * SB.GPW2 (addr, Local5) |
| 241 | * \_SB.GPW2 is used to write control byte in control register |
| 242 | * / byte 2. It is defined in gpio_lib.asl. |
| 243 | */ |
| 244 | acpigen_emit_namestring("\\_SB.GPW2"); |
| 245 | acpigen_write_integer(addr); |
| 246 | acpigen_emit_byte(LOCAL5_OP); |
| 247 | |
| 248 | return 0; |
| 249 | } |
| 250 | |
| 251 | int acpigen_soc_read_rx_gpio(unsigned int gpio_num) |
| 252 | { |
| 253 | return acpigen_soc_get_gpio_val(gpio_num, GPIO_PIN_IN); |
| 254 | } |
| 255 | |
| 256 | int acpigen_soc_get_tx_gpio(unsigned int gpio_num) |
| 257 | { |
| 258 | return acpigen_soc_get_gpio_val(gpio_num, GPIO_PIN_OUT); |
| 259 | } |
| 260 | |
| 261 | int acpigen_soc_set_tx_gpio(unsigned int gpio_num) |
| 262 | { |
| 263 | return acpigen_soc_set_gpio_val(gpio_num, 1); |
| 264 | } |
| 265 | |
| 266 | int acpigen_soc_clear_tx_gpio(unsigned int gpio_num) |
| 267 | { |
| 268 | return acpigen_soc_set_gpio_val(gpio_num, 0); |
| 269 | } |