| 1 |
|
| 2 |
|
| 3 |
#include <stdint.h> |
| 4 |
#include <arch/bootblock.h> |
| 5 |
#include <amdblocks/acpimmio.h> |
| 6 |
#include <device/pci_ops.h> |
| 7 |
#include <southbridge/amd/pi/hudson/hudson.h> |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
static void hudson_enable_rom(void) |
| 19 |
{ |
| 20 |
u8 reg8; |
| 21 |
const pci_devfn_t dev = PCI_DEV(0, 0x14, 3); |
| 22 |
|
| 23 |
|
| 24 |
reg8 = pci_s_read_config8(dev, 0x48); |
| 25 |
reg8 |= (1 << 3) | (1 << 4); |
| 26 |
pci_s_write_config8(dev, 0x48, reg8); |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
pci_s_write_config16(dev, 0x68, 0x000e); |
| 31 |
|
| 32 |
pci_s_write_config16(dev, 0x6a, 0x000f); |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
pci_s_write_config16(dev, 0x6c, 0x10000 - (CONFIG_COREBOOT_ROMSIZE_KB >> 6)); |
| 43 |
|
| 44 |
pci_s_write_config16(dev, 0x6e, 0xffff); |
| 45 |
} |
| 46 |
|
| 47 |
void bootblock_early_southbridge_init(void) |
| 48 |
{ |
| 49 |
u32 data; |
| 50 |
|
| 51 |
hudson_enable_rom(); |
| 52 |
enable_acpimmio_decode_pm04(); |
| 53 |
hudson_lpc_decode(); |
| 54 |
|
| 55 |
if (CONFIG(POST_DEVICE_PCI_PCIE)) |
| 56 |
hudson_pci_port80(); |
| 57 |
else if (CONFIG(POST_DEVICE_LPC)) |
| 58 |
hudson_lpc_port80(); |
| 59 |
|
| 60 |
const pci_devfn_t dev = PCI_DEV(0, 0x14, 3); |
| 61 |
data = pci_read_config32(dev, LPC_IO_OR_MEM_DECODE_ENABLE); |
| 62 |
|
| 63 |
pci_write_config32(dev, LPC_IO_OR_MEM_DECODE_ENABLE, data | 3); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
data = pci_read_config32(dev, LPC_TRUSTED_PLATFORM_MODULE); |
| 74 |
data |= TPM_12_EN | TPM_LEGACY_EN; |
| 75 |
pci_write_config32(dev, LPC_TRUSTED_PLATFORM_MODULE, data); |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
pm_write8(0xd2, 0); |
| 86 |
} |