coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
southcluster.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <device/mmio.h>
4 #include <device/pci_ops.h>
5 #include <acpi/acpi.h>
6 #include <arch/ioapic.h>
7 #include <bootstate.h>
8 #include "chip.h"
9 #include <console/console.h>
10 #include <device/device.h>
11 #include <device/pci.h>
12 #include <device/pci_ids.h>
13 #include <intelblocks/lpc_lib.h>
14 #include <pc80/isa-dma.h>
15 #include <pc80/i8254.h>
16 #include <pc80/i8259.h>
17 #include <soc/acpi.h>
18 #include <soc/iomap.h>
19 #include <soc/irq.h>
20 #include <soc/lpc.h>
21 #include <soc/pci_devs.h>
22 #include <soc/pm.h>
23 #include <soc/ramstage.h>
24 #include <soc/spi.h>
25 #include <spi-generic.h>
26 #include <stdint.h>
28 
29 static void sc_set_serial_irqs_mode(struct device *dev, enum serirq_mode mode)
30 {
31  u8 *ilb_base = (u8 *)(pci_read_config32(dev, IBASE) & ~0xf);
32 
33  switch (mode) {
34  case SERIRQ_CONTINUOUS:
35  break;
36 
37  case SERIRQ_OFF:
38  write32(ilb_base + ILB_OIC, read32(ilb_base + ILB_OIC) & ~SIRQEN);
39  break;
40 
41  case SERIRQ_QUIET:
42  default:
43  write8(ilb_base + SCNT, read8(ilb_base + SCNT) & ~SCNT_MODE);
44  break;
45  }
46 }
47 
48 static inline void add_mmio_resource(struct device *dev, int i, unsigned long addr,
49  unsigned long size)
50 {
51  mmio_resource(dev, i, addr >> 10, size >> 10);
52 }
53 
54 static void sc_add_mmio_resources(struct device *dev)
55 {
64  add_mmio_resource(dev, 0xfff, 0xffffffff - (CONFIG_COREBOOT_ROMSIZE_KB * KiB) + 1,
65  (CONFIG_COREBOOT_ROMSIZE_KB * KiB)); /* BIOS ROM */
66 
67  add_mmio_resource(dev, 0xfec, IO_APIC_ADDR, 0x00001000); /* IOAPIC */
68 }
69 
70 /* Default IO range claimed by the LPC device. The upper bound is exclusive. */
71 #define LPC_DEFAULT_IO_RANGE_LOWER 0
72 #define LPC_DEFAULT_IO_RANGE_UPPER 0x1000
73 
74 static void sc_enable_serial_irqs(struct device *dev)
75 {
76  u8 *ilb_base = (u8 *)(pci_read_config32(dev, IBASE) & ~0xF);
77 
78  printk(BIOS_SPEW, "Enable serial irq\n");
79  write32(ilb_base + ILB_OIC, read32(ilb_base + ILB_OIC) | SIRQEN);
80  write8(ilb_base + SCNT, read8(ilb_base + SCNT) | SCNT_MODE);
81 }
82 
83 /*
84  * Write PCI config space IRQ assignments. PCI devices have the INT_LINE (0x3c) and INT_PIN
85  * (0x3d) registers which report interrupt routing information to operating systems and drivers.
86  * The INT_PIN register is generally read only and reports which interrupt pin A - D it uses.
87  * The INT_LINE register is configurable and reports which IRQ (generally the PIC IRQs 1 - 15)
88  * it will use. This needs to take interrupt pin swizzling on devices that are downstream on
89  * a PCI bridge into account.
90  *
91  * This function will loop through all enabled PCI devices and program the INT_LINE register
92  * with the correct PIC IRQ number for the INT_PIN that it uses. It then configures each
93  * interrupt in the PIC to be level triggered.
94  */
95 static void write_pci_config_irqs(void)
96 {
97  struct device *irq_dev;
98  struct device *targ_dev;
99  uint8_t int_line = 0;
100  uint8_t original_int_pin = 0;
101  uint8_t new_int_pin = 0;
102  uint16_t current_bdf = 0;
103  uint16_t parent_bdf = 0;
104  uint8_t pirq = 0;
105  uint8_t device_num = 0;
106  const struct soc_irq_route *ir = &global_soc_irq_route;
107 
108  if (ir == NULL) {
109  printk(BIOS_WARNING, "Can't write PCI IRQ assignments "
110  "because 'global_braswell_irq_route' structure does not exist\n");
111  return;
112  }
113 
114  /*
115  * Loop through all enabled devices and program their INT_LINE, INT_PIN registers from
116  * values taken from the Interrupt Route registers in the ILB
117  */
118  printk(BIOS_DEBUG, "PCI_CFG IRQ: Write PIRQ assignments\n");
119  for (irq_dev = all_devices; irq_dev; irq_dev = irq_dev->next) {
120 
121  if ((irq_dev->path.type != DEVICE_PATH_PCI) ||
122  (!irq_dev->enabled))
123  continue;
124 
125  current_bdf = irq_dev->path.pci.devfn |
126  irq_dev->bus->secondary << 8;
127 
128  /*
129  * Step 1: Get the INT_PIN and device structure to look for
130  * in the pirq_data table defined in the mainboard directory.
131  */
132  targ_dev = NULL;
133  new_int_pin = get_pci_irq_pins(irq_dev, &targ_dev);
134  if (targ_dev == NULL || new_int_pin < 1)
135  continue;
136 
137  /* Get the original INT_PIN for record keeping */
138  original_int_pin = pci_read_config8(irq_dev, PCI_INTERRUPT_PIN);
139 
140  parent_bdf = targ_dev->path.pci.devfn
141  | targ_dev->bus->secondary << 8;
142  device_num = PCI_SLOT(parent_bdf);
143 
144  if (ir->pcidev[device_num] == 0) {
145  printk(BIOS_WARNING, "PCI Device %d does not have an IRQ entry, "
146  "skipping it\n", device_num);
147  continue;
148  }
149 
150  /* Find the PIRQ that is attached to the INT_PIN */
151  pirq = (ir->pcidev[device_num] >> ((new_int_pin - 1) * 4))
152  & 0x7;
153 
154  /* Get the INT_LINE this device/function will use */
155  int_line = ir->pic[pirq];
156 
157  if (int_line != PIRQ_PIC_IRQDISABLE) {
158  /* Set this IRQ to level triggered */
160 
161  /* Set the Interrupt Line register */
162  pci_write_config8(irq_dev, PCI_INTERRUPT_LINE, int_line);
163  } else {
164  /* Set the Interrupt line register as 'unknown' or 'unused' */
166  }
167 
168  printk(BIOS_SPEW, "\tINT_PIN\t\t: %d (%s)\n", original_int_pin,
169  pin_to_str(original_int_pin));
170 
171  if (parent_bdf != current_bdf)
172  printk(BIOS_SPEW, "\tSwizzled to\t: %d (%s)\n", new_int_pin,
173  pin_to_str(new_int_pin));
174 
175  printk(BIOS_SPEW, "\tPIRQ\t\t: %c\n\tINT_LINE\t: 0x%X (IRQ %d)\n",
176  'A' + pirq, int_line, int_line);
177  }
178  printk(BIOS_DEBUG, "PCI_CFG IRQ: Finished writing PIRQ assignments\n");
179 }
180 
181 static inline int io_range_in_default(int base, int size)
182 {
183  /* Does it start above the range? */
185  return 0;
186 
187  /* Is it entirely contained? */
189  return 1;
190 
191  /* This will return not in range for partial overlaps */
192  return 0;
193 }
194 
195 /*
196  * Note: this function assumes there is no overlap with the default LPC device's
197  * claimed range: LPC_DEFAULT_IO_RANGE_LOWER -> LPC_DEFAULT_IO_RANGE_UPPER.
198  */
199 static void sc_add_io_resource(struct device *dev, int base, int size, int index)
200 {
201  struct resource *res;
202 
204  return;
205 
206  res = new_resource(dev, index);
207  res->base = base;
208  res->size = size;
210 }
211 
212 static void sc_add_io_resources(struct device *dev)
213 {
214  struct resource *res;
215 
216  /* Add the default claimed IO range for the LPC device. */
217  res = new_resource(dev, 0);
221 
222  /* GPIO */
224 
225  /* ACPI */
227 }
228 
229 static void sc_read_resources(struct device *dev)
230 {
231  /* Get the normal PCI resources of this device. */
233 
234  /* Add non-standard MMIO resources. */
236 
237  /* Add IO resources. */
238  sc_add_io_resources(dev);
239 }
240 
241 static void sc_init(struct device *dev)
242 {
243  int i;
244  const unsigned long ilb_base = ILB_BASE_ADDRESS;
245  const unsigned long pr_base = ILB_BASE_ADDRESS + 0x08;
246  const unsigned long ir_base = ILB_BASE_ADDRESS + 0x20;
247 
248  void *gen_pmcon1 = (void *)(PMC_BASE_ADDRESS + GEN_PMCON1);
249  const struct soc_irq_route *ir = &global_soc_irq_route;
251 
252  /* Set the value for PCI command register. */
255 
256  /* Use IRQ9 for SCI Interrupt */
257  write32((void *)(ilb_base + ACTL), 0);
258 
259  isa_dma_init();
260 
262 
263  /* Set up the PIRQ PIC routing based on static config. */
264  for (i = 0; i < NUM_PIRQS; i++)
265  write8((void *)(pr_base + i*sizeof(ir->pic[i])), ir->pic[i]);
266 
267  /* Set up the per device PIRQ routing base on static config. */
268  for (i = 0; i < NUM_IR_DEVS; i++)
269  write16((void *)(ir_base + i*sizeof(ir->pcidev[i])), ir->pcidev[i]);
270 
271  /* Interrupt 9 should be level triggered (SCI) */
273 
274  for (i = 0; i < NUM_PIRQS; i++) {
275  if (ir->pic[i])
276  i8259_configure_irq_trigger(ir->pic[i], 1);
277  }
278 
279  if (config->disable_slp_x_stretch_sus_fail) {
280  printk(BIOS_DEBUG, "Disabling slp_x stretching.\n");
281  write32(gen_pmcon1, read32(gen_pmcon1) | DIS_SLP_X_STRCH_SUS_UP);
282 
283  } else {
284  write32(gen_pmcon1, read32(gen_pmcon1) & ~DIS_SLP_X_STRCH_SUS_UP);
285  }
286 
287  /* Write IRQ assignments to PCI config space */
289 
290  /* Initialize i8259 pic */
291  setup_i8259();
292 
293  /* Initialize i8254 timers */
294  setup_i8254();
295 
296  sc_set_serial_irqs_mode(dev, config->serirq_mode);
297 
298 }
299 
300 /*
301  * Common code for the south cluster devices.
302  */
303 
304 /* Set bit in function disable register to hide this device. */
305 static void sc_disable_devfn(struct device *dev)
306 {
307  void *func_dis = (void *)(PMC_BASE_ADDRESS + FUNC_DIS);
308  void *func_dis2 = (void *)(PMC_BASE_ADDRESS + FUNC_DIS2);
309  uint32_t mask = 0;
310  uint32_t mask2 = 0;
311 
312 #define SET_DIS_MASK(name_) \
313  case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC): \
314  mask |= name_ ## _DIS
315 
316 #define SET_DIS_MASK2(name_) \
317  case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC): \
318  mask2 |= name_ ## _DIS
319 
320  switch (dev->path.pci.devfn) {
321  SET_DIS_MASK(SDIO);
322  break;
323  SET_DIS_MASK(SD);
324  break;
325  SET_DIS_MASK(SATA);
326  break;
327  SET_DIS_MASK(XHCI);
328  /* Disable super speed PHY when XHCI is not available. */
329  mask2 |= USH_SS_PHY_DIS;
330  break;
331  SET_DIS_MASK(LPE);
332  break;
333  SET_DIS_MASK(MMC);
334  break;
335  SET_DIS_MASK(SIO_DMA1);
336  break;
338  break;
340  break;
342  break;
344  break;
346  break;
348  break;
350  break;
351  SET_DIS_MASK(TXE);
352  break;
353  SET_DIS_MASK(HDA);
354  break;
355  SET_DIS_MASK(PCIE_PORT1);
356  break;
357  SET_DIS_MASK(PCIE_PORT2);
358  break;
359  SET_DIS_MASK(PCIE_PORT3);
360  break;
361  SET_DIS_MASK(PCIE_PORT4);
362  break;
363  SET_DIS_MASK(SIO_DMA2);
364  break;
365  SET_DIS_MASK(PWM1);
366  break;
367  SET_DIS_MASK(PWM2);
368  break;
369  SET_DIS_MASK(HSUART1);
370  break;
371  SET_DIS_MASK(HSUART2);
372  break;
373  SET_DIS_MASK(SPI);
374  break;
376  break;
377  }
378 
379  if (mask != 0) {
380  write32(func_dis, read32(func_dis) | mask);
381  /* Ensure posted write hits */
382  read32(func_dis);
383  }
384 
385  if (mask2 != 0) {
386  write32(func_dis2, read32(func_dis2) | mask2);
387  /* Ensure posted write hits */
388  read32(func_dis2);
389  }
390 }
391 
392 static inline void set_d3hot_bits(struct device *dev, int offset)
393 {
394  uint32_t reg8;
395  printk(BIOS_DEBUG, "Power management CAP offset 0x%x.\n", offset);
396  reg8 = pci_read_config8(dev, offset + 4);
397  reg8 |= 0x3;
398  pci_write_config8(dev, offset + 4, reg8);
399 }
400 
401 /*
402  * Parts of the audio subsystem are powered by the HDA device. Thus, one cannot put HDA into
403  * D3Hot. Instead, perform this workaround to make some of the audio paths work for LPE audio.
404  */
405 static void hda_work_around(struct device *dev)
406 {
407  void *gctl = (void *)(TEMP_BASE_ADDRESS + 0x8);
408 
409  /* Need to set magic register 0x43 to 0xd7 in config space. */
410  pci_write_config8(dev, 0x43, 0xd7);
411 
412  /*
413  * Need to set bit 0 of GCTL to take the device out of reset.
414  * However, that requires setting up the 64-bit BAR.
415  */
419  write32(gctl, read32(gctl) | 0x1);
422 }
423 
424 static int place_device_in_d3hot(struct device *dev)
425 {
426  unsigned int offset;
427 
428  /*
429  * Parts of the HDA block are used for LPE audio as well.
430  * Therefore assume the HDA will never be put into D3Hot.
431  */
432  if (dev->path.pci.devfn == PCI_DEVFN(HDA_DEV, HDA_FUNC)) {
433  hda_work_around(dev);
434  return 0;
435  }
436 
438 
439  if (offset != 0) {
440  set_d3hot_bits(dev, offset);
441  return 0;
442  }
443 
444  /*
445  * For some reason some of the devices don't have the capability pointer set correctly.
446  * Work around this by hard coding the offset.
447  */
448 #define DEV_CASE(name_) \
449  case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC)
450 
451  switch (dev->path.pci.devfn) {
452  DEV_CASE(SDIO) :
453  DEV_CASE(SD) :
454  DEV_CASE(MMC) :
455  DEV_CASE(LPE) :
456  DEV_CASE(SIO_DMA1) :
457  DEV_CASE(I2C1) :
458  DEV_CASE(I2C2) :
459  DEV_CASE(I2C3) :
460  DEV_CASE(I2C4) :
461  DEV_CASE(I2C5) :
462  DEV_CASE(I2C6) :
463  DEV_CASE(I2C7) :
464  DEV_CASE(SIO_DMA2) :
465  DEV_CASE(PWM1) :
466  DEV_CASE(PWM2) :
467  DEV_CASE(HSUART1) :
468  DEV_CASE(HSUART2) :
469  DEV_CASE(SPI) :
470  offset = 0x80;
471  break;
472  DEV_CASE(SATA) :
473  DEV_CASE(XHCI) :
474  offset = 0x70;
475  break;
476  DEV_CASE(HDA) :
477  DEV_CASE(SMBUS) :
478  offset = 0x50;
479  break;
480  DEV_CASE(TXE) :
481  /* TXE cannot be placed in D3Hot. */
482  return 0;
483  DEV_CASE(PCIE_PORT1) :
484  DEV_CASE(PCIE_PORT2) :
485  DEV_CASE(PCIE_PORT3) :
486  DEV_CASE(PCIE_PORT4) :
487  offset = 0xa0;
488  break;
489  }
490 
491  if (offset != 0) {
492  set_d3hot_bits(dev, offset);
493  return 0;
494  }
495 
496  return -1;
497 }
498 
499 /* Common PCI device function disable. */
501 {
502  uint16_t reg16;
503 
504  if (!dev->enabled) {
505  int slot = PCI_SLOT(dev->path.pci.devfn);
506  int func = PCI_FUNC(dev->path.pci.devfn);
507  printk(BIOS_DEBUG, "%s: Disabling device: %02x.%01x\n",
508  dev_path(dev), slot, func);
509 
510  /* Ensure memory, io, and bus master are all disabled */
511  reg16 = pci_read_config16(dev, PCI_COMMAND);
513  pci_write_config16(dev, PCI_COMMAND, reg16);
514 
515  /* Place device in D3Hot */
516  if (place_device_in_d3hot(dev) < 0) {
518  "Could not place %02x.%01x into D3Hot. "
519  "Keeping device visible.\n", slot, func);
520  return;
521  }
522  /* Disable this device if possible */
523  sc_disable_devfn(dev);
524  } else {
525  /* Enable SERR */
527  }
528 }
529 
530 static struct device_operations device_ops = {
532  .set_resources = pci_dev_set_resources,
533  .write_acpi_tables = southcluster_write_acpi_tables,
534  .init = sc_init,
535  .enable = southcluster_enable_dev,
536  .scan_bus = scan_static_bus,
537  .ops_pci = &soc_pci_ops,
538 };
539 
540 static const struct pci_driver southcluster __pci_driver = {
541  .ops = &device_ops,
542  .vendor = PCI_VID_INTEL,
543  .device = LPC_DEVID,
544 };
545 
546 static void finalize_chipset(void *unused)
547 {
548  void *bcr = (void *)(SPI_BASE_ADDRESS + BCR);
549  void *gcs = (void *)(RCBA_BASE_ADDRESS + GCS);
550  void *gen_pmcon2 = (void *)(PMC_BASE_ADDRESS + GEN_PMCON2);
551  void *etr = (void *)(PMC_BASE_ADDRESS + ETR);
552  uint8_t *spi = (uint8_t *)SPI_BASE_ADDRESS;
553 
554  struct vscc_config cfg;
555 
556  /* Set the lock enable on the BIOS control register */
557  write32(bcr, read32(bcr) | BCR_LE);
558 
559  /* Set BIOS lock down bit controlling boot block size and swapping */
560  write32(gcs, read32(gcs) | BILD);
561 
562  /* Lock sleep stretching policy and set SMI lock */
563  write32(gen_pmcon2, read32(gen_pmcon2) | SLPSX_STR_POL_LOCK | SMI_LOCK);
564 
565  /* Set the CF9 lock */
566  write32(etr, read32(etr) | CF9LOCK);
567 
569  write16(spi + HSFSTS, read16(spi + HSFSTS) | FLOCKDN);
570 
571  if (mainboard_get_spi_vscc_config(&cfg) < 0) {
572  printk(BIOS_DEBUG, "No SPI VSCC configuration.\n");
573  } else {
574  write32(spi + UVSCC, cfg.uvscc);
575  write32(spi + LVSCC, cfg.lvscc | VCL);
576  }
577 }
578 
pirq
Definition: acpi_pirq_gen.h:20
#define SPI_BASE_ADDRESS
Definition: iomap.h:8
#define GEN_PMCON1
Definition: pm.h:154
#define GEN_PMCON2
Definition: pm.h:167
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 uint16_t read16(const void *addr)
Definition: mmio.h:17
static uint32_t read32(const void *addr)
Definition: mmio.h:22
static uint8_t read8(const void *addr)
Definition: mmio.h:12
static void write16(void *addr, uint16_t val)
Definition: mmio.h:35
#define IO_APIC_ADDR
Definition: ioapic.h:6
#define NUM_IR_DEVS
Definition: irq.h:123
#define PIRQ_PIC_IRQDISABLE
Definition: irq.h:80
#define NUM_PIRQS
Definition: irq.h:124
#define CF9LOCK
Definition: pm.h:57
#define SLPSX_STR_POL_LOCK
Definition: pm.h:52
#define FUNC_DIS2
Definition: pm.h:92
#define FUNC_DIS
Definition: pm.h:62
#define USH_SS_PHY_DIS
Definition: pm.h:93
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, finalize_chipset, NULL)
void southcluster_enable_dev(struct device *dev)
Definition: southcluster.c:452
@ BS_POST_DEVICE
Definition: bootstate.h:84
@ BS_ON_EXIT
Definition: bootstate.h:96
const struct soc_irq_route global_soc_irq_route
#define PIRQ_PIC_UNKNOWN_UNUSED
Definition: irq.h:142
static void add_mmio_resource(struct device *dev, int i, unsigned long addr, unsigned long size)
Definition: southcluster.c:48
static struct device_operations device_ops
Definition: southcluster.c:530
static void sc_enable_serial_irqs(struct device *dev)
Definition: southcluster.c:74
#define SET_DIS_MASK2(name_)
#define DEV_CASE(name_)
static void sc_add_io_resources(struct device *dev)
Definition: southcluster.c:212
#define SET_DIS_MASK(name_)
#define LPC_DEFAULT_IO_RANGE_LOWER
Definition: southcluster.c:71
static void sc_add_mmio_resources(struct device *dev)
Definition: southcluster.c:54
static void sc_read_resources(struct device *dev)
Definition: southcluster.c:229
static const struct pci_driver southcluster __pci_driver
Definition: southcluster.c:540
static void finalize_chipset(void *unused)
Definition: southcluster.c:546
static void write_pci_config_irqs(void)
Definition: southcluster.c:95
static void sc_set_serial_irqs_mode(struct device *dev, enum serirq_mode mode)
Definition: southcluster.c:29
static int place_device_in_d3hot(struct device *dev)
Definition: southcluster.c:424
static void sc_disable_devfn(struct device *dev)
Definition: southcluster.c:305
static void hda_work_around(struct device *dev)
Definition: southcluster.c:405
static void set_d3hot_bits(struct device *dev, int offset)
Definition: southcluster.c:392
static void sc_init(struct device *dev)
Definition: southcluster.c:241
static int io_range_in_default(int base, int size)
Definition: southcluster.c:181
static void sc_add_io_resource(struct device *dev, int base, int size, int index)
Definition: southcluster.c:199
#define LPC_DEFAULT_IO_RANGE_UPPER
Definition: southcluster.c:72
#define KiB
Definition: helpers.h:75
static u32 addr
Definition: cirrus.c:14
#define printk(level,...)
Definition: stdlib.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
int mainboard_get_spi_vscc_config(struct vscc_config *cfg)
Definition: w25q64.c:16
static size_t offset
Definition: flashconsole.c:16
@ SD
Definition: variants.h:56
void setup_i8254(void)
Definition: i8254.c:10
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
#define IRQ_LEVEL_TRIGGERED
Definition: i8259.h:68
@ SMBUS
Definition: acpigen.h:202
static DEVTREE_CONST void * config_of(const struct device *dev)
Definition: device.h:382
#define mmio_resource(dev, idx, basek, sizek)
Definition: device.h:334
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_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 u16 pci_find_capability(const struct device *dev, u16 cap)
Definition: pci_ops.h:207
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 ACPI_BASE_ADDRESS
Definition: iomap.h:99
#define GPIO_BASE_SIZE
Definition: iomap.h:75
#define ACPI_BASE_SIZE
Definition: iomap.h:100
#define ETR
Definition: pmc.h:63
#define DIS_SLP_X_STRCH_SUS_UP
Definition: pmc.h:32
#define ABASE
Definition: pmc.h:11
#define ACTL
Definition: pmc.h:144
#define SMI_LOCK
Definition: pmc.h:60
#define ILB_BASE_SIZE
Definition: iomap.h:27
#define PUNIT_BASE_ADDRESS
Definition: iomap.h:38
#define IO_BASE_ADDRESS
Definition: iomap.h:19
#define TEMP_BASE_ADDRESS
Definition: iomap.h:46
#define PMC_BASE_SIZE
Definition: iomap.h:16
#define PUNIT_BASE_SIZE
Definition: iomap.h:39
#define RCBA_BASE_ADDRESS
Definition: iomap.h:42
#define GPIO_BASE_ADDRESS
Definition: iomap.h:54
#define ABORT_BASE_SIZE
Definition: iomap.h:12
#define ILB_BASE_ADDRESS
Definition: iomap.h:26
#define SPI_BASE_SIZE
Definition: iomap.h:31
#define PMC_BASE_ADDRESS
Definition: iomap.h:15
#define RCBA_BASE_SIZE
Definition: iomap.h:43
#define MPHY_BASE_ADDRESS
Definition: iomap.h:34
#define MPHY_BASE_SIZE
Definition: iomap.h:35
#define ABORT_BASE_ADDRESS
Definition: iomap.h:11
#define IO_BASE_SIZE
Definition: iomap.h:23
void isa_dma_init(void)
Definition: isa-dma.c:35
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
Definition: loglevel.h:142
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
Definition: loglevel.h:86
serirq_mode
Definition: lpc_lib.h:34
@ SERIRQ_CONTINUOUS
Definition: lpc_lib.h:36
@ SERIRQ_QUIET
Definition: lpc_lib.h:35
@ SERIRQ_OFF
Definition: lpc_lib.h:37
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_DEVFN(slot, func)
Definition: pci_def.h:548
#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_CAP_ID_PM
Definition: pci_def.h:191
#define PCI_COMMAND_MEMORY
Definition: pci_def.h:12
#define PCI_FUNC(devfn)
Definition: pci_def.h:550
#define PCI_BASE_ADDRESS_0
Definition: pci_def.h:63
#define PCI_COMMAND
Definition: pci_def.h:10
#define PCI_BASE_ADDRESS_1
Definition: pci_def.h:64
#define PCI_SLOT(devfn)
Definition: pci_def.h:549
const char * pin_to_str(int pin)
Take an INT_PIN number (0, 1 - 4) and convert it to a string ("NO PIN", "PIN A" - "PIN D")
Definition: pci_device.c:1628
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_VID_INTEL
Definition: pci_ids.h:2157
#define IORESOURCE_ASSIGNED
Definition: resource.h:34
#define IORESOURCE_IO
Definition: resource.h:9
#define IORESOURCE_FIXED
Definition: resource.h:36
void scan_static_bus(struct device *bus)
Definition: root_device.c:89
uintptr_t base
Definition: uart.c:17
struct pci_operations soc_pci_ops
Definition: chip.c:51
#define IBASE
Definition: lpc.h:12
#define PUBASE
Definition: lpc.h:15
#define IOBASE
Definition: lpc.h:11
#define PBASE
Definition: lpc.h:9
#define RCBA
Definition: lpc.h:17
#define GBASE
Definition: lpc.h:10
#define GCS
Definition: lpc.h:36
#define SBASE
Definition: lpc.h:13
#define BILD
Definition: lpc.h:37
#define MPBASE
Definition: lpc.h:14
#define LPC_DEVID
Definition: pci_devs.h:141
#define HDA_FUNC
Definition: pci_devs.h:69
#define HDA_DEV
Definition: pci_devs.h:68
#define FLOCKDN
Definition: spi.h:10
#define VCL
Definition: spi.h:16
#define BCR_LE
Definition: spi.h:33
#define UVSCC
Definition: spi.h:24
#define LVSCC
Definition: spi.h:15
#define BCR
Definition: spi.h:27
#define HSFSTS
Definition: spi.h:9
unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
Definition: acpi.c:342
#define SIRQEN
Definition: lpc.h:21
#define ILB_OIC
Definition: lpc.h:20
#define SCNT
Definition: lpc.h:24
#define SCNT_MODE
Definition: lpc.h:25
static const int mask[4]
Definition: gpio.c:308
@ I2C7
Definition: i2c.h:57
@ I2C4
Definition: i2c.h:54
@ I2C5
Definition: i2c.h:55
@ I2C3
Definition: i2c.h:53
@ I2C2
Definition: i2c.h:52
@ I2C1
Definition: i2c.h:51
@ I2C6
Definition: i2c.h:56
void spi_finalize_ops(void)
Definition: spi.c:1039
#define NULL
Definition: stddef.h:19
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
uint8_t u8
Definition: stdint.h:45
unsigned char uint8_t
Definition: stdint.h:8
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
unsigned int enabled
Definition: device.h:122
unsigned int devfn
Definition: path.h:54
unsigned long flags
Definition: resource.h:49
resource_t base
Definition: resource.h:45
unsigned long index
Definition: resource.h:50
resource_t size
Definition: resource.h:46
uint16_t pcidev[NUM_IR_DEVS]
Definition: irq.h:179
uint8_t pic[NUM_PIRQS]
Definition: irq.h:181
uint32_t lvscc
Definition: spi.h:36
uint32_t uvscc
Definition: spi.h:37