blob: 1ffd896e26571de37f7e6e84d57f3c57c73a64d1 [file] [log] [blame]
Angel Pons09481b12020-04-03 01:21:13 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Iru Cai928c6c62017-06-15 18:18:51 +08002
Arthur Heymansfa5d0f82019-11-12 19:11:50 +01003#include <bootblock_common.h>
Kyösti Mälkki3855c012019-03-03 08:45:19 +02004#include <device/pnp_ops.h>
Patrick Rudolphda9302a2019-03-24 17:01:41 +01005#include <southbridge/intel/bd82x6x/pch.h>
Iru Cai928c6c62017-06-15 18:18:51 +08006#include <superio/nuvoton/nct6776/nct6776.h>
7#include <superio/nuvoton/common/nuvoton.h>
8
9#define SERIAL_DEV PNP_DEV(0x2e, NCT6776_SP1)
10
Arthur Heymansfa5d0f82019-11-12 19:11:50 +010011void bootblock_mainboard_early_init(void)
Iru Cai928c6c62017-06-15 18:18:51 +080012{
13 /* Set GPIOs on superio, enable UART */
14 nuvoton_pnp_enter_conf_state(SERIAL_DEV);
15 pnp_set_logical_device(SERIAL_DEV);
16
17 pnp_write_config(SERIAL_DEV, 0x1c, 0x80);
18 pnp_write_config(SERIAL_DEV, 0x27, 0x80);
19 pnp_write_config(SERIAL_DEV, 0x2a, 0x60);
20
21 nuvoton_pnp_exit_conf_state(SERIAL_DEV);
22
23 nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
24}