1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <arch/io.h>
23#include <device/device.h>
24#include <device/pnp.h>
25#include <console/console.h>
26#include <string.h>
27#include <bitops.h>
28#include <uart8250.h>
29#include <pc80/keyboard.h>
30#include <stdlib.h>
31#include "chip.h"
32#include "pc87360.h"
33
34static void init(device_t dev)
35{
36 struct superio_nsc_pc87360_config *conf = dev->chip_info;
37
38 if (!dev->enabled)
39 return;
40
41 switch(dev->path.pnp.device) {
42 case PC87360_KBCK:
43 pc_keyboard_init(&conf->keyboard);
44 break;
45 }
46}
47
48static struct device_operations ops = {
49 .read_resources = pnp_read_resources,
50 .set_resources = pnp_set_resources,
51 .enable_resources = pnp_enable_resources,
52 .enable = pnp_enable,
53 .init = init,
54};
55
56static struct pnp_info pnp_dev_info[] = {
57 { &ops, PC87360_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x07fa, 0}, },
58 { &ops, PC87360_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x04f8, 0}, },
59 { &ops, PC87360_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, {0x07f8, 0}, },
60 { &ops, PC87360_SP1, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
61 { &ops, PC87360_SWC, PNP_IO0 | PNP_IRQ0, {0xfff0, 0}, },
62 { &ops, PC87360_KBCM, PNP_IRQ0, },
63 { &ops, PC87360_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x07f8, 0}, {0x07f8, 4}, },
64 { &ops, PC87360_GPIO, PNP_IO0 | PNP_IRQ0, {0xfff8, 0}, },
65 { &ops, PC87360_ACB, PNP_IO0 | PNP_IRQ0, {0xfff8, 0}, },
66 { &ops, PC87360_FSCM, PNP_IO0 | PNP_IRQ0, {0xfff8, 0}, },
67 { &ops, PC87360_WDT, PNP_IO0 | PNP_IRQ0, {0xfffc, 0}, },
68};
69
70static void enable_dev(struct device *dev)
71{
72 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
73}
74
75struct chip_operations superio_nsc_pc87360_ops = {
76 CHIP_NAME("NSC PC87360 Super I/O")
77 .enable_dev = enable_dev,
78};
79