Debian Codegraph @

src/mainboard/asrock/z87_pro4/bootblock.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <device/pnp_ops.h>
4 #include <superio/nuvoton/common/nuvoton.h>
5 #include <superio/nuvoton/nct6776/nct6776.h>
6 #include <southbridge/intel/lynxpoint/pch.h>
7
8 #define GLOBAL_DEV PNP_DEV(0x2e, 0)
9 #define SERIAL_DEV PNP_DEV(0x2e, NCT6776_SP1)
10 #define ACPI_DEV PNP_DEV(0x2e, NCT6776_ACPI)
11
12
13 void mainboard_config_superio(void)
14 {
15 nuvoton_pnp_enter_conf_state(GLOBAL_DEV);
16
17 /* Select SIO pin mux states */
18 pnp_write_config(GLOBAL_DEV, 0x24, 0x5c);
19 pnp_write_config(GLOBAL_DEV, 0x27, 0xd0);
20 pnp_write_config(GLOBAL_DEV, 0x2a, 0x60);
21 pnp_write_config(GLOBAL_DEV, 0x2c, 0x80);
22 pnp_write_config(GLOBAL_DEV, 0x2f, 0x01);
23
24 /* Power RAM in S3 and let the PCH handle power failure actions */
25 pnp_set_logical_device(ACPI_DEV);
26 pnp_write_config(ACPI_DEV, 0xe4, 0x70);
27
28 nuvoton_pnp_exit_conf_state(GLOBAL_DEV);
29
30 /* Enable UART */
31 nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
32 }