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