coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
early_pch.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <arch/io.h>
4 #include <console/console.h>
5 #include <device/pci_def.h>
6 #include <device/pci_ops.h>
7 #include <device/smbus_host.h>
11 
12 static void early_gpio_init(void)
13 {
16 
18 }
19 
20 static void pch_default_disable(void)
21 {
22  /* Must set BIT0 (hides performance counters PCI device).
23  coreboot enables the Rate Matching Hub which makes the UHCI PCI
24  devices disappear, so BIT5-12 and BIT28 can be set to hide those. */
25  RCBA32(FD) = (1 << 28) | (0xff << 5) | 1;
26 
27  /* Set reserved bit to 1 */
28  RCBA32(FD2) = 1;
29 }
30 
32 {
33  printk(BIOS_DEBUG, "Setting up static southbridge registers...");
34  pci_write_config32(PCI_DEV(0, 0x1f, 0), RCBA, CONFIG_FIXED_RCBA_MMIO_BASE | 1);
35 
37  /* Enable ACPI BAR */
39 
40  printk(BIOS_DEBUG, " done.\n");
41 
42  printk(BIOS_DEBUG, "Disabling Watchdog reboot...");
43  /* No reset */
44  RCBA32(GCS) = RCBA32(GCS) | (1 << 5);
45  /* halt timer */
46  outw((1 << 11), DEFAULT_PMBASE | 0x60 | 0x08);
47  /* halt timer */
48  outw(inw(DEFAULT_PMBASE | 0x60 | 0x06) | 2, DEFAULT_PMBASE | 0x60 | 0x06);
49  printk(BIOS_DEBUG, " done.\n");
50 
55 }
56 
57 void early_pch_init(void)
58 {
60  enable_smbus();
61  /* TODO, make this configurable */
66 }
void early_usb_init(const struct southbridge_usb_port *portmap)
Definition: early_usb.c:11
#define printk(level,...)
Definition: stdlib.h:16
u16 inw(u16 port)
void outw(u16 val, u16 port)
void southbridge_configure_default_intmap(void)
Definition: early_rcba.c:5
void pch_setup_cir(int chipset_type)
Definition: early_cir.c:11
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_write_config8(const struct device *dev, u16 reg, u8 val)
Definition: pci_ops.h:64
#define ACPI_EN
Definition: pmc.h:146
#define DEFAULT_PMBASE
Definition: iomap.h:14
#define IRONLAKE_MOBILE
Definition: ironlake.h:16
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
const struct pch_gpio_map mainboard_gpio_map
Definition: gpio.c:87
const struct southbridge_usb_port mainboard_usb_ports[]
Definition: early_init.c:8
#define DEFAULT_HECIBAR
Definition: memmap.h:6
#define PCI_COMMAND_MASTER
Definition: pci_def.h:13
#define PCI_COMMAND_MEMORY
Definition: pci_def.h:12
#define PCI_BASE_ADDRESS_0
Definition: pci_def.h:63
#define PCI_COMMAND
Definition: pci_def.h:10
#define PCI_DEV(SEGBUS, DEV, FN)
Definition: pci_type.h:14
static void enable_smbus(void)
Definition: smbus_host.h:34
#define RCBA
Definition: lpc.h:17
#define GCS
Definition: lpc.h:36
#define PMBASE
Definition: lpc.h:8
#define GPIO_CNTL
Definition: lpc.h:22
#define ACPI_CNTL
Definition: lpc.h:9
#define GPIO_BASE
Definition: lpc.h:21
#define FD2
Definition: rcba.h:128
#define FD
Definition: rcba.h:125
#define PCH_LPC_DEV
Definition: lpc.h:7
void early_pch_init(void)
Definition: early_pch.c:299
#define DEFAULT_GPIOBASE
Definition: pch.h:22
void setup_pch_gpios(const struct pch_gpio_map *gpio)
Definition: gpio.c:33
#define RCBA32(x)
Definition: rcba.h:14
static void pch_default_disable(void)
Definition: early_pch.c:20
void ibexpeak_setup_bars(void)
Definition: early_pch.c:31
static void early_gpio_init(void)
Definition: early_pch.c:12
unsigned long uintptr_t
Definition: stdint.h:21