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/isa-dma.h>
9 #include <pc80/i8259.h>
10 #include <device/pci_ops.h>
11 #include <arch/ioapic.h>
12 #include <acpi/acpi.h>
13 #include <cpu/x86/smm.h>
14 #include <soc/iomap.h>
15 #include <soc/lpc.h>
16 #include <soc/pch.h>
17 #include <soc/pci_devs.h>
18 #include <soc/pm.h>
19 #include <soc/rcba.h>
21 #include <acpi/acpigen.h>
25 
26 static void pch_enable_ioapic(struct device *dev)
27 {
28  /* Assign unique bus/dev/fn for I/O APIC */
31 
32  /* affirm full set of redirection table entries ("write once") */
33  /* PCH-LP has 40 redirection entries */
35 
37 }
38 
39 static void enable_hpet(struct device *dev)
40 {
41  size_t i;
42 
43  /* Assign unique bus/dev/fn for each HPET */
44  for (i = 0; i < 8; ++i)
46  PCH_HPET_PCI_BUS << 8 | PCH_HPET_PCI_SLOT << 3 | i);
47 }
48 
49 /* PIRQ[n]_ROUT[3:0] - PIRQ Routing Control
50  * 0x00 - 0000 = Reserved
51  * 0x01 - 0001 = Reserved
52  * 0x02 - 0010 = Reserved
53  * 0x03 - 0011 = IRQ3
54  * 0x04 - 0100 = IRQ4
55  * 0x05 - 0101 = IRQ5
56  * 0x06 - 0110 = IRQ6
57  * 0x07 - 0111 = IRQ7
58  * 0x08 - 1000 = Reserved
59  * 0x09 - 1001 = IRQ9
60  * 0x0A - 1010 = IRQ10
61  * 0x0B - 1011 = IRQ11
62  * 0x0C - 1100 = IRQ12
63  * 0x0D - 1101 = Reserved
64  * 0x0E - 1110 = IRQ14
65  * 0x0F - 1111 = IRQ15
66  * PIRQ[n]_ROUT[7] - PIRQ Routing Control
67  * 0x80 - The PIRQ is not routed.
68  */
69 
70 static void pch_pirq_init(struct device *dev)
71 {
72  struct device *irq_dev;
73 
74  const uint8_t pirq = 0x80;
75 
80 
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: /* INTA# */
96  case 2: /* INTB# */
97  case 3: /* INTC# */
98  case 4: /* INTD# */
99  int_line = pirq;
100  break;
101  }
102 
103  if (!int_line)
104  continue;
105 
106  pci_write_config8(irq_dev, PCI_INTERRUPT_LINE, int_line);
107  }
108 }
109 
110 static void pch_power_options(struct device *dev)
111 {
112  u16 reg16;
113  const char *state;
114 
115  /* Which state do we want to goto after g3 (power restored)?
116  * 0 == S0 Full On
117  * 1 == S5 Soft Off
118  *
119  * If the option is not existent (Laptops), use Kconfig setting.
120  */
121  const unsigned int pwr_on = get_uint_option("power_on_after_fail",
122  CONFIG_MAINBOARD_POWER_FAILURE_STATE);
123 
124  reg16 = pci_read_config16(dev, GEN_PMCON_3);
125  reg16 &= 0xfffe;
126  switch (pwr_on) {
127  case MAINBOARD_POWER_OFF:
128  reg16 |= 1;
129  state = "off";
130  break;
131  case MAINBOARD_POWER_ON:
132  reg16 &= ~1;
133  state = "on";
134  break;
136  reg16 &= ~1;
137  state = "state keep";
138  break;
139  default:
140  state = "undefined";
141  }
142 
143  reg16 &= ~(3 << 4); /* SLP_S4# Assertion Stretch 4s */
144  reg16 |= (1 << 3); /* SLP_S4# Assertion Stretch Enable */
145 
146  reg16 &= ~(1 << 10);
147  reg16 |= (1 << 11); /* SLP_S3# Min Assertion Width 50ms */
148 
149  reg16 |= (1 << 12); /* Disable SLP stretch after SUS well */
150 
151  pci_write_config16(dev, GEN_PMCON_3, reg16);
152  printk(BIOS_INFO, "Set power %s after power failure.\n", state);
153 
154  if (dev->chip_info) {
155  const struct soc_intel_broadwell_pch_config *config = dev->chip_info;
156 
157  /* GPE setup based on device tree configuration */
158  enable_all_gpe(config->gpe0_en_1, config->gpe0_en_2,
159  config->gpe0_en_3, config->gpe0_en_4);
160 
161  /* SMI setup based on device tree configuration */
162  enable_alt_smi(config->alt_gp_smi_en);
163  }
164 }
165 
166 static void pch_misc_init(struct device *dev)
167 {
168  u8 reg8;
169  u32 reg32;
170 
171  /* Prepare sleep mode */
172  reg32 = inl(ACPI_BASE_ADDRESS + PM1_CNT);
173  reg32 &= ~SLP_TYP;
174  reg32 |= SCI_EN;
175  outl(reg32, ACPI_BASE_ADDRESS + PM1_CNT);
176 
177  /* Set up NMI on errors */
178  reg8 = inb(0x61);
179  reg8 &= ~0xf0; /* Higher nibble must be 0 */
180  reg8 |= (1 << 2); /* PCI SERR# disable for now */
181  outb(reg8, 0x61);
182 
183  /* Disable NMI sources */
184  reg8 = inb(0x70);
185  reg8 |= (1 << 7); /* Can't mask NMI from PCI-E and NMI_NOW */
186  outb(reg8, 0x70);
187 
188  /* Indicate DRAM init done for MRC */
189  pci_or_config8(dev, GEN_PMCON_2, 1 << 7);
190 
191  /* Enable BIOS updates outside of SMM */
192  pci_and_config8(dev, BIOS_CNTL, ~(1 << 5));
193 
194  /* Clear status bits to prevent unexpected wake */
195  RCBA32_OR(0x3310, 0x2f);
196 
197  RCBA32_AND_OR(0x3f02, ~0xf, 0);
198 
199  /* Enable PCIe Releaxed Order */
200  RCBA32_OR(0x2314, (1 << 31) | (1 << 7)),
201  RCBA32_OR(0x1114, (1 << 15) | (1 << 14)),
202 
203  /* Setup SERIRQ, enable continuous mode */
204  reg8 = pci_read_config8(dev, SERIRQ_CNTL);
205  reg8 |= 1 << 7;
206 
207  if (CONFIG(SERIRQ_CONTINUOUS_MODE))
208  reg8 |= 1 << 6;
209 
210  pci_write_config8(dev, SERIRQ_CNTL, reg8);
211 }
212 
213 /* Magic register settings for power management */
214 static void pch_pm_init_magic(struct device *dev)
215 {
216  pci_write_config8(dev, 0xa9, 0x46);
217 
218  RCBA32_AND_OR(0x232c, ~1, 0);
219 
220  RCBA32_OR(0x1100, 0x0000c13f);
221 
222  RCBA32_AND_OR(0x2320, ~0x60, 0x10);
223 
224  RCBA32(0x3314) = 0x00012fff;
225 
226  RCBA32_AND_OR(0x3318, ~0x000f0330, 0x0dcf0400);
227 
228  RCBA32(0x3324) = 0x04000000;
229  RCBA32(0x3368) = 0x00041400;
230  RCBA32(0x3388) = 0x3f8ddbff;
231  RCBA32(0x33ac) = 0x00007001;
232  RCBA32(0x33b0) = 0x00181900;
233  RCBA32(0x33c0) = 0x00060A00;
234  RCBA32(0x33d0) = 0x06200840;
235  RCBA32(0x3a28) = 0x01010101;
236  RCBA32(0x3a2c) = 0x040c0404;
237  RCBA32(0x3a9c) = 0x9000000a;
238  RCBA32(0x2b1c) = 0x03808033;
239  RCBA32(0x2b34) = 0x80000009;
240  RCBA32(0x3348) = 0x022ddfff;
241  RCBA32(0x334c) = 0x00000001;
242  RCBA32(0x3358) = 0x0001c000;
243  RCBA32(0x3380) = 0x3f8ddbff;
244  RCBA32(0x3384) = 0x0001c7e1;
245  RCBA32(0x338c) = 0x0001c7e1;
246  RCBA32(0x3398) = 0x0001c000;
247  RCBA32(0x33a8) = 0x00181900;
248  RCBA32(0x33dc) = 0x00080000;
249  RCBA32(0x33e0) = 0x00000001;
250  RCBA32(0x3a20) = 0x0000040c;
251  RCBA32(0x3a24) = 0x01010101;
252  RCBA32(0x3a30) = 0x01010101;
253 
254  pci_update_config32(dev, 0xac, ~0x00200000, 0);
255 
256  RCBA32_OR(0x0410, 0x00000003);
257  RCBA32_OR(0x2618, 0x08000000);
258  RCBA32_OR(0x2300, 0x00000002);
259  RCBA32_OR(0x2600, 0x00000008);
260 
261  RCBA32(0x33b4) = 0x00007001;
262  RCBA32(0x3350) = 0x022ddfff;
263  RCBA32(0x3354) = 0x00000001;
264 
265  /* Power Optimizer */
266  RCBA32_OR(0x33d4, 0x08000000);
267  RCBA32_OR(0x33c8, 0x00000080);
268 
269  RCBA32(0x2b10) = 0x0000883c;
270  RCBA32(0x2b14) = 0x1e0a4616;
271  RCBA32(0x2b24) = 0x40000005;
272  RCBA32(0x2b20) = 0x0005db01;
273  RCBA32(0x3a80) = 0x05145005;
274  RCBA32(0x3a84) = 0x00001005;
275 
276  RCBA32_OR(0x33d4, 0x2fff2fb1);
277  RCBA32_OR(0x33c8, 0x00008000);
278 }
279 
280 static void pch_enable_mphy(void)
281 {
282  u32 gpio71_native = gpio_is_native(71);
283  u32 data_and = 0xffffffff;
284  u32 data_or = (1 << 14) | (1 << 13) | (1 << 12);
285 
286  if (gpio71_native) {
287  data_or |= (1 << 0);
288  if (pch_is_wpt()) {
289  data_and &= ~((1 << 7) | (1 << 6) | (1 << 3));
290  data_or |= (1 << 5) | (1 << 4);
291 
292  if (pch_is_wpt_ulx()) {
293  /* Check if SATA and USB3 MPHY are enabled */
294  u32 strap19 = pch_read_soft_strap(19);
295  strap19 &= ((1 << 31) | (1 << 30));
296  strap19 >>= 30;
297  if (strap19 == 3) {
298  data_or |= (1 << 3);
299  printk(BIOS_DEBUG, "Enable ULX MPHY PG "
300  "control in single domain\n");
301  } else if (strap19 == 0) {
302  printk(BIOS_DEBUG, "Enable ULX MPHY PG "
303  "control in split domains\n");
304  } else {
305  printk(BIOS_DEBUG, "Invalid PCH Soft "
306  "Strap 19 configuration\n");
307  }
308  } else {
309  data_or |= (1 << 3);
310  }
311  }
312  }
313 
314  pch_iobp_update(0xCF000000, data_and, data_or);
315 }
316 
317 static void pch_init_deep_sx(struct device *dev)
318 {
319  const struct soc_intel_broadwell_pch_config *config = dev->chip_info;
320 
321  if (!config)
322  return;
323 
324  if (config->deep_sx_enable_ac) {
327  }
328 
329  if (config->deep_sx_enable_dc) {
332  }
333 
334  if (config->deep_sx_enable_ac || config->deep_sx_enable_dc)
337 }
338 
339 /* Power Management init */
340 static void pch_pm_init(struct device *dev)
341 {
342  printk(BIOS_DEBUG, "PCH PM init\n");
343 
344  pch_init_deep_sx(dev);
345 
346  pch_enable_mphy();
347 
348  pch_pm_init_magic(dev);
349 
350  if (pch_is_wpt()) {
351  RCBA32_OR(0x33e0, (1 << 4) | (1 << 1));
352  RCBA32_OR(0x2b1c, (1 << 22) | (1 << 14) | (1 << 13));
353  RCBA32(0x33e4) = 0x16bf0002;
354  RCBA32_OR(0x33e4, 0x1);
355  }
356 
357  pch_iobp_update(0xCA000000, ~0UL, 0x00000009);
358 
359  /* Set RCBA 0x2b1c[29]=1 if DSP disabled */
360  if (RCBA32(FD) & PCH_DISABLE_ADSPD)
361  RCBA32_OR(0x2b1c, (1 << 29));
362 
363 }
364 
365 static void pch_cg_init(struct device *dev)
366 {
367  u32 reg32;
368  u16 reg16;
369  struct device *igd_dev = pcidev_path_on_root(SA_DEVFN_IGD);
370 
371  /* DMI */
372  RCBA32_OR(0x2234, 0xf);
373 
374  reg16 = pci_read_config16(dev, GEN_PMCON_1);
375  reg16 &= ~(1 << 10); /* Disable BIOS_PCI_EXP_EN for native PME */
376  if (pch_is_wpt())
377  reg16 &= ~(1 << 11);
378  else
379  reg16 |= (1 << 11);
380  reg16 |= (1 << 5) | (1 << 6) | (1 << 7) | (1 << 12);
381  reg16 |= (1 << 2); // PCI CLKRUN# Enable
382  pci_write_config16(dev, GEN_PMCON_1, reg16);
383 
384  /*
385  * RCBA + 0x2614[27:25,14:13,10,8] = 101,11,1,1
386  * RCBA + 0x2614[23:16] = 0x20
387  * RCBA + 0x2614[30:28] = 0x0
388  * RCBA + 0x2614[26] = 1 (IF 0:2.0@0x08 >= 0x0b)
389  */
390  RCBA32_AND_OR(0x2614, ~0x64ff0000, 0x0a206500);
391 
392  /* Check for 0:2.0@0x08 >= 0x0b */
393  if (pch_is_wpt() || pci_read_config8(igd_dev, 0x8) >= 0x0b)
394  RCBA32_OR(0x2614, (1 << 26));
395 
396  RCBA32_OR(0x900, 0x0000031f);
397 
398  reg32 = RCBA32(CG);
399  if (RCBA32(0x3454) & (1 << 4))
400  reg32 &= ~(1 << 29); // LPC Dynamic
401  else
402  reg32 |= (1 << 29); // LPC Dynamic
403  reg32 |= (1 << 31); // LP LPC
404  reg32 |= (1 << 30); // LP BLA
405  if (RCBA32(0x3454) & (1 << 4))
406  reg32 &= ~(1 << 29);
407  else
408  reg32 |= (1 << 29);
409  reg32 |= (1 << 28); // GPIO Dynamic
410  reg32 |= (1 << 27); // HPET Dynamic
411  reg32 |= (1 << 26); // Generic Platform Event Clock
412  if (RCBA32(BUC) & PCH_DISABLE_GBE)
413  reg32 |= (1 << 23); // GbE Static
415  reg32 |= (1 << 21); // HDA Static
416  reg32 |= (1 << 22); // HDA Dynamic
417  RCBA32(CG) = reg32;
418 
419  /* PCH-LP LPC */
420  if (pch_is_wpt())
421  RCBA32_AND_OR(0x3434, ~0x1f, 0x17);
422  else
423  RCBA32_OR(0x3434, 0x7);
424 
425  /* SPI */
426  RCBA32_OR(0x38c0, 0x3c07);
427 
428  pch_iobp_update(0xCE00C000, ~1UL, 0x00000000);
429 }
430 
431 static void pch_set_acpi_mode(void)
432 {
433  if (!acpi_is_wakeup_s3()) {
435  }
436 }
437 
438 static void lpc_init(struct device *dev)
439 {
440  /* Legacy initialization */
441  isa_dma_init();
442  sb_rtc_init();
443  pch_misc_init(dev);
444 
445  /* Interrupt configuration */
446  pch_enable_ioapic(dev);
447  pch_pirq_init(dev);
448  setup_i8259();
450  enable_hpet(dev);
451 
452  /* Initialize power management */
453  pch_power_options(dev);
454  pch_pm_init(dev);
455  pch_cg_init(dev);
456 
458 }
459 
460 static void pch_lpc_add_mmio_resources(struct device *dev)
461 {
462  u32 reg;
463  struct resource *res;
464  const u32 default_decode_base = IO_APIC_ADDR;
465 
466  /*
467  * Just report all resources from IO-APIC base to 4GiB. Don't mark
468  * them reserved as that may upset the OS if this range is marked
469  * as reserved in the e820.
470  */
471  res = new_resource(dev, OIC);
472  res->base = default_decode_base;
473  res->size = 0 - default_decode_base;
475 
476  /* RCBA */
477  if (default_decode_base > CONFIG_FIXED_RCBA_MMIO_BASE) {
478  res = new_resource(dev, RCBA);
479  res->base = CONFIG_FIXED_RCBA_MMIO_BASE;
480  res->size = CONFIG_RCBA_LENGTH;
483  }
484 
485  /* Check LPC Memory Decode register. */
486  reg = pci_read_config32(dev, LGMR);
487  if (reg & 1) {
488  reg &= ~0xffff;
489  if (reg < default_decode_base) {
490  res = new_resource(dev, LGMR);
491  res->base = reg;
492  res->size = 16 * 1024;
495  }
496  }
497 }
498 
499 /* Default IO range claimed by the LPC device. The upper bound is exclusive. */
500 #define LPC_DEFAULT_IO_RANGE_LOWER 0
501 #define LPC_DEFAULT_IO_RANGE_UPPER 0x1000
502 
503 static inline int pch_io_range_in_default(int base, int size)
504 {
505  /* Does it start above the range? */
507  return 0;
508 
509  /* Is it entirely contained? */
512  return 1;
513 
514  /* This will return not in range for partial overlaps. */
515  return 0;
516 }
517 
518 /*
519  * Note: this function assumes there is no overlap with the default LPC device's
520  * claimed range: LPC_DEFAULT_IO_RANGE_LOWER -> LPC_DEFAULT_IO_RANGE_UPPER.
521  */
522 static void pch_lpc_add_io_resource(struct device *dev, u16 base, u16 size,
523  int index)
524 {
525  struct resource *res;
526 
528  return;
529 
530  res = new_resource(dev, index);
531  res->base = base;
532  res->size = size;
534 }
535 
536 static void pch_lpc_add_gen_io_resources(struct device *dev, int reg_value,
537  int index)
538 {
539  /*
540  * Check if the register is enabled. If so and the base exceeds the
541  * device's default claim range add the resource.
542  */
543  if (reg_value & 1) {
544  u16 base = reg_value & 0xfffc;
545  u16 size = (0x3 | ((reg_value >> 16) & 0xfc)) + 1;
547  }
548 }
549 
550 static void pch_lpc_add_io_resources(struct device *dev)
551 {
552  struct resource *res;
553 
554  /* Add the default claimed IO range for the LPC device. */
555  res = new_resource(dev, 0);
559 
560  /* GPIOBASE */
563 
564  /* PMBASE */
566 
567  /* LPC Generic IO Decode range. */
568  if (dev->chip_info) {
569  const struct soc_intel_broadwell_pch_config *config = dev->chip_info;
574  }
575 }
576 
577 static void pch_lpc_read_resources(struct device *dev)
578 {
579  /* Get the normal PCI resources of this device. */
581 
582  /* Add non-standard MMIO resources. */
584 
585  /* Add IO resources. */
587 }
588 
589 static unsigned long broadwell_write_acpi_tables(const struct device *device,
590  unsigned long current,
591  struct acpi_rsdp *rsdp)
592 {
593  if (CONFIG(SERIALIO_UART_CONSOLE)) {
594  current = acpi_write_dbg2_pci_uart(rsdp, current,
595  (CONFIG_UART_FOR_CONSOLE == 1) ?
598  }
599  return acpi_write_hpet(device, current, rsdp);
600 }
601 
602 static struct device_operations device_ops = {
604  .set_resources = &pci_dev_set_resources,
605  .enable_resources = &pci_dev_enable_resources,
606  .write_acpi_tables = broadwell_write_acpi_tables,
607  .init = &lpc_init,
608  .scan_bus = &scan_static_bus,
609  .ops_pci = &pci_dev_ops_pci,
610 };
611 
612 static const unsigned short pci_device_ids[] = {
625  0
626 };
627 
628 static const struct pci_driver pch_lpc __pci_driver = {
629  .ops = &device_ops,
630  .vendor = PCI_VID_INTEL,
631  .devices = pci_device_ids,
632 };
unsigned long acpi_write_hpet(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
Definition: acpi.c:1141
unsigned long acpi_write_dbg2_pci_uart(acpi_rsdp_t *rsdp, unsigned long current, const struct device *dev, uint8_t access_size)
Definition: acpi.c:1230
pirq
Definition: acpi_pirq_gen.h:20
#define SCI_EN
Definition: pm.h:30
#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
void ioapic_set_max_vectors(void *ioapic_base, int mre_count)
Definition: ioapic.c:51
void enable_alt_smi(uint32_t mask)
Definition: pmutil.c:242
#define MAINBOARD_POWER_ON
Definition: pm.h:94
#define MAINBOARD_POWER_OFF
Definition: pm.h:93
#define MAINBOARD_POWER_KEEP
Definition: pm.h:95
void enable_all_gpe(uint32_t set1, uint32_t set2, uint32_t set3, uint32_t set4)
Definition: pmutil.c:385
#define printk(level,...)
Definition: stdlib.h:16
u8 inb(u16 port)
void outb(u8 val, u16 port)
u32 inl(u16 port)
void outl(u32 val, u16 port)
DEVTREE_CONST struct device *DEVTREE_CONST all_devices
Linked list of ALL devices.
Definition: device_const.c:13
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
Definition: device_const.c:255
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
#define ACPI_ACCESS_SIZE_DWORD_ACCESS
Definition: acpi.h:129
#define APM_CNT_ACPI_DISABLE
Definition: smm.h:21
static __always_inline void pci_and_config8(const struct device *dev, u16 reg, u8 andmask)
Definition: pci_ops.h:136
static __always_inline void pci_update_config32(const struct device *dev, u16 reg, u32 mask, u32 or)
Definition: pci_ops.h:120
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 ACPI_BASE_ADDRESS
Definition: iomap.h:99
#define GPIO_BASE_SIZE
Definition: iomap.h:75
#define ACPI_BASE_SIZE
Definition: iomap.h:100
#define GPIO_BASE_ADDRESS
Definition: iomap.h:54
#define SLP_TYP
Definition: pmc.h:64
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
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
#define IORESOURCE_RESERVE
Definition: resource.h:30
#define IORESOURCE_MEM
Definition: resource.h:10
#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
int apm_control(u8 cmd)
Definition: smi_trigger.c:31
uintptr_t base
Definition: uart.c:17
#define SERIRQ_CNTL
Definition: espi.h:21
#define LGMR
Definition: espi.h:29
#define PCH_DEV_UART0
Definition: pci_devs.h:208
#define PCH_DEV_UART1
Definition: pci_devs.h:209
#define SA_DEVFN_IGD
Definition: pci_devs.h:32
#define RCBA
Definition: lpc.h:17
#define PIRQE_ROUT
Definition: lpc.h:30
#define PIRQG_ROUT
Definition: lpc.h:32
#define LPC_HnBDF(n)
Definition: lpc.h:77
#define BIOS_CNTL
Definition: lpc.h:20
#define LPC_GEN1_DEC
Definition: lpc.h:47
#define GEN_PMCON_3
Definition: lpc.h:63
#define PMBASE
Definition: lpc.h:8
#define LPC_IBDF
Definition: lpc.h:76
#define LPC_GEN2_DEC
Definition: lpc.h:48
#define GEN_PMCON_2
Definition: lpc.h:58
#define LPC_GEN3_DEC
Definition: lpc.h:49
#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 GPIO_BASE
Definition: lpc.h:21
#define LPC_GEN4_DEC
Definition: lpc.h:50
#define PIRQH_ROUT
Definition: lpc.h:33
#define PIRQA_ROUT
Definition: lpc.h:26
#define PIRQF_ROUT
Definition: lpc.h:31
#define PCH_LPT_LP_SAMPLE
Definition: pch.h:7
#define PCH_WPT_BDW_Y_SAMPLE
Definition: pch.h:17
int pch_is_wpt(void)
Definition: pch.c:26
int pch_is_wpt_ulx(void)
Definition: pch.c:32
#define PCH_LPT_LP_VALUE
Definition: pch.h:10
#define PCH_WPT_BDW_H
Definition: pch.h:20
#define PCH_LPT_LP_MAINSTREAM
Definition: pch.h:9
#define PCH_WPT_BDW_U_SAMPLE
Definition: pch.h:14
#define PCH_WPT_HSW_U_SAMPLE
Definition: pch.h:13
#define PCH_WPT_BDW_Y_BASE
Definition: pch.h:19
#define PCH_LPT_LP_PREMIUM
Definition: pch.h:8
#define PCH_WPT_BDW_Y_PREMIUM
Definition: pch.h:18
#define PCH_WPT_BDW_U_BASE
Definition: pch.h:16
u32 pch_read_soft_strap(int id)
Definition: pch.c:46
#define PCH_WPT_BDW_U_PREMIUM
Definition: pch.h:15
#define PCH_IOAPIC_PCI_SLOT
Definition: pci_devs.h:81
#define PCH_HPET_PCI_SLOT
Definition: pci_devs.h:83
#define PCH_IOAPIC_PCI_BUS
Definition: pci_devs.h:80
#define PCH_HPET_PCI_BUS
Definition: pci_devs.h:82
#define PCH_DISABLE_HD_AUDIO
Definition: rcba.h:136
#define DEEP_S5_EN_AC
Definition: rcba.h:105
#define CG
Definition: rcba.h:129
#define PCH_DISABLE_ADSPD
Definition: rcba.h:133
#define PCH_DISABLE_GBE
Definition: rcba.h:124
#define BUC
Definition: rcba.h:123
#define DEEP_S5_POL
Definition: rcba.h:104
#define DEEP_S3_EN_DC
Definition: rcba.h:103
#define DEEP_S3_EN_AC
Definition: rcba.h:102
#define DEEP_SX_WAKE_PIN_EN
Definition: rcba.h:108
#define OIC
Definition: rcba.h:100
#define FD
Definition: rcba.h:125
#define DEEP_SX_GP27_PIN_EN
Definition: rcba.h:110
#define DEEP_S5_EN_DC
Definition: rcba.h:106
#define DEEP_SX_CONFIG
Definition: rcba.h:107
#define DEEP_S3_POL
Definition: rcba.h:101
static void pch_power_options(struct device *dev)
Definition: lpc.c:110
static struct device_operations device_ops
Definition: lpc.c:602
static void pch_lpc_read_resources(struct device *dev)
Definition: lpc.c:577
static void pch_lpc_add_gen_io_resources(struct device *dev, int reg_value, int index)
Definition: lpc.c:536
static int pch_io_range_in_default(int base, int size)
Definition: lpc.c:503
#define LPC_DEFAULT_IO_RANGE_LOWER
Definition: lpc.c:500
static void enable_hpet(struct device *dev)
Definition: lpc.c:39
static void pch_init_deep_sx(struct device *dev)
Definition: lpc.c:317
static void pch_lpc_add_io_resources(struct device *dev)
Definition: lpc.c:550
static void pch_set_acpi_mode(void)
Definition: lpc.c:431
static void pch_pm_init(struct device *dev)
Definition: lpc.c:340
static unsigned long broadwell_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
Definition: lpc.c:589
static void pch_lpc_add_io_resource(struct device *dev, u16 base, u16 size, int index)
Definition: lpc.c:522
static void lpc_init(struct device *dev)
Definition: lpc.c:438
static const struct pci_driver pch_lpc __pci_driver
Definition: lpc.c:628
static const unsigned short pci_device_ids[]
Definition: lpc.c:612
static void pch_enable_mphy(void)
Definition: lpc.c:280
static void pch_enable_ioapic(struct device *dev)
Definition: lpc.c:26
static void pch_pirq_init(struct device *dev)
Definition: lpc.c:70
static void pch_lpc_add_mmio_resources(struct device *dev)
Definition: lpc.c:460
static void pch_pm_init_magic(struct device *dev)
Definition: lpc.c:214
static void pch_cg_init(struct device *dev)
Definition: lpc.c:365
#define LPC_DEFAULT_IO_RANGE_UPPER
Definition: lpc.c:501
static void pch_misc_init(struct device *dev)
Definition: lpc.c:166
void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue)
Definition: pch.c:86
int gpio_is_native(int gpio_num)
Definition: gpio.c:147
#define RCBA32_OR(x, or)
Definition: rcba.h:22
#define RCBA32_AND_OR(x, and, or)
Definition: rcba.h:21
#define RCBA32(x)
Definition: rcba.h:14
void sb_rtc_init(void)
Definition: rtc.c:21
uint32_t u32
Definition: stdint.h:51
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
unsigned char uint8_t
Definition: stdint.h:8
Definition: acpi.h:82
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
unsigned long index
Definition: resource.h:50
resource_t size
Definition: resource.h:46