| 1 |
|
| 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> |
| 8 |
#include <northbridge/intel/ironlake/ironlake.h> |
| 9 |
#include <southbridge/intel/ibexpeak/pch.h> |
| 10 |
#include <southbridge/intel/common/gpio.h> |
| 11 |
|
| 12 |
static void early_gpio_init(void) |
| 13 |
{ |
| 14 |
pci_write_config32(PCH_LPC_DEV, GPIO_BASE, DEFAULT_GPIOBASE | 1); |
| 15 |
pci_write_config8(PCH_LPC_DEV, GPIO_CNTL, 0x10); |
| 16 |
|
| 17 |
setup_pch_gpios(&mainboard_gpio_map); |
| 18 |
} |
| 19 |
|
| 20 |
static void pch_default_disable(void) |
| 21 |
{ |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
RCBA32(FD) = (1 << 28) | (0xff << 5) | 1; |
| 26 |
|
| 27 |
|
| 28 |
RCBA32(FD2) = 1; |
| 29 |
} |
| 30 |
|
| 31 |
void ibexpeak_setup_bars(void) |
| 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 |
|
| 36 |
pci_write_config32(PCI_DEV(0, 0x1f, 0), PMBASE, DEFAULT_PMBASE | 1); |
| 37 |
|
| 38 |
pci_write_config8(PCH_LPC_DEV, ACPI_CNTL, ACPI_EN); |
| 39 |
|
| 40 |
printk(BIOS_DEBUG, " done.\n"); |
| 41 |
|
| 42 |
printk(BIOS_DEBUG, "Disabling Watchdog reboot..."); |
| 43 |
|
| 44 |
RCBA32(GCS) = RCBA32(GCS) | (1 << 5); |
| 45 |
|
| 46 |
outw((1 << 11), DEFAULT_PMBASE | 0x60 | 0x08); |
| 47 |
|
| 48 |
outw(inw(DEFAULT_PMBASE | 0x60 | 0x06) | 2, DEFAULT_PMBASE | 0x60 | 0x06); |
| 49 |
printk(BIOS_DEBUG, " done.\n"); |
| 50 |
|
| 51 |
pci_write_config32(PCI_DEV(0, 0x16, 0), PCI_BASE_ADDRESS_0, |
| 52 |
(uintptr_t)DEFAULT_HECIBAR); |
| 53 |
pci_write_config32(PCI_DEV(0, 0x16, 0), PCI_COMMAND, |
| 54 |
PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY); |
| 55 |
} |
| 56 |
|
| 57 |
void early_pch_init(void) |
| 58 |
{ |
| 59 |
early_gpio_init(); |
| 60 |
enable_smbus(); |
| 61 |
|
| 62 |
pch_setup_cir(IRONLAKE_MOBILE); |
| 63 |
southbridge_configure_default_intmap(); |
| 64 |
pch_default_disable(); |
| 65 |
early_usb_init(mainboard_usb_ports); |
| 66 |
} |