2 * Copyright (C) 2016 Stefan Roese <sr@denx.de>
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <nuvoton_nct6102d.h>
10 #include <asm/pnp_def.h>
12 static void superio_outb(int reg, int val)
18 static inline int superio_inb(int reg)
24 static int superio_enter(void)
26 outb(NCT_ENTRY_KEY, NCT_EFER); /* Enter extended function mode */
27 outb(NCT_ENTRY_KEY, NCT_EFER); /* Again according to manual */
32 static void superio_select(int ld)
34 superio_outb(NCT_LD_SELECT_REG, ld);
37 static void superio_exit(void)
39 outb(NCT_EXIT_KEY, NCT_EFER); /* Leave extended function mode */
43 * The Nuvoton NCT6102D starts per default after reset with both,
44 * the internal watchdog and the internal legacy UART enabled. This
45 * code provides a function to disable the watchdog.
47 int nct6102d_wdt_disable(void)
50 /* Select logical device for WDT */
51 superio_select(NCT6102D_LD_WDT);
52 superio_outb(NCT6102D_WDT_TIMEOUT, 0x00);