| 1 |
|
| 2 |
|
| 3 |
#include <arch/bootblock.h> |
| 4 |
#include <device/pci_ops.h> |
| 5 |
#include <southbridge/intel/common/early_spi.h> |
| 6 |
#include "pch.h" |
| 7 |
|
| 8 |
static void map_rcba(void) |
| 9 |
{ |
| 10 |
pci_write_config32(PCH_LPC_DEV, RCBA, CONFIG_FIXED_RCBA_MMIO_BASE | 1); |
| 11 |
} |
| 12 |
|
| 13 |
static void enable_port80_on_lpc(void) |
| 14 |
{ |
| 15 |
|
| 16 |
|
| 17 |
u32 gcs = RCBA32(GCS); |
| 18 |
gcs = gcs & ~0x4; |
| 19 |
RCBA32(GCS) = gcs; |
| 20 |
} |
| 21 |
|
| 22 |
static void set_spi_speed(void) |
| 23 |
{ |
| 24 |
u32 fdod; |
| 25 |
u8 ssfc; |
| 26 |
|
| 27 |
|
| 28 |
SPIBAR32(FDOC) = 0x1000; |
| 29 |
|
| 30 |
|
| 31 |
fdod = SPIBAR32(FDOD); |
| 32 |
fdod >>= 24; |
| 33 |
fdod &= 7; |
| 34 |
|
| 35 |
|
| 36 |
ssfc = SPIBAR8(SSFC + 2); |
| 37 |
ssfc &= ~7; |
| 38 |
ssfc |= fdod; |
| 39 |
SPIBAR8(SSFC + 2) = ssfc; |
| 40 |
} |
| 41 |
|
| 42 |
void bootblock_early_southbridge_init(void) |
| 43 |
{ |
| 44 |
map_rcba(); |
| 45 |
enable_spi_prefetching_and_caching(); |
| 46 |
enable_port80_on_lpc(); |
| 47 |
set_spi_speed(); |
| 48 |
|
| 49 |
|
| 50 |
RCBA32(RC) = (1 << 2); |
| 51 |
|
| 52 |
pch_enable_lpc(); |
| 53 |
mainboard_config_superio(); |
| 54 |
|
| 55 |
|
| 56 |
if (CONFIG(USE_BROADWELL_MRC)) { |
| 57 |
|
| 58 |
RCBA32_AND_OR(HPTC, ~3, 1 << 7); |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
(void)RCBA32(HPTC); |
| 65 |
|
| 66 |
|
| 67 |
setbits32((void *)0xfed00000 + 0x10, 1 << 0); |
| 68 |
} |
| 69 |
|
| 70 |
if (CONFIG(SERIALIO_UART_CONSOLE)) |
| 71 |
uart_bootblock_init(); |
| 72 |
} |