1 /* Copyright 2000 AG Electronics Ltd. */
2 /* Copyright 2003-2004 Linux Networx */
4 By LYH change from PC87360 */
5 /* This code is distributed without warranty under the GPL v2 (see COPYING) */
8 #include <device/device.h>
9 #include <device/pnp.h>
10 #include <console/console.h>
14 #include <pc80/keyboard.h>
16 #include "w83627thf.h"
18 static void init(device_t dev)
20 struct superio_winbond_w83627thf_config *conf;
21 struct resource *res0, *res1;
22 /* Wishlist handle well known programming interfaces more
28 conf = dev->chip_info;
29 switch(dev->path.u.pnp.device) {
31 res0 = find_resource(dev, PNP_IDX_IO0);
32 init_uart8250(res0->base, &conf->com1);
35 res0 = find_resource(dev, PNP_IDX_IO0);
36 init_uart8250(res0->base, &conf->com2);
39 res0 = find_resource(dev, PNP_IDX_IO0);
40 res1 = find_resource(dev, PNP_IDX_IO1);
41 init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
46 static struct device_operations ops = {
47 .read_resources = pnp_read_resources,
48 .set_resources = pnp_set_resources,
49 .enable_resources = pnp_enable_resources,
54 static struct pnp_info pnp_dev_info[] = {
55 { &ops, W83627HF_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07f8, 0}, },
56 { &ops, W83627HF_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07f8, 0}, },
57 { &ops, W83627HF_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
58 { &ops, W83627HF_SP2, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
60 { &ops, W83627HF_KBC, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_IRQ1, { 0x7ff, 0 }, { 0x7ff, 0x4}, },
61 { &ops, W83627HF_CIR, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
62 { &ops, W83627HF_GAME_MIDI_GPIO1, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7ff, 0 }, {0x7fe, 4} },
63 // { W83627HF_GPIO2,},
64 // { W83627HF_GPIO3,},
65 { &ops, W83627HF_ACPI, PNP_IRQ0, },
66 { &ops, W83627HF_HWM, PNP_IO0 | PNP_IRQ0, { 0xff8, 0 } },
69 static void enable_dev(device_t dev)
71 pnp_enable_device(dev, &pnp_ops,
72 sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
75 struct chip_operations superio_winbond_w83627thf_control = {
76 .enable_dev = enable_dev,
77 .name = "Winbond w83627thf"