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 <device/mmio.h>
8 #include <device/pci_ops.h>
9 #include <arch/ioapic.h>
10 #include <acpi/acpi.h>
11 #include <cpu/x86/smm.h>
12 #include <bootstate.h>
13 
14 #include <soc/lpc.h>
15 #include <soc/pci_devs.h>
16 #include <soc/ramstage.h>
17 #include <soc/iomap.h>
18 #include <soc/pcr.h>
19 #include <soc/p2sb.h>
20 #include <soc/acpi.h>
21 
22 #include "chip.h"
23 
24 /* PCH I/O APIC redirection entries */
25 #define PCH_REDIR_ETR 120
26 
27 /**
28  * Set miscellaneous static southbridge features.
29  *
30  * @param dev PCI device with I/O APIC control registers
31  */
32 static void pch_enable_ioapic(struct device *dev)
33 {
34  /* affirm full set of redirection table entries ("write once") */
36 
38 }
39 
40 /* interrupt router lookup for internal devices */
41 struct dnv_ir_lut {
42  /* (dev << 3) | fn */
44  u8 ir;
45 };
46 
47 #define DEVFN(dev, fn) ((dev << 3) | (fn))
48 
49 static const struct dnv_ir_lut dnv_ir_lut[] = {
50  {.devfn = DEVFN(0x05, 0), .ir = 3}, /* RCEC */
51  {.devfn = DEVFN(0x06, 0), .ir = 4}, /* Virtual RP to QAT */
52  {.devfn = DEVFN(0x09, 0), .ir = 7}, /* PCIe RP0 */
53  {.devfn = DEVFN(0x0a, 0), .ir = 7}, /* PCIe RP1 */
54  {.devfn = DEVFN(0x0b, 0), .ir = 7}, /* PCIe RP2 */
55  {.devfn = DEVFN(0x0c, 0), .ir = 7}, /* PCIe RP3 */
56  {.devfn = DEVFN(0x0e, 0), .ir = 8}, /* PCIe RP4 */
57  {.devfn = DEVFN(0x0f, 0), .ir = 8}, /* PCIe RP5 */
58  {.devfn = DEVFN(0x10, 0), .ir = 8}, /* PCIe RP6 */
59  {.devfn = DEVFN(0x11, 0), .ir = 8}, /* PCIe RP7 */
60  {.devfn = DEVFN(0x12, 0), .ir = 10}, /* SMBus - Host */
61  {.devfn = DEVFN(0x13, 0), .ir = 6}, /* AHCI0 */
62  {.devfn = DEVFN(0x14, 0), .ir = 11}, /* AHCI1 */
63  {.devfn = DEVFN(0x15, 0), .ir = 9}, /* USB */
64  {.devfn = DEVFN(0x16, 0), .ir = 1}, /* Virtual RP to LAN0 */
65  {.devfn = DEVFN(0x17, 0), .ir = 2}, /* Virtual RP to LAN1 */
66  {.devfn = DEVFN(0x18, 0), .ir = 5}, /* ME HECI1 */
67  {.devfn = DEVFN(0x18, 1), .ir = 5}, /* ME HECI1 */
68  {.devfn = DEVFN(0x18, 2), .ir = 5}, /* ME PTIO-IDER */
69  {.devfn = DEVFN(0x18, 3), .ir = 5}, /* ME PTIO-KT */
70  {.devfn = DEVFN(0x18, 4), .ir = 5}, /* ME HECI3 */
71  {.devfn = DEVFN(0x1a, 0), .ir = 10}, /* HSUART0 */
72  {.devfn = DEVFN(0x1a, 1), .ir = 10}, /* HSUART1 */
73  {.devfn = DEVFN(0x1a, 2), .ir = 10}, /* HSUART2 */
74  {.devfn = DEVFN(0x1b, 0), .ir = 12}, /* IE HECI1 */
75  {.devfn = DEVFN(0x1b, 1), .ir = 12}, /* IE HECI1 */
76  {.devfn = DEVFN(0x1b, 2), .ir = 12}, /* IE PTIO-IDER */
77  {.devfn = DEVFN(0x1b, 3), .ir = 12}, /* IE PTIO-KT */
78  {.devfn = DEVFN(0x1b, 4), .ir = 12}, /* IE HECI3 */
79  {.devfn = DEVFN(0x1c, 0), .ir = 12}, /* SDHCI */
80  {.devfn = DEVFN(0x1f, 0), .ir = 0}, /* LPC */
81  {.devfn = DEVFN(0x1f, 1), .ir = 0}, /* PS2B */
82  {.devfn = DEVFN(0x1f, 4), .ir = 0}, /* SMBus - Legacy */
83  {.devfn = DEVFN(0x1f, 7), .ir = 0}, /* Trace Hub */
84 };
85 
86 /*
87  * Only 6 of the 8 root ports have swizzling, return '1' if this bdf is one of
88  * them, '0' otherwise
89  */
91 {
92  switch (bdf) {
93  case DEVFN(10, 0):
94  case DEVFN(11, 0):
95  case DEVFN(12, 0):
96  case DEVFN(15, 0):
97  case DEVFN(16, 0):
98  case DEVFN(17, 0):
99  return 1;
100  }
101 
102  return 0;
103 }
104 
105 /*
106  * Figure out which upstream interrupt pin a downstream device gets swizzled to
107  *
108  * config - pointer to chip_info containing routing info
109  * devfn - device/function of root port to check swizzling for
110  * pin - interrupt pin 1-4 = A-D
111  *
112  * Return new pin mapping, 0 if invalid pin
113  */
115 {
116  if (pin < 1 || pin > 4)
117  return 0;
118 
119  devfn >>= 3;
120  if (devfn < 13)
121  devfn -= 9;
122  else
123  devfn -= 14;
124 
125  return ((pin - 1 + devfn) % 4) + 1;
126 }
127 
128 /*
129  * Figure out which upstream interrupt pin a downstream device gets swizzled to
130  *
131  * config - pointer to chip_info containing routing info
132  * devfn - device/function of root port to check swizzling for
133  * pin - interrupt pin 1-4 = A-D
134  *
135  * Return new pin mapping, 0 if invalid pin
136  */
137 static int dnv_get_ir(config_t *config, u8 devfn, u8 pin)
138 {
139  int i = 0;
140  int line = 0xff;
141  u16 ir = 0xffff;
142 
143  /* The only valid pin values are 1-4 for A-D */
144  if (pin < 1 || pin > 4) {
145  printk(BIOS_WARNING, "%s: pin %d is invalid\n", __func__, pin);
146  goto dnv_get_ir_done;
147  }
148 
149  for (i = 0; i < ARRAY_SIZE(dnv_ir_lut); i++) {
150  if (dnv_ir_lut[i].devfn == devfn)
151  break;
152  }
153 
154  if (i == ARRAY_SIZE(dnv_ir_lut)) {
155  printk(BIOS_WARNING, "%s: no entry\n", __func__);
156  goto dnv_get_ir_done;
157  }
158 
159  switch (dnv_ir_lut[i].ir) {
160  case 0:
161  ir = config->ir00_routing;
162  break;
163  case 1:
164  ir = config->ir01_routing;
165  break;
166  case 2:
167  ir = config->ir02_routing;
168  break;
169  case 3:
170  ir = config->ir03_routing;
171  break;
172  case 4:
173  ir = config->ir04_routing;
174  break;
175  case 5:
176  ir = config->ir05_routing;
177  break;
178  case 6:
179  ir = config->ir06_routing;
180  break;
181  case 7:
182  ir = config->ir07_routing;
183  break;
184  case 8:
185  ir = config->ir08_routing;
186  break;
187  case 9:
188  ir = config->ir09_routing;
189  break;
190  case 10:
191  ir = config->ir10_routing;
192  break;
193  case 11:
194  ir = config->ir11_routing;
195  break;
196  case 12:
197  ir = config->ir12_routing;
198  break;
199  default:
200  printk(BIOS_ERR, "%s: invalid ir %d for entry %d\n", __func__, dnv_ir_lut[i].ir,
201  i);
202  goto dnv_get_ir_done;
203  }
204 
205  ir >>= (pin - 1) * 4;
206  ir &= 0xf;
207  switch (ir) {
208  case 0:
209  line = config->pirqa_routing;
210  break;
211  case 1:
212  line = config->pirqb_routing;
213  break;
214  case 2:
215  line = config->pirqc_routing;
216  break;
217  case 3:
218  line = config->pirqd_routing;
219  break;
220  case 4:
221  line = config->pirqe_routing;
222  break;
223  case 5:
224  line = config->pirqf_routing;
225  break;
226  case 6:
227  line = config->pirqg_routing;
228  break;
229  case 7:
230  line = config->pirqh_routing;
231  break;
232  default:
233  printk(BIOS_ERR, "%s: invalid ir pirq %d for entry %d\n", __func__, ir, i);
234  break;
235  }
236 
237 dnv_get_ir_done:
238  return line;
239 }
240 
241 /*
242  * PCI devices have the INT_LINE (0x3C) and INT_PIN (0x3D) registers which
243  * report interrupt routing information to operating systems and drivers. The
244  * INT_PIN register is generally read only and reports which interrupt pin
245  * A - D it uses. The INT_LINE register is configurable and reports which IRQ
246  * (generally the PIC IRQs 1 - 15) it will use. This needs to take interrupt
247  * pin swizzling on devices that are downstream on a PCI bridge into account.
248  */
249 static u8 dnv_get_int_line(struct device *irq_dev)
250 {
251  config_t *config;
252  struct device *targ_dev = NULL;
253  uint16_t parent_bdf = 0;
254  int8_t original_int_pin = 0, new_int_pin = 0, swiz_int_pin = 0;
255  uint8_t int_line = 0xff;
256 
257  if (irq_dev->path.type != DEVICE_PATH_PCI || !irq_dev->enabled) {
258  printk(BIOS_ERR, "%s for non pci device?\n", __func__);
259  goto dnv_get_int_line_done;
260  }
261 
262  /*
263  * Get the INT_PIN swizzled up to the root port if necessary
264  * using the existing coreboot pci_device code
265  */
266  original_int_pin = pci_read_config8(irq_dev, PCI_INTERRUPT_PIN);
267  new_int_pin = get_pci_irq_pins(irq_dev, &targ_dev);
268  if (targ_dev == NULL || new_int_pin < 1)
269  goto dnv_get_int_line_done;
270 
271  printk(BIOS_DEBUG, "%s: irq_dev %s, targ_dev %s:\n", __func__, dev_path(irq_dev),
272  dev_path(targ_dev));
273  printk(BIOS_DEBUG, "%s: std swizzle %s from %c to %c\n", __func__, dev_path(targ_dev),
274  '@' + original_int_pin, '@' + new_int_pin);
275 
276  /* Swizzle this device if needed */
277  config = targ_dev->chip_info;
278  parent_bdf = targ_dev->path.pci.devfn | targ_dev->bus->secondary << 8;
279  if (is_dnv_swizzled_rp(parent_bdf) && irq_dev != targ_dev) {
280  swiz_int_pin = dnv_get_swizzled_pin(config, parent_bdf, new_int_pin);
281  printk(BIOS_DEBUG, "%s: dnv swizzle %s from %c to %c\n", __func__,
282  dev_path(targ_dev), '@' + new_int_pin, '@' + swiz_int_pin);
283  } else {
284  swiz_int_pin = new_int_pin;
285  }
286 
287  /* Look up the routing for the pin */
288  int_line = dnv_get_ir(config, parent_bdf, swiz_int_pin);
289 
290 dnv_get_int_line_done:
291  printk(BIOS_DEBUG, "\tINT_LINE\t\t: %d\n", int_line);
292  return int_line;
293 }
294 
295 /* PIRQ[n]_ROUT[3:0] - PIRQ Routing Control
296  * 0x00 - 0000 = Reserved
297  * 0x01 - 0001 = Reserved
298  * 0x02 - 0010 = Reserved
299  * 0x03 - 0011 = IRQ3
300  * 0x04 - 0100 = IRQ4
301  * 0x05 - 0101 = IRQ5
302  * 0x06 - 0110 = IRQ6
303  * 0x07 - 0111 = IRQ7
304  * 0x08 - 1000 = Reserved
305  * 0x09 - 1001 = IRQ9
306  * 0x0A - 1010 = IRQ10
307  * 0x0B - 1011 = IRQ11
308  * 0x0C - 1100 = IRQ12
309  * 0x0D - 1101 = Reserved
310  * 0x0E - 1110 = IRQ14
311  * 0x0F - 1111 = IRQ15
312  * PIRQ[n]_ROUT[7] - PIRQ Routing Control
313  * 0x80 - The PIRQ is not routed.
314  */
315 
316 static void pch_pirq_init(struct device *dev)
317 {
318  struct device *irq_dev;
319  /* Get the chip configuration */
320  config_t *config = config_of(dev);
321 
322  /* Initialize PIRQ Routings */
324  config->pirqa_routing);
326  config->pirqb_routing);
328  config->pirqc_routing);
330  config->pirqd_routing);
331 
333  config->pirqe_routing);
335  config->pirqf_routing);
337  config->pirqg_routing);
339  config->pirqh_routing);
340 
341  /* Initialize device's Interrupt Routings */
343  config->ir00_routing);
345  config->ir01_routing);
347  config->ir02_routing);
349  config->ir03_routing);
351  config->ir04_routing);
353  config->ir05_routing);
355  config->ir06_routing);
357  config->ir07_routing);
359  config->ir08_routing);
361  config->ir09_routing);
363  config->ir10_routing);
365  config->ir11_routing);
367  config->ir12_routing);
368 
369  /* Initialize device's Interrupt Polarity Control */
371  config->ipc0);
373  config->ipc1);
375  config->ipc2);
377  config->ipc3);
378 
379  for (irq_dev = all_devices; irq_dev; irq_dev = irq_dev->next) {
380  int devfn = irq_dev->path.pci.devfn;
381  u8 int_pin = 0, int_line = 0;
382 
383  if (!irq_dev->enabled || irq_dev->path.type != DEVICE_PATH_PCI)
384  continue;
385 
386  int_pin = pci_read_config8(irq_dev, PCI_INTERRUPT_PIN);
387 
388  int_line = dnv_get_int_line(irq_dev);
389  printk(BIOS_DEBUG, "%s: %02x:%02x.%d pin %d int line %d\n", __func__,
390  irq_dev->bus->secondary, devfn >> 3, devfn & 0x7, int_pin, int_line);
391 
392  pci_write_config8(irq_dev, PCI_INTERRUPT_LINE, int_line);
393  }
394 }
395 
396 static void pci_p2sb_read_resources(struct device *dev)
397 {
398  struct resource *res;
399 
400  /* Add MMIO resource
401  * Use 0xda as an unused index for PCR BAR.
402  */
403  res = new_resource(dev, 0xda);
404  res->base = DEFAULT_PCR_BASE;
405  res->size = 16 * 1024 * 1024; /* 16MB PCR config space */
409  "Adding P2SB PCR config space BAR 0x%08lx-0x%08lx.\n",
410  (unsigned long)(res->base),
411  (unsigned long)(res->base + res->size));
412 
413  /* Add MMIO resource
414  * Use 0xdb as an unused index for IOAPIC.
415  */
416  res = new_resource(dev, 0xdb); /* IOAPIC */
417  res->base = IO_APIC_ADDR;
418  res->size = 0x00001000;
420 }
421 
422 static void pch_enable_serial_irqs(struct device *dev)
423 {
424  /* Set packet length and toggle silent mode bit for one frame. */
426  (1 << 7) | (1 << 6) | ((21 - 17) << 2) | (0 << 0));
427 #if !CONFIG(SERIRQ_CONTINUOUS_MODE)
429  (1 << 7) | (0 << 6) | ((21 - 17) << 2) | (0 << 0));
430 #endif
431 }
432 
433 static void lpc_init(struct device *dev)
434 {
435  printk(BIOS_DEBUG, "pch: %s\n", __func__);
436 
437  /* Get the base address */
438 
439  /* Set the value for PCI command register. */
443 
444  /* Serial IRQ initialization. */
446 
447  /* IO APIC initialization. */
448  pch_enable_ioapic(dev);
449 
450  /* Setup the PIRQ. */
451  pch_pirq_init(dev);
452 }
453 
454 static void pch_lpc_add_mmio_resources(struct device *dev) { /* TODO */ }
455 
456 static void pch_lpc_add_io_resources(struct device *dev)
457 {
458  struct resource *res;
459  u8 io_index = 0;
460 
461  /* Add an extra subtractive resource for both memory and I/O. */
462  res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
463  res->base = 0;
464  res->size = 0x1000;
467 
468  res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
469  res->base = 0xff000000;
470  res->size = 0x01000000; /* 16 MB for flash */
473 }
474 
475 static void lpc_read_resources(struct device *dev)
476 {
477  /* Get the normal PCI resources of this device. */
479 
480  /* Add non-standard MMIO resources. */
482 
483  /* Add IO resources. */
485 
486  /* Add MMIO resource for IOAPIC. */
488 }
489 
490 static void pch_decode_init(struct device *dev) { /* TODO */ }
491 
492 static void lpc_enable_resources(struct device *dev)
493 {
494  pch_decode_init(dev);
496 }
497 
498 /* Set bit in Function Disable register to hide this device */
499 static void pch_hide_devfn(uint32_t devfn) { /* TODO */ }
500 
502 {
503  u16 reg16;
504 
505  if (!dev->enabled) {
506  printk(BIOS_DEBUG, "%s: Disabling device\n", dev_path(dev));
507 
508  /* Ensure memory, io, and bus master are all disabled */
509  reg16 = pci_read_config16(dev, PCI_COMMAND);
512  pci_write_config16(dev, PCI_COMMAND, reg16);
513 
514  /* Hide this device if possible */
516  } else {
517  /* Enable SERR */
519  }
520 }
521 
522 static struct device_operations device_ops = {
524  .set_resources = pci_dev_set_resources,
525 #if CONFIG(HAVE_ACPI_TABLES)
526  .write_acpi_tables = southcluster_write_acpi_tables,
527 #endif
528  .enable_resources = lpc_enable_resources,
529  .init = lpc_init,
530  .enable = southcluster_enable_dev,
531  .scan_bus = scan_static_bus,
532  .ops_pci = &soc_pci_ops,
533 };
534 
535 static const struct pci_driver lpc_driver __pci_driver = {
536  .ops = &device_ops,
537  .vendor = PCI_VID_INTEL,
538  .device = PCI_DID_INTEL_DNV_LPC,
539 };
540 
541 static void finalize_chipset(void *unused)
542 {
544 }
545 
static void write8(void *addr, uint8_t val)
Definition: mmio.h:30
static void write32(void *addr, uint32_t val)
Definition: mmio.h:40
static void write16(void *addr, uint16_t val)
Definition: mmio.h:35
#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
void ioapic_set_max_vectors(void *ioapic_base, int mre_count)
Definition: ioapic.c:51
@ BS_PAYLOAD_LOAD
Definition: bootstate.h:88
@ BS_OS_RESUME
Definition: bootstate.h:86
@ BS_ON_ENTRY
Definition: bootstate.h:95
@ BS_ON_EXIT
Definition: bootstate.h:96
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define PCR_ITSS_PIRQG_ROUT
Definition: itss.h:19
#define PCR_ITSS_PIRQB_ROUT
Definition: itss.h:9
#define PCR_ITSS_PIRQE_ROUT
Definition: itss.h:15
#define PCR_ITSS_PIRQA_ROUT
Definition: itss.h:7
#define PCR_ITSS_PIRQH_ROUT
Definition: itss.h:21
#define PCR_ITSS_PIRQF_ROUT
Definition: itss.h:17
#define PCR_ITSS_PIRQC_ROUT
Definition: itss.h:11
#define PCR_ITSS_PIRQD_ROUT
Definition: itss.h:13
#define printk(level,...)
Definition: stdlib.h:16
#define PCR_ITSS_PIR09
Definition: p2sb.h:37
#define PCH_PCR_ITSS_IPC1
Interrupt Polarity Control 1.
Definition: p2sb.h:49
#define PCR_ITSS_PIR11
Definition: p2sb.h:39
#define IO_APIC0
Definition: p2sb.h:7
#define PCR_ITSS_PIR05
Definition: p2sb.h:33
#define PCH_PCR_ITSS_IPC3
Interrupt Polarity Control 3.
Definition: p2sb.h:51
#define PCR_ITSS_PIR08
Definition: p2sb.h:36
#define PCR_ITSS_PIR00
Definition: p2sb.h:28
#define PCH_PCR_ITSS_IPC0
Interrupt Polarity Control 0.
Definition: p2sb.h:48
#define PCR_ITSS_PIR07
Definition: p2sb.h:35
#define PCR_ITSS_PIR12
Definition: p2sb.h:40
#define PCR_ITSS_PIR10
Definition: p2sb.h:38
#define PCR_ITSS_PIR04
Definition: p2sb.h:32
#define PCR_ITSS_PIR02
Definition: p2sb.h:30
#define PCH_PCR_ITSS_IPC2
Interrupt Polarity Control 2.
Definition: p2sb.h:50
#define PCR_ITSS_PIR06
Definition: p2sb.h:34
#define PCR_ITSS_PIR01
Definition: p2sb.h:29
#define PCR_ITSS_PIR03
Definition: p2sb.h:31
#define PCH_PCR_ADDRESS(Pid, Offset)
Definition: pcr.h:10
@ PID_ITSS
Definition: pcr.h:16
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
const char * dev_path(const struct device *dev)
Definition: device_util.c:149
#define APM_CNT_FINALIZE
Definition: smm.h:24
static DEVTREE_CONST void * config_of(const struct device *dev)
Definition: device.h:382
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 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 DEFAULT_PCR_BASE
Definition: iomap.h:20
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
Definition: loglevel.h:86
enum board_config config
Definition: memory.c:448
@ DEVICE_PATH_PCI
Definition: path.h:9
#define PCI_COMMAND_SERR
Definition: pci_def.h:19
#define PCI_COMMAND_SPECIAL
Definition: pci_def.h:14
#define PCI_INTERRUPT_PIN
Definition: pci_def.h:95
#define PCI_INTERRUPT_LINE
Definition: pci_def.h:94
#define PCI_COMMAND_IO
Definition: pci_def.h:11
#define PCI_COMMAND_MASTER
Definition: pci_def.h:13
#define PCI_COMMAND_MEMORY
Definition: pci_def.h:12
#define PCI_COMMAND
Definition: pci_def.h:10
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
int get_pci_irq_pins(struct device *dev, struct device **parent_bdg)
Given a device structure 'dev', find its interrupt pin and its parent bridge 'parent_bdg' device stru...
Definition: pci_device.c:1729
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
#define PCI_DID_INTEL_DNV_LPC
Definition: pci_ids.h:2787
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
#define IORESOURCE_MEM
Definition: resource.h:10
#define IORESOURCE_SUBTRACTIVE
Definition: resource.h:24
#define IORESOURCE_STORED
Definition: resource.h:32
#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
struct pci_operations soc_pci_ops
Definition: chip.c:51
unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
Definition: acpi.c:342
static struct device_operations device_ops
Definition: lpc.c:522
static void pch_enable_serial_irqs(struct device *dev)
Definition: lpc.c:422
static void lpc_read_resources(struct device *dev)
Definition: lpc.c:475
#define PCH_REDIR_ETR
Definition: lpc.c:25
static void pch_hide_devfn(uint32_t devfn)
Definition: lpc.c:499
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, finalize_chipset, NULL)
static void lpc_enable_resources(struct device *dev)
Definition: lpc.c:492
static void finalize_chipset(void *unused)
Definition: lpc.c:541
static void pch_lpc_add_io_resources(struct device *dev)
Definition: lpc.c:456
static void pci_p2sb_read_resources(struct device *dev)
Definition: lpc.c:396
void southcluster_enable_dev(struct device *dev)
Definition: lpc.c:501
static u8 dnv_get_int_line(struct device *irq_dev)
Definition: lpc.c:249
static void lpc_init(struct device *dev)
Definition: lpc.c:433
static void pch_decode_init(struct device *dev)
Definition: lpc.c:490
static void pch_enable_ioapic(struct device *dev)
Set miscellaneous static southbridge features.
Definition: lpc.c:32
static void pch_pirq_init(struct device *dev)
Definition: lpc.c:316
static void pch_lpc_add_mmio_resources(struct device *dev)
Definition: lpc.c:454
static int dnv_get_swizzled_pin(config_t *config, u8 devfn, u8 pin)
Definition: lpc.c:114
static int is_dnv_swizzled_rp(uint16_t bdf)
Definition: lpc.c:90
static const struct pci_driver lpc_driver __pci_driver
Definition: lpc.c:535
static int dnv_get_ir(config_t *config, u8 devfn, u8 pin)
Definition: lpc.c:137
#define DEVFN(dev, fn)
Definition: lpc.c:47
#define NULL
Definition: stddef.h:19
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
unsigned char uint8_t
Definition: stdint.h:8
signed char int8_t
Definition: stdint.h:7
uint16_t secondary
Definition: device.h:84
void(* read_resources)(struct device *dev)
Definition: device.h:39
struct pci_path pci
Definition: path.h:116
enum device_path_type type
Definition: path.h:114
Definition: device.h:107
struct device_path path
Definition: device.h:115
DEVTREE_CONST struct bus * bus
Definition: device.h:108
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
Definition: lpc.c:41
u8 devfn
Definition: lpc.c:43
u8 ir
Definition: lpc.c:44
unsigned int devfn
Definition: path.h:54
unsigned long flags
Definition: resource.h:49
resource_t base
Definition: resource.h:45
resource_t size
Definition: resource.h:46