| 1 |
|
| 2 |
|
| 3 |
#include <bootblock_common.h> |
| 4 |
#include <device/pci_ops.h> |
| 5 |
#include <intelblocks/lpc_lib.h> |
| 6 |
#include <intelblocks/pcr.h> |
| 7 |
#include <soc/intel/common/block/lpc/lpc_def.h> |
| 8 |
#include <soc/pci_devs.h> |
| 9 |
#include <soc/pcr_ids.h> |
| 10 |
#include <superio/aspeed/ast2400/ast2400.h> |
| 11 |
#include <superio/aspeed/common/aspeed.h> |
| 12 |
#include <superio/nuvoton/common/nuvoton.h> |
| 13 |
#include <superio/nuvoton/nct6791d/nct6791d.h> |
| 14 |
#include <device/pnp_ops.h> |
| 15 |
|
| 16 |
#define PCR_DMI_LPCIOD 0x2770 |
| 17 |
#define PCR_DMI_LPCIOE 0x2774 |
| 18 |
|
| 19 |
void bootblock_mainboard_early_init(void) |
| 20 |
{ |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
const uint16_t lpciod = (LPC_IOD_COMB_RANGE | LPC_IOD_COMA_RANGE); |
| 26 |
const uint16_t lpcioe = (LPC_IOE_EC_4E_4F | LPC_IOE_COMB_EN | LPC_IOE_COMA_EN); |
| 27 |
|
| 28 |
|
| 29 |
pcr_or32(PID_DMI, PCR_DMI_LPCIOD, lpciod); |
| 30 |
|
| 31 |
pcr_or32(PID_DMI, PCR_DMI_LPCIOE, lpcioe); |
| 32 |
|
| 33 |
|
| 34 |
pci_write_config16(PCH_DEV_LPC, LPC_IO_DECODE, lpciod); |
| 35 |
pci_write_config16(PCH_DEV_LPC, LPC_IO_ENABLES, lpcioe); |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
const pnp_devfn_t nvt_serial_dev = PNP_DEV(0x2E, NCT6791D_SP1); |
| 42 |
nuvoton_pnp_enter_conf_state(nvt_serial_dev); |
| 43 |
pnp_set_logical_device(nvt_serial_dev); |
| 44 |
pnp_set_enable(nvt_serial_dev, 0); |
| 45 |
nuvoton_pnp_exit_conf_state(nvt_serial_dev); |
| 46 |
|
| 47 |
|
| 48 |
const pnp_devfn_t ast_serial_dev = PNP_DEV(0x4E, AST2400_SUART1); |
| 49 |
aspeed_enable_serial(ast_serial_dev, CONFIG_TTYS0_BASE); |
| 50 |
} |