coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lpc.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <device/pci.h>
6 #include <device/pci_ids.h>
7 #include <option.h>
8 #include <pc80/mc146818rtc.h>
9 #include <pc80/isa-dma.h>
10 #include <pc80/i8259.h>
11 #include <arch/io.h>
12 #include <device/pci_ops.h>
13 #include <arch/ioapic.h>
14 #include <acpi/acpi.h>
15 #include <cpu/x86/smm.h>
16 #include <acpi/acpigen.h>
17 #include <arch/smp/mpspec.h>
23 
24 #include "chip.h"
25 #include "i82801gx.h"
26 
27 #define NMI_OFF 0
28 
29 /**
30  * Set miscellaneous static southbridge features.
31  *
32  * @param dev PCI device with I/O APIC control registers
33  */
34 static void i82801gx_enable_ioapic(struct device *dev)
35 {
37 }
38 
39 static void i82801gx_enable_serial_irqs(struct device *dev)
40 {
41  /* Set packet length and toggle silent mode bit for one frame. */
42  pci_write_config8(dev, SERIRQ_CNTL, (1 << 7) | (1 << 6) | ((21 - 17) << 2) | (0 << 0));
43 }
44 
45 /* PIRQ[n]_ROUT[3:0] - PIRQ Routing Control
46  * 0x00 - 0000 = Reserved
47  * 0x01 - 0001 = Reserved
48  * 0x02 - 0010 = Reserved
49  * 0x03 - 0011 = IRQ3
50  * 0x04 - 0100 = IRQ4
51  * 0x05 - 0101 = IRQ5
52  * 0x06 - 0110 = IRQ6
53  * 0x07 - 0111 = IRQ7
54  * 0x08 - 1000 = Reserved
55  * 0x09 - 1001 = IRQ9
56  * 0x0A - 1010 = IRQ10
57  * 0x0B - 1011 = IRQ11
58  * 0x0C - 1100 = IRQ12
59  * 0x0D - 1101 = Reserved
60  * 0x0E - 1110 = IRQ14
61  * 0x0F - 1111 = IRQ15
62  * PIRQ[n]_ROUT[7] - PIRQ Routing Control
63  * 0x80 - The PIRQ is not routed.
64  */
65 
66 static void i82801gx_pirq_init(struct device *dev)
67 {
68  struct device *irq_dev;
69  /* Get the chip configuration */
71 
72  pci_write_config8(dev, PIRQA_ROUT, config->pirqa_routing);
73  pci_write_config8(dev, PIRQB_ROUT, config->pirqb_routing);
74  pci_write_config8(dev, PIRQC_ROUT, config->pirqc_routing);
75  pci_write_config8(dev, PIRQD_ROUT, config->pirqd_routing);
76 
77  pci_write_config8(dev, PIRQE_ROUT, config->pirqe_routing);
78  pci_write_config8(dev, PIRQF_ROUT, config->pirqf_routing);
79  pci_write_config8(dev, PIRQG_ROUT, config->pirqg_routing);
80  pci_write_config8(dev, PIRQH_ROUT, config->pirqh_routing);
81 
82  /* Eric Biederman once said we should let the OS do this.
83  * I am not so sure anymore he was right.
84  */
85 
86  for (irq_dev = all_devices; irq_dev; irq_dev = irq_dev->next) {
87  u8 int_pin = 0, int_line = 0;
88 
89  if (!irq_dev->enabled || irq_dev->path.type != DEVICE_PATH_PCI)
90  continue;
91 
92  int_pin = pci_read_config8(irq_dev, PCI_INTERRUPT_PIN);
93 
94  switch (int_pin) {
95  case 1:
96  /* INTA# */ int_line = config->pirqa_routing; break;
97  case 2:
98  /* INTB# */ int_line = config->pirqb_routing; break;
99  case 3:
100  /* INTC# */ int_line = config->pirqc_routing; break;
101  case 4:
102  /* INTD# */ int_line = config->pirqd_routing; break;
103  }
104 
105  if (!int_line)
106  continue;
107 
108  pci_write_config8(irq_dev, PCI_INTERRUPT_LINE, int_line);
109  }
110 }
111 
112 static void i82801gx_gpi_routing(struct device *dev)
113 {
114  /* Get the chip configuration */
116  u32 reg32 = 0;
117 
118  /* An array would be much nicer here, or some other method of doing this. */
119  reg32 |= (config->gpi0_routing & 0x03) << 0;
120  reg32 |= (config->gpi1_routing & 0x03) << 2;
121  reg32 |= (config->gpi2_routing & 0x03) << 4;
122  reg32 |= (config->gpi3_routing & 0x03) << 6;
123  reg32 |= (config->gpi4_routing & 0x03) << 8;
124  reg32 |= (config->gpi5_routing & 0x03) << 10;
125  reg32 |= (config->gpi6_routing & 0x03) << 12;
126  reg32 |= (config->gpi7_routing & 0x03) << 14;
127  reg32 |= (config->gpi8_routing & 0x03) << 16;
128  reg32 |= (config->gpi9_routing & 0x03) << 18;
129  reg32 |= (config->gpi10_routing & 0x03) << 20;
130  reg32 |= (config->gpi11_routing & 0x03) << 22;
131  reg32 |= (config->gpi12_routing & 0x03) << 24;
132  reg32 |= (config->gpi13_routing & 0x03) << 26;
133  reg32 |= (config->gpi14_routing & 0x03) << 28;
134  reg32 |= (config->gpi15_routing & 0x03) << 30;
135 
136  pci_write_config32(dev, GPIO_ROUT, reg32);
137 }
138 
139 static void i82801gx_power_options(struct device *dev)
140 {
141  u8 reg8;
142  u16 reg16;
143  u32 reg32;
144  const char *state;
145  /* Get the chip configuration */
147 
148  /* Which state do we want to goto after g3 (power restored)?
149  * 0 == S0 Full On
150  * 1 == S5 Soft Off
151  *
152  * If the option is not existent (Laptops), use MAINBOARD_POWER_ON.
153  */
154  const unsigned int pwr_on = get_uint_option("power_on_after_fail", MAINBOARD_POWER_ON);
155 
156  reg8 = pci_read_config8(dev, GEN_PMCON_3);
157  reg8 &= 0xfe;
158  switch (pwr_on) {
159  case MAINBOARD_POWER_OFF:
160  reg8 |= 1;
161  state = "off";
162  break;
163  case MAINBOARD_POWER_ON:
164  reg8 &= ~1;
165  state = "on";
166  break;
168  reg8 &= ~1;
169  state = "state keep";
170  break;
171  default:
172  state = "undefined";
173  }
174 
175  reg8 |= (3 << 4); /* avoid #S4 assertions */
176  reg8 &= ~(1 << 3); /* minimum assertion is 1 to 2 RTCCLK */
177 
178  pci_write_config8(dev, GEN_PMCON_3, reg8);
179  printk(BIOS_INFO, "Set power %s after power failure.\n", state);
180 
181  /* Set up NMI on errors. */
182  reg8 = inb(0x61);
183  reg8 &= 0x0f; /* Higher Nibble must be 0 */
184  reg8 &= ~(1 << 3); /* IOCHK# NMI Enable */
185  // reg8 &= ~(1 << 2); /* PCI SERR# Enable */
186  reg8 |= (1 << 2); /* PCI SERR# Disable for now */
187  outb(reg8, 0x61);
188 
189  reg8 = inb(0x70);
190  const unsigned int nmi_option = get_uint_option("nmi", NMI_OFF);
191  if (nmi_option) {
192  printk(BIOS_INFO, "NMI sources enabled.\n");
193  reg8 &= ~(1 << 7); /* Set NMI. */
194  } else {
195  printk(BIOS_INFO, "NMI sources disabled.\n");
196  reg8 |= (1 << 7); /* Can't mask NMI from PCI-E and NMI_NOW */
197  }
198  outb(reg8, 0x70);
199 
200  /* Enable CPU_SLP# and Intel Speedstep, set SMI# rate down */
201  reg16 = pci_read_config16(dev, GEN_PMCON_1);
202  reg16 &= ~(3 << 0); // SMI# rate 1 minute
203  reg16 |= (1 << 2); // CLKRUN_EN - Mobile/Ultra only
204  reg16 |= (1 << 3); // Speedstep Enable - Mobile/Ultra only
205  reg16 |= (1 << 5); // CPUSLP_EN Desktop only
206 
207  if (config->c4onc3_enable)
208  reg16 |= (1 << 7);
209 
210  // another laptop wants this?
211  // reg16 &= ~(1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
212  reg16 |= (1 << 10); // BIOS_PCI_EXP_EN - Desktop/Mobile only
213  if (CONFIG(DEBUG_PERIODIC_SMI))
214  reg16 |= (3 << 0); // Periodic SMI every 8s
215  pci_write_config16(dev, GEN_PMCON_1, reg16);
216 
217  // Set the board's GPI routing.
219 
220  write_pmbase32(GPE0_EN, config->gpe0_en);
221  write_pmbase16(ALT_GP_SMI_EN, config->alt_gp_smi_en);
222 
223  /* Set up power management block and determine sleep mode */
224  reg32 = read_pmbase32(PM1_CNT);
225 
226  reg32 &= ~(7 << 10); // SLP_TYP
227  reg32 |= (1 << 1); // enable C3->C0 transition on bus master
228  reg32 |= (1 << 0); // SCI_EN
229  write_pmbase32(PM1_CNT, reg32);
230 }
231 
232 static void i82801gx_configure_cstates(struct device *dev)
233 {
234  // Enable Popup & Popdown
235  pci_or_config8(dev, 0xa9, (1 << 4) | (1 << 3) | (1 << 2));
236 
237  // Set Deeper Sleep configuration to recommended values
238  // Deeper Sleep to Stop CPU: 34-40us
239  // Deeper Sleep to Sleep: 15us
240  pci_update_config8(dev, 0xaa, 0xf0, (2 << 2) | (2 << 0));
241 }
242 
243 static void i82801gx_rtc_init(struct device *dev)
244 {
245  u8 reg8;
246  int rtc_failed;
247 
248  reg8 = pci_read_config8(dev, GEN_PMCON_3);
249  rtc_failed = reg8 & RTC_BATTERY_DEAD;
250  if (rtc_failed) {
251  reg8 &= ~RTC_BATTERY_DEAD;
252  pci_write_config8(dev, GEN_PMCON_3, reg8);
253  }
254  printk(BIOS_DEBUG, "rtc_failed = 0x%x\n", rtc_failed);
255 
257 }
258 
259 static void enable_clock_gating(void)
260 {
261  u32 reg32;
262 
263  /* Enable Clock Gating for most devices */
264  reg32 = RCBA32(CG);
265  reg32 |= (1 << 31); // LPC clock gating
266  reg32 |= (1 << 30); // PATA clock gating
267  // SATA clock gating
268  reg32 |= (1 << 27) | (1 << 26) | (1 << 25) | (1 << 24);
269  reg32 |= (1 << 23); // AC97 clock gating
270  reg32 |= (1 << 19); // USB EHCI clock gating
271  reg32 |= (1 << 3) | (1 << 1); // DMI clock gating
272  reg32 |= (1 << 2); // PCIe clock gating;
273  reg32 &= ~(1 << 20); // No static clock gating for USB
274  reg32 &= ~((1 << 29) | (1 << 28)); // Disable UHCI clock gating
275  RCBA32(CG) = reg32;
276 }
277 
278 static void i82801gx_set_acpi_mode(struct device *dev)
279 {
280  if (!acpi_is_wakeup_s3()) {
282  } else {
284  }
285 }
286 
287 #define SPIBASE 0x3020
288 static void i82801gx_spi_init(void)
289 {
290  u16 spicontrol;
291 
292  spicontrol = RCBA16(SPIBASE + 2);
293  spicontrol &= ~(1 << 0); // SPI Access Request
294  RCBA16(SPIBASE + 2) = spicontrol;
295 }
296 
297 static void i82801gx_fixups(struct device *dev)
298 {
299  /* This needs to happen after PCI enumeration */
300  RCBA32(0x1d40) |= 1;
301 
302  /* USB Transient Disconnect Detect:
303  * Prevent a SE0 condition on the USB ports from being
304  * interpreted by the UHCI controller as a disconnect
305  */
306  pci_write_config8(dev, 0xad, 0x3);
307 }
308 
309 static void lpc_init(struct device *dev)
310 {
311  printk(BIOS_DEBUG, "i82801gx: %s\n", __func__);
312 
313  /* IO APIC initialization. */
315 
317 
318  /* Setup the PIRQ. */
319  i82801gx_pirq_init(dev);
320 
321  /* Setup power options. */
323 
324  /* Configure Cx state registers */
326 
327  /* Initialize the real time clock. */
328  i82801gx_rtc_init(dev);
329 
330  /* Initialize ISA DMA. */
331  isa_dma_init();
332 
333  /* Initialize the High Precision Event Timers, if present. */
334  enable_hpet();
335 
336  /* Initialize Clock Gating */
338 
339  setup_i8259();
340 
341  /* The OS should do this? */
342  /* Interrupt 9 should be level triggered (SCI) */
344 
346 
348 
349  i82801gx_fixups(dev);
350 }
351 
352 unsigned long acpi_fill_madt(unsigned long current)
353 {
354  /* Local APICs */
355  current = acpi_create_madt_lapics(current);
356 
357  /* IOAPIC */
358  current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 2, IO_APIC_ADDR, 0);
359 
360  /* LAPIC_NMI */
362  current, 0,
364  MP_IRQ_TRIGGER_EDGE, 0x01);
366  current, 1, MP_IRQ_POLARITY_HIGH |
367  MP_IRQ_TRIGGER_EDGE, 0x01);
368 
369  /* INT_SRC_OVR */
371  current, 0, 0, 2, MP_IRQ_POLARITY_HIGH | MP_IRQ_TRIGGER_EDGE);
373  current, 0, 9, 9, MP_IRQ_POLARITY_HIGH | MP_IRQ_TRIGGER_LEVEL);
374 
375  return current;
376 }
377 
378 static void i82801gx_lpc_read_resources(struct device *dev)
379 {
380  struct resource *res;
381  u8 io_index = 0;
382  int i;
383 
384  /* Get the normal PCI resources of this device. */
386 
387  /* Add an extra subtractive resource for both memory and I/O. */
388  res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
389  res->base = 0;
390  res->size = 0x1000;
393 
394  res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
395  res->base = 0xff800000;
396  res->size = 0x00800000; /* 8 MB for flash */
399 
400  res = new_resource(dev, 3); /* IOAPIC */
401  res->base = IO_APIC_ADDR;
402  res->size = 0x00001000;
404 
405  /* Set IO decode ranges if required.*/
406  for (i = 0; i < 4; i++) {
407  u32 gen_dec;
408  gen_dec = pci_read_config32(dev, 0x84 + 4 * i);
409 
410  if ((gen_dec & 0xFFFC) > 0x1000) {
411  res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
412  res->base = gen_dec & 0xFFFC;
413  res->size = (gen_dec >> 16) & 0xFC;
416  }
417  }
418 }
419 
420 #define SPIBAR16(x) RCBA16(0x3020 + x)
421 #define SPIBAR32(x) RCBA32(0x3020 + x)
422 
423 static void lpc_final(struct device *dev)
424 {
425  u16 tco1_cnt;
426 
427  if (!CONFIG(INTEL_CHIPSET_LOCKDOWN))
428  return;
429 
430  if (CONFIG(BOOT_DEVICE_SPI_FLASH))
432 
433  /* Lock SPIBAR */
434  SPIBAR16(0) = SPIBAR16(0) | (1 << 15);
435 
436  /* BIOS Interface Lockdown */
437  RCBA32(0x3410) |= 1 << 0;
438 
439  /* Global SMI Lock */
440  pci_or_config16(dev, GEN_PMCON_1, 1 << 4);
441 
442  /* TCO_Lock */
443  tco1_cnt = inw(DEFAULT_PMBASE + 0x60 + TCO1_CNT);
444  tco1_cnt |= (1 << 12); /* TCO lock */
445  outw(tco1_cnt, DEFAULT_PMBASE + 0x60 + TCO1_CNT);
446 
447  /* Indicate finalize step with post code */
448  outb(POST_OS_BOOT, 0x80);
449 }
450 
451 static const char *lpc_acpi_name(const struct device *dev)
452 {
453  return "LPCB";
454 }
455 
456 static void southbridge_fill_ssdt(const struct device *device)
457 {
459 }
460 
461 static struct device_operations device_ops = {
463  .set_resources = pci_dev_set_resources,
464  .enable_resources = pci_dev_enable_resources,
465  .write_acpi_tables = acpi_write_hpet,
466  .acpi_fill_ssdt = southbridge_fill_ssdt,
467  .acpi_name = lpc_acpi_name,
468  .init = lpc_init,
469  .scan_bus = scan_static_bus,
470  .enable = i82801gx_enable,
471  .ops_pci = &pci_dev_ops_pci,
472  .final = lpc_final,
473 };
474 
475 static const unsigned short pci_device_ids[] = {
476  0x27b0, /* 82801GH (ICH7 DH) */
477  0x27b8, /* 82801GB/GR (ICH7/ICH7R) */
478  0x27b9, /* 82801GBM/GU (ICH7-M/ICH7-U) */
479  0x27bc, /* 82NM10 (NM10) */
480  0x27bd, /* 82801GHM (ICH7-M DH) */
481  0
482 };
483 
484 static const struct pci_driver ich7_lpc __pci_driver = {
485  .ops = &device_ops,
486  .vendor = PCI_VID_INTEL,
487  .devices = pci_device_ids,
488 };
unsigned long acpi_create_madt_lapics(unsigned long current)
Definition: acpi.c:144
unsigned long acpi_write_hpet(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
Definition: acpi.c:1141
int acpi_create_madt_irqoverride(acpi_madt_irqoverride_t *irqoverride, u8 bus, u8 source, u32 gsirq, u16 flags)
Definition: acpi.c:187
int acpi_create_madt_ioapic(acpi_madt_ioapic_t *ioapic, u8 id, u32 addr, u32 gsi_base)
Definition: acpi.c:174
int acpi_create_madt_lapic_nmi(acpi_madt_lapic_nmi_t *lapic_nmi, u8 cpu, u16 flags, u8 lint)
Definition: acpi.c:200
#define GPE0_EN(x)
Definition: pm.h:99
#define PM1_CNT
Definition: pm.h:27
static int acpi_is_wakeup_s3(void)
Definition: acpi.h:9
#define VIO_APIC_VADDR
Definition: ioapic.h:7
#define IO_APIC_ADDR
Definition: ioapic.h:6
void setup_ioapic(void *ioapic_base, u8 ioapic_id)
Definition: ioapic.c:160
#define GPIO_ROUT
Definition: pm.h:96
#define MAINBOARD_POWER_ON
Definition: pm.h:94
#define MAINBOARD_POWER_OFF
Definition: pm.h:93
#define MAINBOARD_POWER_KEEP
Definition: pm.h:95
#define printk(level,...)
Definition: stdlib.h:16
u8 inb(u16 port)
void outb(u8 val, u16 port)
u16 inw(u16 port)
void outw(u16 val, u16 port)
DEVTREE_CONST struct device *DEVTREE_CONST all_devices
Linked list of ALL devices.
Definition: device_const.c:13
struct resource * new_resource(struct device *dev, unsigned int index)
See if a resource structure already exists for a given index and if not allocate one.
Definition: device_util.c:346
@ CONFIG
Definition: dsi_common.h:201
void setup_i8259(void)
Definition: i8259.c:46
void i8259_configure_irq_trigger(int int_num, int is_level_triggered)
Configure IRQ triggering in the i8259 compatible Interrupt Controller.
Definition: i8259.c:99
void i82801gx_enable(struct device *dev)
Definition: i82801gx.c:54
#define APM_CNT_ACPI_DISABLE
Definition: smm.h:21
#define APM_CNT_ACPI_ENABLE
Definition: smm.h:22
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_update_config8(const struct device *dev, u16 reg, u8 mask, u8 or)
Definition: pci_ops.h:88
static __always_inline void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
Definition: pci_ops.h:180
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 __always_inline void pci_write_config16(const struct device *dev, u16 reg, u16 val)
Definition: pci_ops.h:70
static __always_inline void pci_write_config8(const struct device *dev, u16 reg, u8 val)
Definition: pci_ops.h:64
#define RTC_BATTERY_DEAD
Definition: pmc.h:61
#define DEFAULT_PMBASE
Definition: iomap.h:14
void isa_dma_init(void)
Definition: isa-dma.c:35
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
enum board_config config
Definition: memory.c:448
void cmos_init(bool invalid)
Definition: mc146818rtc.c:156
#define MP_IRQ_POLARITY_HIGH
Definition: mpspec.h:124
#define MP_IRQ_TRIGGER_EDGE
Definition: mpspec.h:128
#define MP_IRQ_TRIGGER_LEVEL
Definition: mpspec.h:129
state
Definition: raminit.c:1787
unsigned int get_uint_option(const char *name, const unsigned int fallback)
Definition: option.c:116
@ DEVICE_PATH_PCI
Definition: path.h:9
#define PCI_INTERRUPT_PIN
Definition: pci_def.h:95
#define PCI_INTERRUPT_LINE
Definition: pci_def.h:94
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
void write_pmbase16(const u8 addr, const u16 val)
Definition: pmbase.c:43
u32 read_pmbase32(const u8 addr)
Definition: pmbase.c:57
void write_pmbase32(const u8 addr, const u32 val)
Definition: pmbase.c:36
#define POST_OS_BOOT
Final code before OS boots.
Definition: post_codes.h:414
void intel_acpi_gen_def_acpi_pirq(const struct device *lpc)
Definition: rcba_pirq.c:46
#define IORESOURCE_MEM
Definition: resource.h:10
#define IORESOURCE_SUBTRACTIVE
Definition: resource.h:24
#define IORESOURCE_ASSIGNED
Definition: resource.h:34
#define IORESOURCE_IO
Definition: resource.h:9
#define IOINDEX_SUBTRACTIVE(IDX, LINK)
Definition: resource.h:57
#define IORESOURCE_FIXED
Definition: resource.h:36
void scan_static_bus(struct device *bus)
Definition: root_device.c:89
int apm_control(u8 cmd)
Definition: smi_trigger.c:31
#define SERIRQ_CNTL
Definition: espi.h:21
static int rtc_failed(uint32_t gen_pmcon_b)
Definition: pmutil.c:169
#define TCO1_CNT
Definition: smbus.h:12
#define PIRQE_ROUT
Definition: lpc.h:30
#define PIRQG_ROUT
Definition: lpc.h:32
#define GEN_PMCON_3
Definition: lpc.h:63
#define PIRQB_ROUT
Definition: lpc.h:27
#define GEN_PMCON_1
Definition: lpc.h:56
#define PIRQD_ROUT
Definition: lpc.h:29
#define PIRQC_ROUT
Definition: lpc.h:28
#define PIRQH_ROUT
Definition: lpc.h:33
#define PIRQA_ROUT
Definition: lpc.h:26
#define PIRQF_ROUT
Definition: lpc.h:31
#define CG
Definition: rcba.h:129
#define ALT_GP_SMI_EN
Definition: pch.h:461
#define RCBA16(x)
Definition: rcba.h:13
#define RCBA32(x)
Definition: rcba.h:14
void spi_finalize_ops(void)
Definition: spi.c:1039
static void lpc_final(struct device *dev)
Definition: lpc.c:423
static const char * lpc_acpi_name(const struct device *dev)
Definition: lpc.c:451
static void enable_clock_gating(void)
Definition: lpc.c:259
#define SPIBASE
Definition: lpc.c:287
static struct device_operations device_ops
Definition: lpc.c:461
static void i82801gx_configure_cstates(struct device *dev)
Definition: lpc.c:232
static void i82801gx_gpi_routing(struct device *dev)
Definition: lpc.c:112
static void southbridge_fill_ssdt(const struct device *device)
Definition: lpc.c:456
static void i82801gx_lpc_read_resources(struct device *dev)
Definition: lpc.c:378
static void i82801gx_enable_ioapic(struct device *dev)
Set miscellaneous static southbridge features.
Definition: lpc.c:34
static void lpc_init(struct device *dev)
Definition: lpc.c:309
static const unsigned short pci_device_ids[]
Definition: lpc.c:475
static void i82801gx_fixups(struct device *dev)
Definition: lpc.c:297
unsigned long acpi_fill_madt(unsigned long current)
Definition: lpc.c:352
static void i82801gx_rtc_init(struct device *dev)
Definition: lpc.c:243
static void i82801gx_power_options(struct device *dev)
Definition: lpc.c:139
static const struct pci_driver ich7_lpc __pci_driver
Definition: lpc.c:484
static void i82801gx_spi_init(void)
Definition: lpc.c:288
#define NMI_OFF
Definition: lpc.c:27
static void i82801gx_enable_serial_irqs(struct device *dev)
Definition: lpc.c:39
#define SPIBAR16(x)
Definition: lpc.c:420
static void i82801gx_pirq_init(struct device *dev)
Definition: lpc.c:66
static void i82801gx_set_acpi_mode(struct device *dev)
Definition: lpc.c:278
static void enable_hpet(struct device *const dev)
Definition: lpc.c:60
uint32_t u32
Definition: stdint.h:51
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
void(* read_resources)(struct device *dev)
Definition: device.h:39
enum device_path_type type
Definition: path.h:114
Definition: device.h:107
struct device_path path
Definition: device.h:115
DEVTREE_CONST struct device * next
Definition: device.h:113
DEVTREE_CONST void * chip_info
Definition: device.h:164
unsigned int enabled
Definition: device.h:122
unsigned long flags
Definition: resource.h:49
resource_t base
Definition: resource.h:45
resource_t size
Definition: resource.h:46