blob: eba9dfee3db613d6624791682ee447b342cc4e8d [file] [log] [blame]
Angel Ponsae593872020-04-04 18:50:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Martin Roth5c354b92019-04-22 14:55:16 -06002
3/*
4 * ACPI - create the Fixed ACPI Description Tables (FADT)
5 */
6
7#include <string.h>
8#include <console/console.h>
Furquan Shaikh76cedd22020-05-02 10:24:23 -07009#include <acpi/acpi.h>
Kyösti Mälkki0c1dd9c2020-06-17 23:37:49 +030010#include <acpi/acpi_gnvs.h>
Furquan Shaikh76cedd22020-05-02 10:24:23 -070011#include <acpi/acpigen.h>
Martin Roth5c354b92019-04-22 14:55:16 -060012#include <device/pci_ops.h>
13#include <arch/ioapic.h>
Raul E Rangel93b62e62020-01-31 12:53:45 -070014#include <arch/smp/mpspec.h>
Jason Glenesk498015d2020-12-10 03:28:38 -080015#include <cpu/amd/cpuid.h>
Jason Gleneskbc521432020-09-14 05:22:47 -070016#include <cpu/amd/msr.h>
Martin Roth5c354b92019-04-22 14:55:16 -060017#include <cpu/x86/smm.h>
Martin Roth5c354b92019-04-22 14:55:16 -060018#include <device/device.h>
19#include <device/pci.h>
20#include <amdblocks/acpimmio.h>
21#include <amdblocks/acpi.h>
22#include <soc/acpi.h>
23#include <soc/pci_devs.h>
Marshall Dawson34c30562019-07-16 15:18:00 -060024#include <soc/cpu.h>
Jason Gleneskbc521432020-09-14 05:22:47 -070025#include <soc/msr.h>
Martin Roth5c354b92019-04-22 14:55:16 -060026#include <soc/southbridge.h>
Martin Roth5c354b92019-04-22 14:55:16 -060027#include <soc/nvs.h>
28#include <soc/gpio.h>
29#include <version.h>
Raul E Rangel93b62e62020-01-31 12:53:45 -070030#include "chip.h"
Martin Roth5c354b92019-04-22 14:55:16 -060031
Raul E Rangel94acba82020-05-07 15:12:20 -060032unsigned long acpi_fill_mcfg(unsigned long current)
33{
34
35 current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *)current,
36 CONFIG_MMCONF_BASE_ADDRESS,
37 0,
38 0,
Aaron Durbin4a3a73c2020-06-12 16:44:50 -060039 CONFIG_MMCONF_BUS_NUMBER - 1);
Raul E Rangel94acba82020-05-07 15:12:20 -060040
41 return current;
42}
43
Martin Roth5c354b92019-04-22 14:55:16 -060044unsigned long acpi_fill_madt(unsigned long current)
45{
Raul E Rangel93b62e62020-01-31 12:53:45 -070046 const struct soc_amd_picasso_config *cfg = config_of_soc();
47 unsigned int i;
48 uint8_t irq;
49 uint8_t flags;
50
Martin Roth5c354b92019-04-22 14:55:16 -060051 /* create all subtables for processors */
52 current = acpi_create_madt_lapics(current);
53
Martin Roth5c354b92019-04-22 14:55:16 -060054 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current,
Marshall Dawson39c64b02020-09-04 12:07:27 -060055 CONFIG_PICASSO_FCH_IOAPIC_ID, IO_APIC_ADDR, 0);
Martin Roth5c354b92019-04-22 14:55:16 -060056
Jason Gleneskf459a402020-09-02 16:49:10 -070057 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current,
58 CONFIG_PICASSO_GNB_IOAPIC_ID, GNB_IO_APIC_ADDR, IO_APIC_INTERRUPTS);
59
Martin Roth5c354b92019-04-22 14:55:16 -060060 /* 0: mean bus 0--->ISA */
61 /* 0: PIC 0 */
62 /* 2: APIC 2 */
63 /* 5 mean: 0101 --> Edge-triggered, Active high */
64 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
65 current, 0, 0, 2, 0);
Raul E Rangel93b62e62020-01-31 12:53:45 -070066 current += acpi_create_madt_irqoverride(
67 (acpi_madt_irqoverride_t *)current, 0, 9, 9,
68 MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW);
69
70 for (i = 0; i < ARRAY_SIZE(cfg->irq_override); ++i) {
71 irq = cfg->irq_override[i].irq;
72 flags = cfg->irq_override[i].flags;
73
74 if (!flags)
75 continue;
76
77 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)current, 0,
78 irq, irq, flags);
79 }
Martin Roth5c354b92019-04-22 14:55:16 -060080
81 /* create all subtables for processors */
82 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current,
83 0xff, 5, 1);
84 /* 1: LINT1 connect to NMI */
85
86 return current;
87}
88
89/*
90 * Reference section 5.2.9 Fixed ACPI Description Table (FADT)
91 * in the ACPI 3.0b specification.
92 */
Kyösti Mälkki61ef71b2020-05-30 18:54:39 +030093void acpi_fill_fadt(acpi_fadt_t *fadt)
Martin Roth5c354b92019-04-22 14:55:16 -060094{
Martin Rotheca8faa2019-12-01 16:49:19 -070095 const struct soc_amd_picasso_config *cfg = config_of_soc();
96
Felix Held757d6452021-02-04 21:31:49 +010097 printk(BIOS_DEBUG, "pm_base: 0x%04x\n", ACPI_IO_BASE);
Martin Roth5c354b92019-04-22 14:55:16 -060098
Martin Roth5c354b92019-04-22 14:55:16 -060099 fadt->sci_int = 9; /* IRQ 09 - ACPI SCI */
100
Kyösti Mälkki0a9e72e2019-08-11 01:22:28 +0300101 if (permanent_smi_handler()) {
Martin Roth5c354b92019-04-22 14:55:16 -0600102 fadt->smi_cmd = APM_CNT;
103 fadt->acpi_enable = APM_CNT_ACPI_ENABLE;
104 fadt->acpi_disable = APM_CNT_ACPI_DISABLE;
Martin Roth5c354b92019-04-22 14:55:16 -0600105 }
106
107 fadt->pm1a_evt_blk = ACPI_PM_EVT_BLK;
Martin Roth5c354b92019-04-22 14:55:16 -0600108 fadt->pm1a_cnt_blk = ACPI_PM1_CNT_BLK;
Martin Roth5c354b92019-04-22 14:55:16 -0600109 fadt->pm_tmr_blk = ACPI_PM_TMR_BLK;
110 fadt->gpe0_blk = ACPI_GPE0_BLK;
Martin Roth5c354b92019-04-22 14:55:16 -0600111
112 fadt->pm1_evt_len = 4; /* 32 bits */
113 fadt->pm1_cnt_len = 2; /* 16 bits */
Martin Roth5c354b92019-04-22 14:55:16 -0600114 fadt->pm_tmr_len = 4; /* 32 bits */
115 fadt->gpe0_blk_len = 8; /* 64 bits */
Martin Roth5c354b92019-04-22 14:55:16 -0600116
117 fadt->p_lvl2_lat = ACPI_FADT_C2_NOT_SUPPORTED;
118 fadt->p_lvl3_lat = ACPI_FADT_C3_NOT_SUPPORTED;
Martin Roth5c354b92019-04-22 14:55:16 -0600119 fadt->duty_offset = 1; /* CLK_VAL bits 3:1 */
120 fadt->duty_width = 3; /* CLK_VAL bits 3:1 */
Raul E Rangel041fcf52020-08-12 12:13:35 -0600121 fadt->day_alrm = 0x0d;
122 fadt->mon_alrm = 0;
123 fadt->century = 0x32;
Martin Rotheca8faa2019-12-01 16:49:19 -0700124 fadt->iapc_boot_arch = cfg->fadt_boot_arch; /* legacy free default */
Martin Roth5c354b92019-04-22 14:55:16 -0600125 fadt->res2 = 0; /* reserved, MUST be 0 ACPI 3.0 */
Martin Rotheca8faa2019-12-01 16:49:19 -0700126 fadt->flags |= ACPI_FADT_WBINVD | /* See table 5-34 ACPI 6.3 spec */
127 ACPI_FADT_C1_SUPPORTED |
128 ACPI_FADT_S4_RTC_WAKE |
129 ACPI_FADT_32BIT_TIMER |
130 ACPI_FADT_PCI_EXPRESS_WAKE |
131 ACPI_FADT_PLATFORM_CLOCK |
132 ACPI_FADT_S4_RTC_VALID |
133 ACPI_FADT_REMOTE_POWER_ON;
134 fadt->flags |= cfg->fadt_flags; /* additional board-specific flags */
Martin Roth5c354b92019-04-22 14:55:16 -0600135
Martin Roth5c354b92019-04-22 14:55:16 -0600136 fadt->ARM_boot_arch = 0; /* MUST be 0 ACPI 3.0 */
137 fadt->FADT_MinorVersion = 0; /* MUST be 0 ACPI 3.0 */
138
139 fadt->x_firmware_ctl_l = 0; /* set to 0 if firmware_ctrl is used */
140 fadt->x_firmware_ctl_h = 0;
Martin Roth5c354b92019-04-22 14:55:16 -0600141
142 fadt->x_pm1a_evt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
143 fadt->x_pm1a_evt_blk.bit_width = 32;
144 fadt->x_pm1a_evt_blk.bit_offset = 0;
145 fadt->x_pm1a_evt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS;
146 fadt->x_pm1a_evt_blk.addrl = ACPI_PM_EVT_BLK;
147 fadt->x_pm1a_evt_blk.addrh = 0x0;
148
Martin Roth5c354b92019-04-22 14:55:16 -0600149 fadt->x_pm1a_cnt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
150 fadt->x_pm1a_cnt_blk.bit_width = 16;
151 fadt->x_pm1a_cnt_blk.bit_offset = 0;
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100152 fadt->x_pm1a_cnt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS;
Martin Roth5c354b92019-04-22 14:55:16 -0600153 fadt->x_pm1a_cnt_blk.addrl = ACPI_PM1_CNT_BLK;
154 fadt->x_pm1a_cnt_blk.addrh = 0x0;
155
Martin Roth5c354b92019-04-22 14:55:16 -0600156 fadt->x_pm_tmr_blk.space_id = ACPI_ADDRESS_SPACE_IO;
157 fadt->x_pm_tmr_blk.bit_width = 32;
158 fadt->x_pm_tmr_blk.bit_offset = 0;
159 fadt->x_pm_tmr_blk.access_size = ACPI_ACCESS_SIZE_DWORD_ACCESS;
160 fadt->x_pm_tmr_blk.addrl = ACPI_PM_TMR_BLK;
161 fadt->x_pm_tmr_blk.addrh = 0x0;
162
Martin Roth5c354b92019-04-22 14:55:16 -0600163 fadt->x_gpe0_blk.space_id = ACPI_ADDRESS_SPACE_IO;
164 fadt->x_gpe0_blk.bit_width = 64; /* EventStatus + Event Enable */
165 fadt->x_gpe0_blk.bit_offset = 0;
Angel Ponsa23aff32020-06-21 20:47:54 +0200166 fadt->x_gpe0_blk.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS;
Martin Roth5c354b92019-04-22 14:55:16 -0600167 fadt->x_gpe0_blk.addrl = ACPI_GPE0_BLK;
168 fadt->x_gpe0_blk.addrh = 0x0;
Martin Roth5c354b92019-04-22 14:55:16 -0600169}
170
Jason Gleneskbc521432020-09-14 05:22:47 -0700171static uint32_t get_pstate_core_freq(msr_t pstate_def)
172{
173 uint32_t core_freq, core_freq_mul, core_freq_div;
174 bool valid_freq_divisor;
175
176 /* Core frequency multiplier */
177 core_freq_mul = pstate_def.lo & PSTATE_DEF_LO_FREQ_MUL_MASK;
178
179 /* Core frequency divisor ID */
180 core_freq_div =
181 (pstate_def.lo & PSTATE_DEF_LO_FREQ_DIV_MASK) >> PSTATE_DEF_LO_FREQ_DIV_SHIFT;
182
183 if (core_freq_div == 0) {
184 return 0;
185 } else if ((core_freq_div >= PSTATE_DEF_LO_FREQ_DIV_MIN)
186 && (core_freq_div <= PSTATE_DEF_LO_EIGHTH_STEP_MAX)) {
187 /* Allow 1/8 integer steps for this range */
188 valid_freq_divisor = 1;
189 } else if ((core_freq_div > PSTATE_DEF_LO_EIGHTH_STEP_MAX)
190 && (core_freq_div <= PSTATE_DEF_LO_FREQ_DIV_MAX) && !(core_freq_div & 0x1)) {
191 /* Only allow 1/4 integer steps for this range */
192 valid_freq_divisor = 1;
193 } else {
194 valid_freq_divisor = 0;
195 }
196
197 if (valid_freq_divisor) {
198 /* 25 * core_freq_mul / (core_freq_div / 8) */
199 core_freq =
200 ((PSTATE_DEF_LO_CORE_FREQ_BASE * core_freq_mul * 8) / (core_freq_div));
201 } else {
202 printk(BIOS_WARNING, "Undefined core_freq_div %x used. Force to 1.\n",
203 core_freq_div);
204 core_freq = (PSTATE_DEF_LO_CORE_FREQ_BASE * core_freq_mul);
205 }
206 return core_freq;
207}
208
209static uint32_t get_pstate_core_power(msr_t pstate_def)
210{
211 uint32_t voltage_in_uvolts, core_vid, current_value_amps, current_divisor, power_in_mw;
212
213 /* Core voltage ID */
214 core_vid =
215 (pstate_def.lo & PSTATE_DEF_LO_CORE_VID_MASK) >> PSTATE_DEF_LO_CORE_VID_SHIFT;
216
217 /* Current value in amps */
218 current_value_amps =
219 (pstate_def.lo & PSTATE_DEF_LO_CUR_VAL_MASK) >> PSTATE_DEF_LO_CUR_VAL_SHIFT;
220
221 /* Current divisor */
222 current_divisor =
223 (pstate_def.lo & PSTATE_DEF_LO_CUR_DIV_MASK) >> PSTATE_DEF_LO_CUR_DIV_SHIFT;
224
225 /* Voltage */
226 if ((core_vid >= 0xF8) && (core_vid <= 0xFF)) {
227 /* Voltage off for VID codes 0xF8 to 0xFF */
228 voltage_in_uvolts = 0;
229 } else {
230 voltage_in_uvolts =
231 SERIAL_VID_MAX_MICROVOLTS - (SERIAL_VID_DECODE_MICROVOLTS * core_vid);
232 }
233
234 /* Power in mW */
235 power_in_mw = (voltage_in_uvolts) / 1000 * current_value_amps;
236
237 switch (current_divisor) {
238 case 0:
239 break;
240 case 1:
241 power_in_mw = power_in_mw / 10L;
242 break;
243 case 2:
244 power_in_mw = power_in_mw / 100L;
245 break;
246 case 3:
247 /* current_divisor is set to an undefined value.*/
248 printk(BIOS_WARNING, "Undefined current_divisor set for enabled P-state .\n");
249 power_in_mw = 0;
250 break;
251 }
252
253 return power_in_mw;
254}
255
256/*
257 * Populate structure describing enabled p-states and return count of enabled p-states.
258 */
259static size_t get_pstate_info(struct acpi_sw_pstate *pstate_values,
260 struct acpi_xpss_sw_pstate *pstate_xpss_values)
261{
262 msr_t pstate_def;
263 size_t pstate_count, pstate;
264 uint32_t pstate_enable, max_pstate;
265
266 pstate_count = 0;
267 max_pstate = (rdmsr(PS_LIM_REG).lo & PS_LIM_MAX_VAL_MASK) >> PS_MAX_VAL_SHFT;
268
269 for (pstate = 0; pstate <= max_pstate; pstate++) {
270 pstate_def = rdmsr(PSTATE_0_MSR + pstate);
271
272 pstate_enable = (pstate_def.hi & PSTATE_DEF_HI_ENABLE_MASK)
273 >> PSTATE_DEF_HI_ENABLE_SHIFT;
274 if (!pstate_enable)
275 continue;
276
277 pstate_values[pstate_count].core_freq = get_pstate_core_freq(pstate_def);
278 pstate_values[pstate_count].power = get_pstate_core_power(pstate_def);
279 pstate_values[pstate_count].transition_latency = 0;
280 pstate_values[pstate_count].bus_master_latency = 0;
281 pstate_values[pstate_count].control_value = pstate;
282 pstate_values[pstate_count].status_value = pstate;
283
284 pstate_xpss_values[pstate_count].core_freq =
285 (uint64_t)pstate_values[pstate_count].core_freq;
286 pstate_xpss_values[pstate_count].power =
287 (uint64_t)pstate_values[pstate_count].power;
288 pstate_xpss_values[pstate_count].transition_latency = 0;
289 pstate_xpss_values[pstate_count].bus_master_latency = 0;
290 pstate_xpss_values[pstate_count].control_value = (uint64_t)pstate;
291 pstate_xpss_values[pstate_count].status_value = (uint64_t)pstate;
292 pstate_count++;
293 }
294
295 return pstate_count;
296}
297
Furquan Shaikh7536a392020-04-24 21:59:21 -0700298void generate_cpu_entries(const struct device *device)
Martin Roth5c354b92019-04-22 14:55:16 -0600299{
Jason Gleneskbc521432020-09-14 05:22:47 -0700300 int logical_cores;
301 size_t pstate_count, cpu, proc_blk_len;
302 struct acpi_sw_pstate pstate_values[MAX_PSTATES] = { {0} };
303 struct acpi_xpss_sw_pstate pstate_xpss_values[MAX_PSTATES] = { {0} };
304 uint32_t threads_per_core, proc_blk_addr;
305 uint32_t cstate_base_address =
306 rdmsr(MSR_CSTATE_ADDRESS).lo & MSR_CSTATE_ADDRESS_MASK;
Martin Roth5c354b92019-04-22 14:55:16 -0600307
Jason Gleneskbc521432020-09-14 05:22:47 -0700308 const acpi_addr_t perf_ctrl = {
309 .space_id = ACPI_ADDRESS_SPACE_FIXED,
310 .bit_width = 64,
311 .addrl = PS_CTL_REG,
312 };
313 const acpi_addr_t perf_sts = {
314 .space_id = ACPI_ADDRESS_SPACE_FIXED,
315 .bit_width = 64,
316 .addrl = PS_STS_REG,
317 };
Martin Roth5c354b92019-04-22 14:55:16 -0600318
Jason Gleneskbc521432020-09-14 05:22:47 -0700319 acpi_cstate_t cstate_info[] = {
320 [0] = {
321 .ctype = 1,
322 .latency = 1,
323 .power = 0,
324 .resource = {
325 .space_id = ACPI_ADDRESS_SPACE_FIXED,
326 .bit_width = 2,
327 .bit_offset = 2,
328 .addrl = 0,
329 .addrh = 0,
330 },
331 },
332 [1] = {
333 .ctype = 2,
334 .latency = 400,
335 .power = 0,
336 .resource = {
337 .space_id = ACPI_ADDRESS_SPACE_IO,
338 .bit_width = 8,
339 .bit_offset = 0,
340 .addrl = cstate_base_address + 1,
341 .addrh = 0,
342 .access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS,
343 },
344 },
345 };
Martin Roth5c354b92019-04-22 14:55:16 -0600346
Jason Gleneskbc521432020-09-14 05:22:47 -0700347 threads_per_core = ((cpuid_ebx(CPUID_EBX_CORE_ID) & CPUID_EBX_THREADS_MASK)
348 >> CPUID_EBX_THREADS_SHIFT)
349 + 1;
350 pstate_count = get_pstate_info(pstate_values, pstate_xpss_values);
351 logical_cores = get_cpu_count();
352
353 for (cpu = 0; cpu < logical_cores; cpu++) {
354
355 if (cpu == 0) {
356 /* BSP values for \_SB.Pxxx */
357 proc_blk_len = 6;
358 proc_blk_addr = ACPI_GPE0_BLK;
359 } else {
360 /* AP values for \_SB.Pxxx */
361 proc_blk_addr = 0;
362 proc_blk_len = 0;
363 }
364
365 acpigen_write_processor(cpu, proc_blk_addr, proc_blk_len);
366
367 acpigen_write_pct_package(&perf_ctrl, &perf_sts);
368
369 acpigen_write_pss_object(pstate_values, pstate_count);
370
371 acpigen_write_xpss_object(pstate_xpss_values, pstate_count);
372
373 if (CONFIG(ACPI_SSDT_PSD_INDEPENDENT))
374 acpigen_write_PSD_package(cpu / threads_per_core, threads_per_core,
375 HW_ALL);
376 else
377 acpigen_write_PSD_package(0, logical_cores, SW_ALL);
378
379 acpigen_write_PPC(0);
380
381 acpigen_write_CST_package(cstate_info, ARRAY_SIZE(cstate_info));
382
383 acpigen_write_CSD_package(cpu >> 1, threads_per_core, HW_ALL, 0);
384
Martin Roth5c354b92019-04-22 14:55:16 -0600385 acpigen_pop_len();
386 }
Kyösti Mälkkida321d82021-01-27 20:22:33 +0200387
388 acpigen_write_scope("\\");
389 acpigen_write_name_integer("PCNT", logical_cores);
390 acpigen_pop_len();
Martin Roth5c354b92019-04-22 14:55:16 -0600391}
392
Furquan Shaikh0f007d82020-04-24 06:41:18 -0700393unsigned long southbridge_write_acpi_tables(const struct device *device,
Martin Roth5c354b92019-04-22 14:55:16 -0600394 unsigned long current,
395 struct acpi_rsdp *rsdp)
396{
397 return acpi_write_hpet(device, current, rsdp);
398}
399
Kyösti Mälkkie1ff3cd2020-06-29 03:17:05 +0300400void soc_fill_gnvs(struct global_nvs *gnvs)
Martin Roth5c354b92019-04-22 14:55:16 -0600401{
Martin Roth5c354b92019-04-22 14:55:16 -0600402 /* Set unknown wake source */
403 gnvs->pm1i = ~0ULL;
404 gnvs->gpei = ~0ULL;
Martin Roth5c354b92019-04-22 14:55:16 -0600405}
406
Eric Lai7cee5662020-12-28 14:52:11 +0800407static int acpigen_soc_gpio_op(const char *op, unsigned int gpio_num)
408{
409 if (gpio_num >= SOC_GPIO_TOTAL_PINS) {
410 printk(BIOS_WARNING, "Warning: Pin %d should be smaller than"
411 " %d\n", gpio_num, SOC_GPIO_TOTAL_PINS);
412 return -1;
413 }
414 /* op (gpio_num) */
415 acpigen_emit_namestring(op);
416 acpigen_write_integer(gpio_num);
417 return 0;
418}
419
Eric Laid7a36432020-12-28 15:32:54 +0800420static int acpigen_soc_get_gpio_state(const char *op, unsigned int gpio_num)
421{
422 if (gpio_num >= SOC_GPIO_TOTAL_PINS) {
423 printk(BIOS_WARNING, "Warning: Pin %d should be smaller than"
424 " %d\n", gpio_num, SOC_GPIO_TOTAL_PINS);
425 return -1;
426 }
427 /* Store (op (gpio_num), Local0) */
428 acpigen_write_store();
429 acpigen_soc_gpio_op(op, gpio_num);
430 acpigen_emit_byte(LOCAL0_OP);
431 return 0;
432}
433
434int acpigen_soc_read_rx_gpio(unsigned int gpio_num)
435{
436 return acpigen_soc_get_gpio_state("\\_SB.GRXS", gpio_num);
437}
438
439int acpigen_soc_get_tx_gpio(unsigned int gpio_num)
440{
441 return acpigen_soc_get_gpio_state("\\_SB.GTXS", gpio_num);
442}
443
Martin Roth5c354b92019-04-22 14:55:16 -0600444int acpigen_soc_set_tx_gpio(unsigned int gpio_num)
445{
Eric Lai7cee5662020-12-28 14:52:11 +0800446 return acpigen_soc_gpio_op("\\_SB.STXS", gpio_num);
Martin Roth5c354b92019-04-22 14:55:16 -0600447}
448
449int acpigen_soc_clear_tx_gpio(unsigned int gpio_num)
450{
Eric Lai7cee5662020-12-28 14:52:11 +0800451 return acpigen_soc_gpio_op("\\_SB.CTXS", gpio_num);
Martin Roth5c354b92019-04-22 14:55:16 -0600452}