coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smihandler.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <delay.h>
4 #include <types.h>
5 #include <arch/io.h>
6 #include <device/mmio.h>
7 #include <device/pci_ops.h>
8 #include <console/console.h>
9 #include <cpu/x86/cache.h>
10 #include <device/pci_def.h>
11 #include <cpu/x86/smm.h>
13 #include <spi-generic.h>
14 #include <elog.h>
15 #include <halt.h>
16 #include <option.h>
17 #include <soc/lpc.h>
18 #include <soc/nvs.h>
19 #include <soc/pci_devs.h>
20 #include <soc/pm.h>
21 #include <soc/rcba.h>
22 #include <soc/xhci.h>
24 #include <smmstore.h>
25 
27 {
28  switch (smif) {
29  case 0x32:
30  printk(BIOS_DEBUG, "OS Init\n");
31  /* gnvs->smif:
32  * On success, the IO Trap Handler returns 0
33  * On failure, the IO Trap Handler returns a value != 0
34  */
35  gnvs->smif = 0;
36  return 1; /* IO trap handled */
37  }
38 
39  /* Not handled */
40  return 0;
41 }
42 
43 /**
44  * @brief Set the EOS bit
45  */
47 {
48  enable_smi(EOS);
49 }
50 
51 static void busmaster_disable_on_bus(int bus)
52 {
53  int slot, func;
54  unsigned int val;
55  unsigned char hdr;
56 
57  for (slot = 0; slot < 0x20; slot++) {
58  for (func = 0; func < 8; func++) {
59  pci_devfn_t dev = PCI_DEV(bus, slot, func);
60 
62 
63  if (val == 0xffffffff || val == 0x00000000 ||
64  val == 0x0000ffff || val == 0xffff0000)
65  continue;
66 
67  /* Disable Bus Mastering for this one device */
69 
70  /* If this is a bridge, then follow it. */
72  hdr &= 0x7f;
73  if (hdr == PCI_HEADER_TYPE_BRIDGE ||
74  hdr == PCI_HEADER_TYPE_CARDBUS) {
75  unsigned int buses;
76  buses = pci_read_config32(dev, PCI_PRIMARY_BUS);
77  busmaster_disable_on_bus((buses >> 8) & 0xff);
78  }
79  }
80  }
81 }
82 
83 /*
84  * Turn off the backlight if it is on, and wait for the specified
85  * backlight off delay. This will allow panel power timings to meet
86  * spec and prevent brief garbage on the screen when turned off
87  * during firmware with power button triggered SMI.
88  */
89 static void backlight_off(void)
90 {
91  void *reg_base;
92  uint32_t pp_ctrl;
93  uint32_t bl_off_delay;
94 
95  reg_base = (void *)((uintptr_t)pci_read_config32(SA_DEV_IGD,
96  PCI_BASE_ADDRESS_0) & ~0xf);
97 
98  /* Validate pointer before using it */
99  if (smm_points_to_smram(reg_base, PCH_PP_OFF_DELAYS + sizeof(uint32_t)))
100  return;
101 
102  /* Check if backlight is enabled */
103  pp_ctrl = read32(reg_base + PCH_PP_CONTROL);
104  if (!(pp_ctrl & EDP_BLC_ENABLE))
105  return;
106 
107  /* Enable writes to this register */
108  pp_ctrl &= ~PANEL_UNLOCK_MASK;
109  pp_ctrl |= PANEL_UNLOCK_REGS;
110 
111  /* Turn off backlight */
112  pp_ctrl &= ~EDP_BLC_ENABLE;
113 
114  write32(reg_base + PCH_PP_CONTROL, pp_ctrl);
115  read32(reg_base + PCH_PP_CONTROL);
116 
117  /* Read backlight off delay in 100us units */
118  bl_off_delay = read32(reg_base + PCH_PP_OFF_DELAYS);
119  bl_off_delay &= PANEL_LIGHT_OFF_DELAY_MASK;
120  bl_off_delay *= 100;
121 
122  /* Wait for backlight to turn off */
123  udelay(bl_off_delay);
124 
125  printk(BIOS_INFO, "Backlight turned off\n");
126 }
127 
128 static int power_on_after_fail(void)
129 {
130  /* save and recover RTC port values */
131  u8 tmp70, tmp72;
132  tmp70 = inb(0x70);
133  tmp72 = inb(0x72);
134  const unsigned int s5pwr = get_uint_option("power_on_after_fail",
135  CONFIG_MAINBOARD_POWER_FAILURE_STATE);
136  outb(tmp70, 0x70);
137  outb(tmp72, 0x72);
138 
139  /* For "KEEP", switch to "OFF" - KEEP is software emulated. */
140  return (s5pwr == MAINBOARD_POWER_ON);
141 }
142 
143 static void southbridge_smi_sleep(void)
144 {
145  u32 reg32;
146  u8 slp_typ;
147  u16 pmbase = get_pmbase();
148 
149  /* First, disable further SMIs */
151 
152  /* Figure out SLP_TYP */
153  reg32 = inl(pmbase + PM1_CNT);
154  printk(BIOS_SPEW, "SMI#: SLP = 0x%08x\n", reg32);
155  slp_typ = acpi_sleep_from_pm1(reg32);
156 
157  /* Do any mainboard sleep handling */
158  mainboard_smi_sleep(slp_typ);
159 
160  /* USB sleep preparations */
162 
163  /* Log S3, S4, and S5 entry */
164  if (slp_typ >= ACPI_S3)
166 
167  /* Clear pending GPE events */
169 
170  /* Next, do the deed.
171  */
172 
173  switch (slp_typ) {
174  case ACPI_S0:
175  printk(BIOS_DEBUG, "SMI#: Entering S0 (On)\n");
176  break;
177  case ACPI_S1:
178  printk(BIOS_DEBUG, "SMI#: Entering S1 (Assert STPCLK#)\n");
179  break;
180  case ACPI_S3:
181  printk(BIOS_DEBUG, "SMI#: Entering S3 (Suspend-To-RAM)\n");
182 
183  /* Invalidate the cache before going to S3 */
184  wbinvd();
185  break;
186  case ACPI_S4:
187  printk(BIOS_DEBUG, "SMI#: Entering S4 (Suspend-To-Disk)\n");
188  break;
189  case ACPI_S5:
190  printk(BIOS_DEBUG, "SMI#: Entering S5 (Soft Power off)\n");
191 
192  /* Turn off backlight if needed */
193  backlight_off();
194 
195  /* Disable all GPE */
196  disable_all_gpe();
197 
198  /* Always set the flag in case CMOS was changed on runtime. */
199  if (power_on_after_fail())
201  else
203 
204  /* also iterates over all bridges on bus 0 */
206  break;
207  default:
208  printk(BIOS_DEBUG, "SMI#: ERROR: SLP_TYP reserved\n");
209  break;
210  }
211 
212  /*
213  * Write back to the SLP register to cause the originally intended
214  * event again. We need to set BIT13 (SLP_EN) though to make the
215  * sleep happen.
216  */
218 
219  /* Make sure to stop executing code here for S3/S4/S5 */
220  if (slp_typ >= ACPI_S3)
221  halt();
222 
223  /*
224  * In most sleep states, the code flow of this function ends at
225  * the line above. However, if we entered sleep state S1 and wake
226  * up again, we will continue to execute code in this function.
227  */
228  reg32 = inl(pmbase + PM1_CNT);
229  if (reg32 & SCI_EN) {
230  /* The OS is not an ACPI OS, so we set the state to S0 */
232  }
233 }
234 
235 /*
236  * Look for Synchronous IO SMI and use save state from that
237  * core in case we are not running on the same core that
238  * initiated the IO transaction.
239  */
240 static em64t101_smm_state_save_area_t *smi_apmc_find_state_save(u8 cmd)
241 {
242  em64t101_smm_state_save_area_t *state;
243  int node;
244 
245  /* Check all nodes looking for the one that issued the IO */
246  for (node = 0; node < CONFIG_MAX_CPUS; node++) {
247  state = smm_get_save_state(node);
248 
249  /* Check for Synchronous IO (bit0 == 1) */
250  if (!(state->io_misc_info & (1 << 0)))
251  continue;
252 
253  /* Make sure it was a write (bit4 == 0) */
254  if (state->io_misc_info & (1 << 4))
255  continue;
256 
257  /* Check for APMC IO port */
258  if (((state->io_misc_info >> 16) & 0xff) != APM_CNT)
259  continue;
260 
261  /* Check AX against the requested command */
262  if ((state->rax & 0xff) != cmd)
263  continue;
264 
265  return state;
266  }
267 
268  return NULL;
269 }
270 
271 static void southbridge_smi_gsmi(void)
272 {
273  u32 *ret, *param;
274  u8 sub_command;
275  em64t101_smm_state_save_area_t *io_smi =
277 
278  if (!io_smi)
279  return;
280 
281  /* Command and return value in EAX */
282  ret = (u32 *)&io_smi->rax;
283  sub_command = (u8)(*ret >> 8);
284 
285  /* Parameter buffer in EBX */
286  param = (u32 *)&io_smi->rbx;
287 
288  /* drivers/elog/gsmi.c */
289  *ret = gsmi_exec(sub_command, param);
290 }
291 
292 static void southbridge_smi_store(void)
293 {
294  u8 sub_command, ret;
295  em64t101_smm_state_save_area_t *io_smi =
297  uint32_t reg_ebx;
298 
299  if (!io_smi)
300  return;
301  /* Command and return value in EAX */
302  sub_command = (io_smi->rax >> 8) & 0xff;
303 
304  /* Parameter buffer in EBX */
305  reg_ebx = io_smi->rbx;
306 
307  /* drivers/smmstore/smi.c */
308  ret = smmstore_exec(sub_command, (void *)reg_ebx);
309  io_smi->rax = ret;
310 }
311 
312 static void southbridge_smi_apmc(void)
313 {
314  u8 reg8;
315 
316  reg8 = apm_get_apmc();
317  switch (reg8) {
320  break;
321  case APM_CNT_ACPI_ENABLE:
323  break;
324  case APM_CNT_ELOG_GSMI:
325  if (CONFIG(ELOG_GSMI))
327  break;
328  case APM_CNT_SMMSTORE:
329  if (CONFIG(SMMSTORE))
331  break;
332  }
333 
334  mainboard_smi_apmc(reg8);
335 }
336 
337 static void southbridge_smi_pm1(void)
338 {
339  u16 pm1_sts = clear_pm1_status();
340 
341  /* While OSPM is not active, poweroff immediately
342  * on a power button event.
343  */
344  if (pm1_sts & PWRBTN_STS) {
345  /* power button pressed */
347  disable_pm1_control(-1UL);
349  }
350 }
351 
352 static void southbridge_smi_gpe0(void)
353 {
355 }
356 
357 static void southbridge_smi_gpi(void)
358 {
360 
361  /* Clear again after mainboard handler */
363 }
364 
365 static void southbridge_smi_mc(void)
366 {
367  u32 reg32 = inl(get_pmbase() + SMI_EN);
368 
369  /* Are microcontroller SMIs enabled? */
370  if ((reg32 & MCSMI_EN) == 0)
371  return;
372 
373  printk(BIOS_DEBUG, "Microcontroller SMI.\n");
374 }
375 
376 static void southbridge_smi_tco(void)
377 {
378  u32 tco_sts = clear_tco_status();
379 
380  /* Any TCO event? */
381  if (!tco_sts)
382  return;
383 
384  // BIOSWR
385  if (tco_sts & (1 << 8)) {
387 
388  if (bios_cntl & 1) {
389  /*
390  * BWE is RW, so the SMI was caused by a
391  * write to BWE, not by a write to the BIOS
392  *
393  * This is the place where we notice someone
394  * is trying to tinker with the BIOS. We are
395  * trying to be nice and just ignore it. A more
396  * resolute answer would be to power down the
397  * box.
398  */
399  printk(BIOS_DEBUG, "Switching back to RO\n");
400  pci_write_config32(PCH_DEV_LPC, BIOS_CNTL, (bios_cntl & ~1));
401  } /* No else for now? */
402  } else if (tco_sts & (1 << 3)) { /* TIMEOUT */
403  /* Handle TCO timeout */
404  printk(BIOS_DEBUG, "TCO Timeout.\n");
405  }
406 }
407 
408 static void southbridge_smi_periodic(void)
409 {
410  u32 reg32 = inl(get_pmbase() + SMI_EN);
411 
412  /* Are periodic SMIs enabled? */
413  if ((reg32 & PERIODIC_EN) == 0)
414  return;
415 
416  printk(BIOS_DEBUG, "Periodic SMI.\n");
417 }
418 
419 static void southbridge_smi_monitor(void)
420 {
421 #define IOTRAP(x) (trap_sts & (1 << x))
422  u32 trap_sts, trap_cycle;
423  u32 mask = 0;
424  int i;
425 
426  trap_sts = RCBA32(0x1e00); // TRSR - Trap Status Register
427  RCBA32(0x1e00) = trap_sts; // Clear trap(s) in TRSR
428 
429  trap_cycle = RCBA32(0x1e10);
430  for (i = 16; i < 20; i++) {
431  if (trap_cycle & (1 << i))
432  mask |= (0xff << ((i - 16) << 2));
433  }
434 
435  /* IOTRAP(3) SMI function call */
436  if (IOTRAP(3)) {
437  if (gnvs && gnvs->smif)
438  io_trap_handler(gnvs->smif); // call function smif
439  return;
440  }
441 
442  /* IOTRAP(2) currently unused
443  * IOTRAP(1) currently unused */
444 
445  /* IOTRAP(0) SMIC */
446  if (IOTRAP(0)) {
447  // It's a write
448  if (!(trap_cycle & (1 << 24))) {
449  printk(BIOS_DEBUG, "SMI1 command\n");
450  (void)RCBA32(0x1e18);
451  // data = RCBA32(0x1e18);
452  // data &= mask;
453  // if (smi1)
454  // southbridge_smi_command(data);
455  // return;
456  }
457  // Fall through to debug
458  }
459 
460  printk(BIOS_DEBUG, " trapped io address = 0x%x\n",
461  trap_cycle & 0xfffc);
462  for (i = 0; i < 4; i++)
463  if (IOTRAP(i))
464  printk(BIOS_DEBUG, " TRAP = %d\n", i);
465  printk(BIOS_DEBUG, " AHBE = %x\n", (trap_cycle >> 16) & 0xf);
466  printk(BIOS_DEBUG, " MASK = 0x%08x\n", mask);
467  printk(BIOS_DEBUG, " read/write: %s\n",
468  (trap_cycle & (1 << 24)) ? "read" : "write");
469 
470  if (!(trap_cycle & (1 << 24))) {
471  /* Write Cycle */
472  printk(BIOS_DEBUG, " iotrap written data = 0x%08x\n", RCBA32(0x1e18));
473  }
474 #undef IOTRAP
475 }
476 
477 typedef void (*smi_handler_t)(void);
478 
480  NULL, // [0] reserved
481  NULL, // [1] reserved
482  NULL, // [2] BIOS_STS
483  NULL, // [3] LEGACY_USB_STS
484  southbridge_smi_sleep, // [4] SLP_SMI_STS
485  southbridge_smi_apmc, // [5] APM_STS
486  NULL, // [6] SWSMI_TMR_STS
487  NULL, // [7] reserved
488  southbridge_smi_pm1, // [8] PM1_STS
489  southbridge_smi_gpe0, // [9] GPE0_STS
490  southbridge_smi_gpi, // [10] GPI_STS
491  southbridge_smi_mc, // [11] MCSMI_STS
492  NULL, // [12] DEVMON_STS
493  southbridge_smi_tco, // [13] TCO_STS
494  southbridge_smi_periodic, // [14] PERIODIC_STS
495  NULL, // [15] SERIRQ_SMI_STS
496  NULL, // [16] SMBUS_SMI_STS
497  NULL, // [17] LEGACY_USB2_STS
498  NULL, // [18] INTEL_USB2_STS
499  NULL, // [19] reserved
500  NULL, // [20] PCI_EXP_SMI_STS
501  southbridge_smi_monitor, // [21] MONITOR_STS
502  NULL, // [22] reserved
503  NULL, // [23] reserved
504  NULL, // [24] reserved
505  NULL, // [25] EL_SMI_STS
506  NULL, // [26] SPI_STS
507  NULL, // [27] reserved
508  NULL, // [28] reserved
509  NULL, // [29] reserved
510  NULL, // [30] reserved
511  NULL // [31] reserved
512 };
513 
514 /**
515  * @brief Interrupt handler for SMI#
516  */
518 {
519  int i;
520  u32 smi_sts;
521 
522  /* We need to clear the SMI status registers, or we won't see what's
523  * happening in the following calls.
524  */
525  smi_sts = clear_smi_status();
526 
527  /* Call SMI sub handler for each of the status bits */
528  for (i = 0; i < 31; i++) {
529  if (smi_sts & (1 << i)) {
530  if (southbridge_smi[i]) {
531  southbridge_smi[i]();
532  } else {
534  "SMI_STS[%d] occurred, but no "
535  "handler available.\n", i);
536  }
537  }
538  }
539 }
#define SCI_EN
Definition: pm.h:30
#define MCSMI_EN
Definition: pm.h:41
#define SLP_SMI_EN
Definition: pm.h:45
#define PM1_CNT
Definition: pm.h:27
#define SMI_EN
Definition: pm.h:32
#define EOS
Definition: pm.h:48
#define PERIODIC_EN
Definition: pm.h:39
static void write32(void *addr, uint32_t val)
Definition: mmio.h:40
static uint32_t read32(const void *addr)
Definition: mmio.h:22
uint16_t clear_pm1_status(void)
Definition: pmutil.c:152
void enable_pm1_control(uint32_t mask)
Definition: pmutil.c:105
void disable_smi(uint32_t mask)
Definition: pmutil.c:97
void enable_smi(uint32_t mask)
Definition: pmutil.c:89
uint32_t clear_gpe_status(void)
Definition: pmutil.c:265
void disable_pm1_control(uint32_t mask)
Definition: pmutil.c:113
void disable_all_gpe(void)
Definition: pmutil.c:210
uint32_t clear_tco_status(void)
Definition: pmutil.c:189
uint32_t clear_smi_status(void)
Definition: pmutil.c:84
#define MAINBOARD_POWER_ON
Definition: pm.h:94
uint32_t clear_alt_smi_status(void)
Definition: pmutil.c:236
#define PWRBTN_STS
Definition: southbridge.h:30
#define ELOG_TYPE_ACPI_ENTER
Definition: elog.h:143
#define ELOG_TYPE_POWER_BUTTON
Definition: elog.h:133
#define printk(level,...)
Definition: stdlib.h:16
void io_trap_handler(int smif)
Definition: smihandler.c:58
void __weak southbridge_smi_handler(void)
Definition: smihandler.c:207
void __weak mainboard_smi_sleep(u8 slp_typ)
Definition: smihandler.c:210
int __weak mainboard_smi_apmc(u8 data)
Definition: smihandler.c:209
void __weak mainboard_smi_gpi(u32 gpi_sts)
Definition: smihandler.c:208
void * smm_get_save_state(int cpu)
Definition: smihandler.c:114
u8 inb(u16 port)
void outb(u8 val, u16 port)
u32 inl(u16 port)
uint32_t smmstore_exec(uint8_t command, void *param)
Definition: smi.c:144
@ CONFIG
Definition: dsi_common.h:201
u32 gsmi_exec(u8 command, u32 *param)
Definition: gsmi.c:46
void __noreturn halt(void)
halt the system reliably
Definition: halt.c:6
#define PANEL_UNLOCK_REGS
Definition: i915_reg.h:3755
#define PCH_PP_OFF_DELAYS
Definition: i915_reg.h:3774
#define EDP_BLC_ENABLE
Definition: i915_reg.h:3758
#define PANEL_UNLOCK_MASK
Definition: i915_reg.h:3756
#define PANEL_LIGHT_OFF_DELAY_MASK
Definition: i915_reg.h:3782
#define PCH_PP_CONTROL
Definition: i915_reg.h:3754
@ ACPI_S5
Definition: acpi.h:1385
@ ACPI_S1
Definition: acpi.h:1381
@ ACPI_S4
Definition: acpi.h:1384
@ ACPI_S3
Definition: acpi.h:1383
@ ACPI_S0
Definition: acpi.h:1380
static void wbinvd(void)
Definition: cache.h:15
#define APM_CNT
Definition: smm.h:19
#define APM_CNT_ELOG_GSMI
Definition: smm.h:29
static bool smm_points_to_smram(const void *ptr, const size_t len)
Definition: smm.h:118
#define APM_CNT_ACPI_DISABLE
Definition: smm.h:21
#define APM_CNT_ACPI_ENABLE
Definition: smm.h:22
#define APM_CNT_SMMSTORE
Definition: smm.h:28
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
Definition: pci_ops.h:76
static __always_inline void pci_and_config16(const struct device *dev, u16 reg, u16 andmask)
Definition: pci_ops.h:147
static __always_inline void pci_and_config8(const struct device *dev, u16 reg, u8 andmask)
Definition: pci_ops.h:136
static __always_inline u16 pci_read_config16(const struct device *dev, u16 reg)
Definition: pci_ops.h:52
static __always_inline void pci_or_config8(const struct device *dev, u16 reg, u8 ormask)
Definition: pci_ops.h:169
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
Definition: pci_ops.h:58
static __always_inline u8 pci_read_config8(const struct device *dev, u16 reg)
Definition: pci_ops.h:46
static int elog_gsmi_add_event(u8 event_type)
Definition: elog.h:45
static int elog_gsmi_add_event_byte(u8 event_type, u8 data)
Definition: elog.h:46
#define SLP_EN
Definition: pmc.h:62
#define SLP_TYP_S5
Definition: pmc.h:69
#define SLP_TYP
Definition: pmc.h:64
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
Definition: loglevel.h:142
state
Definition: raminit.c:1787
unsigned int get_uint_option(const char *name, const unsigned int fallback)
Definition: option.c:116
#define PCI_HEADER_TYPE
Definition: pci_def.h:47
#define PCI_PRIMARY_BUS
Definition: pci_def.h:100
#define PCI_HEADER_TYPE_CARDBUS
Definition: pci_def.h:50
#define PCI_COMMAND_MASTER
Definition: pci_def.h:13
#define PCI_BASE_ADDRESS_0
Definition: pci_def.h:63
#define PCI_COMMAND
Definition: pci_def.h:10
#define PCI_HEADER_TYPE_BRIDGE
Definition: pci_def.h:49
#define PCI_VENDOR_ID
Definition: pci_def.h:8
#define PCI_DEV(SEGBUS, DEV, FN)
Definition: pci_type.h:14
u32 pci_devfn_t
Definition: pci_type.h:8
u8 apm_get_apmc(void)
Definition: smi_trigger.c:46
struct global_nvs * gnvs
int southbridge_io_trap_handler(int smif)
Definition: smihandler.c:131
#define PCH_DEV_LPC
Definition: pci_devs.h:224
#define SA_DEV_IGD
Definition: pci_devs.h:33
#define PCH_DEV_XHCI
Definition: pci_devs.h:128
const smi_handler_t southbridge_smi[SMI_STS_BITS]
Definition: smihandler.c:17
void southbridge_smi_set_eos(void)
Definition: smihandler.c:41
void(* smi_handler_t)(void)
Definition: smihandler.c:361
#define BIOS_CNTL
Definition: lpc.h:20
#define GEN_PMCON_3
Definition: lpc.h:63
void usb_xhci_sleep_prepare(pci_devfn_t dev, u8 slp_typ)
static void southbridge_smi_pm1(void)
Definition: smihandler.c:337
static void southbridge_smi_store(void)
Definition: smihandler.c:292
static void busmaster_disable_on_bus(int bus)
Definition: smihandler.c:51
static void southbridge_smi_apmc(void)
Definition: smihandler.c:312
static void southbridge_smi_periodic(void)
Definition: smihandler.c:408
static void southbridge_smi_gpe0(void)
Definition: smihandler.c:352
#define IOTRAP(x)
static em64t101_smm_state_save_area_t * smi_apmc_find_state_save(u8 cmd)
Definition: smihandler.c:240
static void southbridge_smi_gpi(void)
Definition: smihandler.c:357
static void southbridge_smi_monitor(void)
Definition: smihandler.c:419
static void southbridge_smi_gsmi(void)
Definition: smihandler.c:271
static void southbridge_smi_tco(void)
Definition: smihandler.c:376
static void southbridge_smi_mc(void)
Definition: smihandler.c:365
static void backlight_off(void)
Definition: smihandler.c:89
static void southbridge_smi_sleep(void)
Definition: smihandler.c:143
static int power_on_after_fail(void)
Definition: smihandler.c:128
static const int mask[4]
Definition: gpio.c:308
#define RCBA32(x)
Definition: rcba.h:14
u16 get_pmbase(void)
Definition: smihandler.c:20
u16 pmbase
Definition: smihandler.c:25
#define NULL
Definition: stddef.h:19
unsigned int uint32_t
Definition: stdint.h:14
uint32_t u32
Definition: stdint.h:51
unsigned long uintptr_t
Definition: stdint.h:21
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
Definition: device.h:76
u8 smif
Definition: nvs.h:11
u8 val
Definition: sys.c:300
void udelay(uint32_t us)
Definition: udelay.c:15
typedef void(X86APIP X86EMU_intrFuncs)(int num)