1#include <device/pnp_def.h>
2
3#define NSC_WD_DEV PNP_DEV(0x2e, 0xa)
4#define NSC_WDBASE 0x600
5#define ESB6300_WDBASE 0x400
6#define ESB6300_GPIOBASE 0x500
7
8static void disable_sio_watchdog(device_t dev)
9{
10#if 0
11
12 pnp_set_logical_device(dev);
13 pnp_set_enable(dev, 1);
14 pnp_set_iobase(dev, PNP_IDX_IO0, NSC_WDBASE);
15
16 outb(0, NSC_WDBASE + 0);
17 pnp_set_enable(dev, 0);
18#endif
19}
20
21static void disable_esb6300_watchdog(void)
22{
23
24 device_t dev;
25 unsigned long value, base;
26 dev = pci_locate_device(PCI_ID(0x8086, 0x25a1), 0);
27 if (dev == PCI_DEV_INVALID) {
28 die("Missing esb6300?");
29 }
30
31 value = pci_read_config16(dev, 0x04);
32 value |= (1 << 10);
33 pci_write_config16(dev, 0x04, value);
34
35
36 pci_write_config32(dev, 0x40, ESB6300_WDBASE | 1);
37 pci_write_config8(dev, 0x44, 0x10);
38 base = ESB6300_WDBASE + 0x60;
39
40
41 value = inw(base + 0x08);
42 value |= 1 << 11;
43 outw(value, base + 0x08);
44
45
46 outw(0x0008, base + 0x04);
47 outw(0x0002, base + 0x06);
48}
49
50static void disable_jarell_frb3(void)
51{
52#if 0
53 device_t dev;
54 unsigned long value, base;
55 dev = pci_locate_device(PCI_ID(0x8086, 0x25a1), 0);
56 if (dev == PCI_DEV_INVALID) {
57 die("Missing esb6300?");
58 }
59
60 value = pci_read_config16(dev, 0x04);
61 value |= (1 << 0);
62 pci_write_config16(dev, 0x04, value);
63
64
65 pci_write_config32(dev, 0x58, ESB6300_GPIOBASE | 1);
66 base = ESB6300_GPIOBASE;
67
68
69 value = pci_read_config32(dev, 0x5c);
70 value |= 0x10;
71 pci_write_config32(dev, 0x5c, value);
72
73
74 value = inl(base + 0x30);
75 value |= (1 << 16) | ( 1 << 8);
76 outl(value, base + 0x30);
77
78
79 value = inl(base + 0x34);
80 value &= ~(1 << 16);
81 outl(value, base + 0x34);
82
83
84 value = inl(base + 0x38);
85 value |= (1 << 16);
86 outl(value, base + 0x38);
87 value &= ~(1 << 16);
88 outl(value, base + 0x38);
89#endif
90}
91
92static void disable_watchdogs(void)
93{
94
95 disable_esb6300_watchdog();
96
97 print_debug("Watchdogs disabled\n");
98}
99
100