mb/amb/birman*/gpio: remove configuration for VDD_MEM_VID[0,1]
[coreboot2.git] / src / superio / nuvoton / nct5104d / early_init.c
blobc5e9388ebde3749f7331ec97768fa50586d7780e
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <arch/io.h>
4 #include <device/pnp.h>
5 #include <stdint.h>
6 #include "nct5104d.h"
8 #define NUVOTON_ENTRY_KEY 0x87
9 #define NUVOTON_EXIT_KEY 0xAA
11 /* Enable configuration: pass entry key '0x87' into index port dev
12 * two times. */
13 static void pnp_enter_conf_state(pnp_devfn_t dev)
15 u16 port = dev >> 8;
16 outb(NUVOTON_ENTRY_KEY, port);
17 outb(NUVOTON_ENTRY_KEY, port);
20 /* Disable configuration: pass exit key '0xAA' into index port dev. */
21 static void pnp_exit_conf_state(pnp_devfn_t dev)
23 u16 port = dev >> 8;
24 outb(NUVOTON_EXIT_KEY, port);
27 /* Route UARTD to pins 41-48 */
28 void nct5104d_enable_uartd(pnp_devfn_t dev)
30 u8 tmp;
31 u16 port = dev >> 8;
32 pnp_enter_conf_state(dev);
33 outb(0x1c, port);
34 tmp = inb(port + 1);
35 tmp |= 0x04;
36 outb(tmp, port + 1);
37 pnp_exit_conf_state(dev);