| 1 |
|
| 2 |
|
| 3 |
#include <bootblock_common.h> |
| 4 |
#include <device/pnp_ops.h> |
| 5 |
#include <northbridge/intel/sandybridge/raminit.h> |
| 6 |
#include <northbridge/intel/sandybridge/pei_data.h> |
| 7 |
|
| 8 |
#include <superio/nuvoton/common/nuvoton.h> |
| 9 |
#include <superio/nuvoton/nct6779d/nct6779d.h> |
| 10 |
|
| 11 |
#include <option.h> |
| 12 |
|
| 13 |
#define SERIAL_DEV PNP_DEV(CONFIG_SUPERIO_PNP_BASE, NCT6779D_SP1) |
| 14 |
#define GPIO0_DEV PNP_DEV(CONFIG_SUPERIO_PNP_BASE, NCT6779D_WDT1_GPIO01_V) |
| 15 |
#define ACPI_DEV PNP_DEV(CONFIG_SUPERIO_PNP_BASE, NCT6779D_ACPI) |
| 16 |
|
| 17 |
void bootblock_mainboard_early_init(void) |
| 18 |
{ |
| 19 |
nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); |
| 20 |
|
| 21 |
nuvoton_pnp_enter_conf_state(GPIO0_DEV); |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
pnp_set_logical_device(GPIO0_DEV); |
| 26 |
pnp_write_config(GPIO0_DEV, 0x30, 0x02); |
| 27 |
pnp_write_config(GPIO0_DEV, 0xe0, 0x7f); |
| 28 |
pnp_write_config(GPIO0_DEV, 0xe1, 0x00); |
| 29 |
|
| 30 |
pnp_set_logical_device(ACPI_DEV); |
| 31 |
pnp_write_config(ACPI_DEV, 0xe4, 0x10); |
| 32 |
pnp_write_config(ACPI_DEV, 0xe7, 0x11); |
| 33 |
pnp_write_config(ACPI_DEV, 0xf2, 0x5d); |
| 34 |
|
| 35 |
nuvoton_pnp_exit_conf_state(GPIO0_DEV); |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
} |
| 43 |
|
| 44 |
void mainboard_fill_pei_data(struct pei_data *pei) |
| 45 |
{ |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
pei->usb3.mode = get_uint_option("usb3_mode", 1) & 0x3; |
| 58 |
|
| 59 |
pei->usb3.preboot_support = get_uint_option("usb3_drv", 1) & 0x1; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
pei->usb3.xhci_streams = get_uint_option("usb3_streams", 1) & 0x1; |
| 65 |
} |