| 1 |
|
| 2 |
|
| 3 |
#include <bootblock_common.h> |
| 4 |
#include <device/pnp_ops.h> |
| 5 |
#include <superio/nuvoton/common/nuvoton.h> |
| 6 |
#include <superio/nuvoton/nct6687d/nct6687d.h> |
| 7 |
|
| 8 |
#define GLOBAL_DEV PNP_DEV(0x2e, 0) |
| 9 |
|
| 10 |
#define SERIAL_DEV PNP_DEV(0x2e, NCT6687D_SP2) |
| 11 |
#define POWER_DEV PNP_DEV(0x2e, NCT6687D_SLEEP_PWR) |
| 12 |
|
| 13 |
void bootblock_mainboard_early_init(void) |
| 14 |
{ |
| 15 |
nuvoton_pnp_enter_conf_state(GLOBAL_DEV); |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
pnp_write_config(GLOBAL_DEV, 0x13, 0x0c); |
| 24 |
|
| 25 |
pnp_write_config(GLOBAL_DEV, 0x15, 0xf0); |
| 26 |
|
| 27 |
pnp_write_config(GLOBAL_DEV, 0x1a, 0x07); |
| 28 |
pnp_write_config(GLOBAL_DEV, 0x1b, 0xf0); |
| 29 |
pnp_write_config(GLOBAL_DEV, 0x1d, 0x08); |
| 30 |
|
| 31 |
pnp_write_config(GLOBAL_DEV, 0x1e, 0xfc); |
| 32 |
|
| 33 |
pnp_write_config(GLOBAL_DEV, 0x1f, 0xf0); |
| 34 |
pnp_write_config(GLOBAL_DEV, 0x22, 0xbc); |
| 35 |
pnp_write_config(GLOBAL_DEV, 0x23, 0xdf); |
| 36 |
|
| 37 |
pnp_write_config(GLOBAL_DEV, 0x24, 0x61); |
| 38 |
pnp_write_config(GLOBAL_DEV, 0x25, 0xff); |
| 39 |
|
| 40 |
pnp_write_config(GLOBAL_DEV, 0x27, 0xbe); |
| 41 |
pnp_write_config(GLOBAL_DEV, 0x29, 0xfd); |
| 42 |
|
| 43 |
pnp_write_config(GLOBAL_DEV, 0x2a, 0xcf); |
| 44 |
|
| 45 |
|
| 46 |
pnp_set_logical_device(POWER_DEV); |
| 47 |
pnp_write_config(POWER_DEV, 0xf3, 0x0c); |
| 48 |
|
| 49 |
nuvoton_pnp_exit_conf_state(GLOBAL_DEV); |
| 50 |
|
| 51 |
|
| 52 |
nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); |
| 53 |
} |