+++ /dev/null
-config chip.h
-object superio.o
+++ /dev/null
-struct chip_operations;
-extern struct chip_operations superio_nsc_pc8374_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc8374_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
+++ /dev/null
-#define PC8374_FDC 0x00 /* Floppy */
-#define PC8374_PP 0x01 /* Parallel port */
-#define PC8374_SP2 0x02 /* Com2 */
-#define PC8374_SP1 0x03 /* Com1 */
-#define PC8374_SWC 0x04
-#define PC8374_KBCM 0x05 /* Mouse */
-#define PC8374_KBCK 0x06 /* Keyboard */
-#define PC8374_GPIO 0x07
-#define PC8374_HM 0x08
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc8374.h"
-
-
-static void pc8374_enable_serial(device_t dev, unsigned iobase)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 1);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* Copyright 2003-2004 Linux Networx */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-#include <arch/io.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include <console/console.h>
-#include <string.h>
-#include <bitops.h>
-#include <uart8250.h>
-#include <pc80/keyboard.h>
-#include "chip.h"
-#include "pc8374.h"
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc8374_config *conf;
- struct resource *res0, *res1;
- /* Wishlist handle well known programming interfaces more
- * generically.
- */
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC8374_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
- case PC8374_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
- case PC8374_KBCK:
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC8374_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
- { &ops, PC8374_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
- { &ops, PC8374_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
- { &ops, PC8374_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
- { &ops, PC8374_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
- { &ops, PC8374_KBCM, PNP_IRQ0 },
- { &ops, PC8374_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
- { &ops, PC8374_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
-};
-
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc8374_ops = {
- CHIP_NAME("NSC 8374")
- .enable_dev = enable_dev,
-};
+++ /dev/null
-config chip.h
-object superio.o
+++ /dev/null
-struct chip_operations;
-extern struct chip_operations superio_nsc_pc87351_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc87351_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
+++ /dev/null
-#define PC87351_FDC 0x00 /* Floppy */
-#define PC87351_PP 0x01 /* Parallel port */
-#define PC87351_SP2 0x02 /* Com2 */
-#define PC87351_SP1 0x03 /* Com1 */
-#define PC87351_SWC 0x04 /* System wakeup control */
-#define PC87351_KBCM 0x05 /* Mouse */
-#define PC87351_KBCK 0x06 /* Keyboard */
-#define PC87351_GPIO 0x07 /* General purpose IO */
-#define PC87351_FSD 0x08 /* Fan speed device */
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc87351.h"
-
-static void pc87351_enable_serial(device_t dev, unsigned iobase)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* Copyright 2003-2004 Linux Networx */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-/*
- * Richard A Smith
- * I derived this code from the pc87360 device and removed the stuff the 87351
- * dosen't do.
-*/
-
-#include <arch/io.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include <console/console.h>
-#include <string.h>
-#include <bitops.h>
-#include <uart8250.h>
-#include <pc80/keyboard.h>
-#include "chip.h"
-#include "pc87351.h"
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc87351_config *conf;
- struct resource *res0, *res1;
- /* Wishlist handle well known programming interfaces more
- * generically.
- */
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC87351_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
- case PC87351_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
- case PC87351_KBCK:
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC87351_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
- { &ops, PC87351_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
- { &ops, PC87351_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
- { &ops, PC87351_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
- { &ops, PC87351_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
- { &ops, PC87351_KBCM, PNP_IRQ0 },
- { &ops, PC87351_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
- { &ops, PC87351_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87351_FSD, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
-};
-
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &pnp_ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc87351_ops = {
- CHIP_NAME("NSC 87351")
- .enable_dev = enable_dev,
-};
+++ /dev/null
-config chip.h
-object superio.o
+++ /dev/null
-struct chip_operations;
-extern struct chip_operations superio_nsc_pc87360_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc87360_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
+++ /dev/null
-#define PC87360_FDC 0x00 /* Floppy */
-#define PC87360_PP 0x01 /* Parallel port */
-#define PC87360_SP2 0x02 /* Com2 */
-#define PC87360_SP1 0x03 /* Com1 */
-#define PC87360_SWC 0x04
-#define PC87360_KBCM 0x05 /* Mouse */
-#define PC87360_KBCK 0x06 /* Keyboard */
-#define PC87360_GPIO 0x07
-#define PC87360_ACB 0x08
-#define PC87360_FSCM 0x09
-#define PC87360_WDT 0x0A
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc87360.h"
-
-
-static void pc87360_enable_serial(device_t dev, unsigned iobase)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* Copyright 2003-2004 Linux Networx */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-#include <arch/io.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include <console/console.h>
-#include <string.h>
-#include <bitops.h>
-#include <uart8250.h>
-#include <pc80/keyboard.h>
-#include "chip.h"
-#include "pc87360.h"
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc87360_config *conf;
- struct resource *res0, *res1;
- /* Wishlist handle well known programming interfaces more
- * generically.
- */
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC87360_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
- case PC87360_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
- case PC87360_KBCK:
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC87360_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
- { &ops, PC87360_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
- { &ops, PC87360_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
- { &ops, PC87360_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
- { &ops, PC87360_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
- { &ops, PC87360_KBCM, PNP_IRQ0 },
- { &ops, PC87360_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
- { &ops, PC87360_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87360_ACB, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87360_FSCM, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87360_WDT, PNP_IO0 | PNP_IRQ0, { 0xfffc, 0 } },
-};
-
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc87360_ops = {
- CHIP_NAME("NSC 87360")
- .enable_dev = enable_dev,
-};
+++ /dev/null
-config chip.h
-object superio.o
+++ /dev/null
-extern struct chip_operations superio_nsc_pc87366_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc87366_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
+++ /dev/null
-#define PC87366_FDC 0x00 /* Floppy */
-#define PC87366_PP 0x01 /* Parallel port */
-#define PC87366_SP2 0x02 /* Com2 */
-#define PC87366_SP1 0x03 /* Com1 */
-#define PC87366_SWC 0x04
-#define PC87366_KBCM 0x05 /* Mouse */
-#define PC87366_KBCK 0x06 /* Keyboard */
-#define PC87366_GPIO 0x07
-#define PC87366_ACB 0x08
-#define PC87366_FSCM 0x09
-#define PC87366_WDT 0x0A
-#define PC87366_GMP 0x0b
-#define PC87366_MIDI 0x0C
-#define PC87366_VLM 0x0D
-#define PC87366_TMS 0x0E
-
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc87366.h"
-
-
-static void pc87366_enable_serial(device_t dev, unsigned iobase)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* Copyright 2003-2004 Linux Networx */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-#include <arch/io.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include <console/console.h>
-#include <string.h>
-#include <bitops.h>
-#include <uart8250.h>
-#include <pc80/keyboard.h>
-#include "chip.h"
-#include "pc87366.h"
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc87366_config *conf;
- struct resource *res0, *res1;
- /* Wishlist handle well known programming interfaces more
- * generically.
- */
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC87366_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
- case PC87366_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
- case PC87366_KBCK:
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC87366_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
- { &ops, PC87366_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
- { &ops, PC87366_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
- { &ops, PC87366_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
- { &ops, PC87366_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
- { &ops, PC87366_KBCM, PNP_IRQ0 },
- { &ops, PC87366_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
- { &ops, PC87366_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87366_ACB, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87366_FSCM, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87366_WDT, PNP_IO0 | PNP_IRQ0, { 0xfffc, 0 } },
-};
-
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &pnp_ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc87366_ops = {
- CHIP_NAME("NSC 87366")
- .enable_dev = enable_dev,
-};
+++ /dev/null
-config chip.h
-object superio.o
+++ /dev/null
-extern struct chip_operations superio_nsc_pc87417_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc87417_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
+++ /dev/null
-#define PC87417_FDC 0x00 /* Floppy */
-#define PC87417_PP 0x01 /* Parallel Port */
-#define PC87417_SP2 0x02 /* Com2 */
-#define PC87417_SP1 0x03 /* Com1 */
-#define PC87417_SWC 0x04 /* System Wake-Up Controller (SWC) */
-#define PC87417_KBCM 0x05 /* Mouse */
-#define PC87417_KBCK 0x06 /* Keyboard */
-#define PC87417_GPIO 0x07
-#define PC87417_XBUS 0x0F
-#define PC87417_RTC 0x10
-
-#define PC87417_GPIO_DEV PNP_DEV(0x2e, PC87417_GPIO)
-/* This is to get around a romcc bug */
-//#define PC87417_XBUS_DEV PNP_DEV(0x2e, PC87417_XBUS)
-#define PC87417_XBUS_DEV PNP_DEV(0x2e, 0x0f)
-
-#define PC87417_GPSEL 0xf0
-#define PC87417_GPCFG1 0xf1
-#define PC87417_GPEVR 0xf2
-#define PC87417_GPCFG2 0xf3
-#define PC87417_EXTCFG 0xf4
-#define PC87417_IOEXT1A 0xf5
-#define PC87417_IOEXT1B 0xf6
-#define PC87417_IOEXT2A 0xf7
-#define PC87417_IOEXT2B 0xf8
-
-#define PC87417_GPDO_0 0x00
-#define PC87417_GPDI_0 0x01
-#define PC87417_GPDO_1 0x02
-#define PC87417_GPDI_1 0x03
-#define PC87417_GPEVEN_1 0x04
-#define PC87417_GPEVST_1 0x05
-#define PC87417_GPDO_2 0x06
-#define PC87417_GPDI_2 0x07
-#define PC87417_GPDO_3 0x08
-#define PC87417_GPDI_3 0x09
-#define PC87417_GPDO_4 0x0a
-#define PC87417_GPDI_4 0x0b
-#define PC87417_GPEVEN_4 0x0c
-#define PC87417_GPEVST_4 0x0d
-#define PC87417_GPDO_5 0x0e
-#define PC87417_GPDI_5 0x0f
-#define PC87417_GPDO_6 0x10
-#define PC87417_GPDO_7A 0x11
-#define PC87417_GPDO_7B 0x12
-#define PC87417_GPDO_7C 0x13
-#define PC87417_GPDO_7D 0x14
-#define PC87417_GPDI_7A 0x15
-#define PC87417_GPDI_7B 0x16
-#define PC87417_GPDI_7C 0x17
-#define PC87417_GPDI_7D 0x18
-
-#define PC87417_XIOCNF 0xf0
-#define PC87417_XIOBA1H 0xf1
-#define PC87417_XIOBA1L 0xf2
-#define PC87417_XIOSIZE1 0xf3
-#define PC87417_XIOBA2H 0xf4
-#define PC87417_XIOBA2L 0xf5
-#define PC87417_XIOSIZE2 0xf6
-#define PC87417_XMEMCNF1 0xf7
-#define PC87417_XMEMCNF2 0xf8
-#define PC87417_XMEMBAH 0xf9
-#define PC87417_XMEMBAL 0xfa
-#define PC87417_XMEMSIZE 0xfb
-#define PC87417_XIRQMAP1 0xfc
-#define PC87417_XIRQMAP2 0xfd
-#define PC87417_XBIMM 0xfe
-#define PC87417_XBBSL 0xff
-
-#define PC87417_XBCNF 0x00
-#define PC87417_XZCNF0 0x01
-#define PC87417_XZCNF1 0x02
-#define PC87417_XIRQC0 0x04
-#define PC87417_XIRQC1 0x05
-#define PC87417_XIRQC2 0x06
-#define PC87417_XIMA0 0x08
-#define PC87417_XIMA1 0x09
-#define PC87417_XIMA2 0x0a
-#define PC87417_XIMA3 0x0b
-#define PC87417_XIMD 0x0c
-#define PC87417_XZCNF2 0x0d
-#define PC87417_XZCNF3 0x0e
-#define PC87417_XZM0 0x0f
-#define PC87417_XZM1 0x10
-#define PC87417_XZM2 0x11
-#define PC87417_XZM3 0x12
-#define PC87417_HAP0 0x13
-#define PC87417_HAP1 0x14
-#define PC87417_XSCNF 0x15
-#define PC87417_XWBCNF 0x16
-
-
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc87417.h"
-
-static void pc87417_disable_dev(device_t dev)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
-}
-static void pc87417_enable_dev(device_t dev, unsigned iobase)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
-static void xbus_cfg(device_t dev)
-{
- uint8_t i, data;
- uint16_t xbus_index;
-
- pnp_set_logical_device(dev);
- /* select proper BIOS size (4MB) */
- pnp_write_config(dev, PC87417_XMEMCNF2, (pnp_read_config(dev, PC87417_XMEMCNF2)) | 0x04);
- xbus_index = pnp_read_iobase(dev, 0x60);
-
- /* enable writes to devices attached to XCS0 (XBUS Chip Select 0) */
- for (i=0; i<= 0xf; i++) {
- outb((i<<4), xbus_index + PC87417_HAP0);
- }
- return;
-}
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc87417.h"
-
-
-static void pc87417_enable_serial(device_t dev, unsigned iobase)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
-static void pc87417_enable_dev(device_t dev)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 1);
-}
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* Copyright 2003-2004 Linux Networx */
-/* Copyright 2005 Tyan */
-/* By yhlu */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-#include <arch/io.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include <console/console.h>
-#include <string.h>
-#include <bitops.h>
-#include <uart8250.h>
-#include <pc80/keyboard.h>
-#include "chip.h"
-#include "pc87417.h"
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc87417_config *conf;
- struct resource *res0, *res1;
- /* Wishlist handle well known programming interfaces more
- * generically.
- */
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC87417_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
- case PC87417_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
- case PC87417_KBCK:
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC87417_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
- { &ops, PC87417_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
- { &ops, PC87417_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
- { &ops, PC87417_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
- { &ops, PC87417_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
- { &ops, PC87417_KBCM, PNP_IRQ0 },
- { &ops, PC87417_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
- { &ops, PC87417_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
- { &ops, PC87417_XBUS, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
- { &ops, PC87417_RTC, PNP_IO0 | PNP_IO1, { 0xfffe, 0 }, {0xfffe, 0x4} },
-};
-
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &pnp_ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc87417_ops = {
- CHIP_NAME("NSC pc87417")
- .enable_dev = enable_dev,
-};
+++ /dev/null
-config chip.h
-object superio.o
+++ /dev/null
-extern struct chip_operations superio_nsc_pc87427_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc87427_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
+++ /dev/null
-#define PC87427_FDC 0x00 /* Floppy */
-#define PC87427_SP2 0x02 /* Com2 */
-#define PC87427_SP1 0x03 /* Com1 */
-#define PC87427_SWC 0x04
-#define PC87427_KBCM 0x05 /* Mouse */
-#define PC87427_KBCK 0x06 /* Keyboard */
-#define PC87427_GPIO 0x07
-#define PC87427_FMC 0x09
-#define PC87427_WDT 0x0A
-#define PC87427_XBUS 0x0F
-#define PC87427_RTC 0x10
-#define PC87427_MHC 0x14
-
-#define PC87427_GPIO_DEV PNP_DEV(0x2e, PC87427_GPIO)
-/* This is to get around a romcc bug */
-//#define PC87427_XBUS_DEV PNP_DEV(0x2e, PC87427_XBUS)
-#define PC87427_XBUS_DEV PNP_DEV(0x2e, 0x0f)
-
-#define PC87427_GPSEL 0xf0
-#define PC87427_GPCFG1 0xf1
-#define PC87427_GPEVR 0xf2
-#define PC87427_GPCFG2 0xf3
-#define PC87427_EXTCFG 0xf4
-#define PC87427_IOEXT1A 0xf5
-#define PC87427_IOEXT1B 0xf6
-#define PC87427_IOEXT2A 0xf7
-#define PC87427_IOEXT2B 0xf8
-
-#define PC87427_GPDO_0 0x00
-#define PC87427_GPDI_0 0x01
-#define PC87427_GPDO_1 0x02
-#define PC87427_GPDI_1 0x03
-#define PC87427_GPEVEN_1 0x04
-#define PC87427_GPEVST_1 0x05
-#define PC87427_GPDO_2 0x06
-#define PC87427_GPDI_2 0x07
-#define PC87427_GPDO_3 0x08
-#define PC87427_GPDI_3 0x09
-#define PC87427_GPDO_4 0x0a
-#define PC87427_GPDI_4 0x0b
-#define PC87427_GPEVEN_4 0x0c
-#define PC87427_GPEVST_4 0x0d
-#define PC87427_GPDO_5 0x0e
-#define PC87427_GPDI_5 0x0f
-#define PC87427_GPDO_6 0x10
-#define PC87427_GPDO_7A 0x11
-#define PC87427_GPDO_7B 0x12
-#define PC87427_GPDO_7C 0x13
-#define PC87427_GPDO_7D 0x14
-#define PC87427_GPDI_7A 0x15
-#define PC87427_GPDI_7B 0x16
-#define PC87427_GPDI_7C 0x17
-#define PC87427_GPDI_7D 0x18
-
-#define PC87427_XIOCNF 0xf0
-#define PC87427_XIOBA1H 0xf1
-#define PC87427_XIOBA1L 0xf2
-#define PC87427_XIOSIZE1 0xf3
-#define PC87427_XIOBA2H 0xf4
-#define PC87427_XIOBA2L 0xf5
-#define PC87427_XIOSIZE2 0xf6
-#define PC87427_XMEMCNF1 0xf7
-#define PC87427_XMEMCNF2 0xf8
-#define PC87427_XMEMBAH 0xf9
-#define PC87427_XMEMBAL 0xfa
-#define PC87427_XMEMSIZE 0xfb
-#define PC87427_XIRQMAP1 0xfc
-#define PC87427_XIRQMAP2 0xfd
-#define PC87427_XBIMM 0xfe
-#define PC87427_XBBSL 0xff
-
-#define PC87427_XBCNF 0x00
-#define PC87427_XZCNF0 0x01
-#define PC87427_XZCNF1 0x02
-#define PC87427_XIRQC0 0x04
-#define PC87427_XIRQC1 0x05
-#define PC87427_XIRQC2 0x06
-#define PC87427_XIMA0 0x08
-#define PC87427_XIMA1 0x09
-#define PC87427_XIMA2 0x0a
-#define PC87427_XIMA3 0x0b
-#define PC87427_XIMD 0x0c
-#define PC87427_XZCNF2 0x0d
-#define PC87427_XZCNF3 0x0e
-#define PC87427_XZM0 0x0f
-#define PC87427_XZM1 0x10
-#define PC87427_XZM2 0x11
-#define PC87427_XZM3 0x12
-#define PC87427_HAP0 0x13
-#define PC87427_HAP1 0x14
-#define PC87427_XSCNF 0x15
-#define PC87427_XWBCNF 0x16
-
-
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc87427.h"
-
-static void pc87427_disable_dev(device_t dev)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
-}
-static void pc87427_enable_dev(device_t dev, unsigned iobase)
-{
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
-static void xbus_cfg(device_t dev)
-{
- uint8_t i, data;
- uint16_t xbus_index;
-
- pnp_set_logical_device(dev);
- /* select proper BIOS size (4MB) */
- pnp_write_config(dev, PC87427_XMEMCNF2, (pnp_read_config(dev, PC87427_XMEMCNF2)) | 0x04);
- xbus_index = pnp_read_iobase(dev, 0x60);
-
- /* enable writes to devices attached to XCS0 (XBUS Chip Select 0) */
- for (i=0; i<= 0xf; i++) {
- outb((i<<4), xbus_index + PC87427_HAP0);
- }
- return;
-}
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* Copyright 2003-2004 Linux Networx */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-#include <arch/io.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include <console/console.h>
-#include <string.h>
-#include <bitops.h>
-#include "chip.h"
-#include "pc87427.h"
-
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc87427_config *conf;
- struct resource *res0, *res1;
- /* Wishlist handle well known programming interfaces more
- * generically.
- */
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC87427_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
- case PC87427_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
- case PC87427_KBCK:
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC87427_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
- { &ops, PC87427_SP2, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
- { &ops, PC87427_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
- { &ops, PC87427_SWC, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IO3 | PNP_IRQ0,
- { 0xfff0, 0 }, { 0xfffc, 0 }, { 0xfffc, 0 }, { 0xfff8, 0 } },
- { &ops, PC87427_KBCM, PNP_IRQ0 },
- { &ops, PC87427_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
- { &ops, PC87427_GPIO, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
- { &ops, PC87427_WDT, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 } },
- { &ops, PC87427_FMC, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
- { &ops, PC87427_XBUS, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
- { &ops, PC87427_RTC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xfffe, 0 }, { 0xfffe, 0 } },
- { &ops, PC87427_MHC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xffe0, 0 }, { 0xffe0, 0 } },
-};
-
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc87427_ops = {
- CHIP_NAME("NSC 87427")
- .enable_dev = enable_dev,
-};
+++ /dev/null
-config chip.h
-object superio.c
+++ /dev/null
-#ifndef _SUPERIO_NSC_PC97307
-#define _SUPERIO_NSC_PC97307
-
-#ifndef PNP_INDEX_REG
-#define PNP_INDEX_REG 0x15C
-#endif
-#ifndef PNP_DATA_REG
-#define PNP_DATA_REG 0x15D
-#endif
-
-extern struct chip_operations superio_nsc_pc97307_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc97307_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
-#endif /* _SUPERIO_NSC_PC97307 */
+++ /dev/null
-#define PC97307_KBCK 0x00 /* Keyboard */
-#define PC97307_KBCM 0x01 /* Mouse */
-#define PC97307_RTC 0x02 /* Real-Time Clock */
-#define PC97307_FDC 0x03 /* Floppy */
-#define PC97307_PP 0x04 /* Parallel port */
-#define PC97307_SP2 0x05 /* Com2 */
-#define PC97307_SP1 0x06 /* Com1 */
-#define PC97307_GPIO 0x07
-#define PC97307_PM 0x08 /* Power Management */
-
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-#include <arch/io.h>
-#include <console/console.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include "chip.h"
-#include "pc97307.h"
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc97307_config *conf;
- struct resource *res0, *res1;
-
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC97307_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
-
- case PC97307_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
-
- case PC97307_KBCK:
- /* Enable keyboard */
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0); /* Disable keyboard */
- pnp_write_config(dev, 0xf0, 0x40); /* Set KBC clock to 8 Mhz */
- pnp_set_enable(dev, 1); /* Enable keyboard */
-
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
-
- case PC97307_FDC:
- {
- unsigned reg;
- /* Set up floppy in PS/2 mode */
- outb(0x09, SIO_CONFIG_RA);
- reg = inb(SIO_CONFIG_RD);
- reg = (reg & 0x3F) | 0x40;
- outb(reg, SIO_CONFIG_RD);
- outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */
- break;
- }
- default:
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC97307_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xffb, 0 }, { 0xffb, 0x4}, },
- { &ops, PC97307_KBCM, PNP_IRQ0 },
- { &ops, PC97307_RTC, PNP_IO0 | PNP_IRQ0, { 0xfffe, 0}, },
- { &ops, PC97307_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0xfffa, 0}, },
- { &ops, PC97307_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x03fc, 0}, },
- { &ops, PC97307_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0xfff8, 0 }, },
- { &ops, PC97307_SP1, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 }, },
- { &ops, PC97307_GPIO, PNP_IO0, { 0xfff8, 0 } },
- { &ops, PC97307_PM, PNP_IO0, { 0xfffe, 0 } },
-};
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc97307_ops = {
- CHIP_NAME("NSC 97307")
- .enable_dev = enable_dev,
-};
+++ /dev/null
-config chip.h
-object superio.c
+++ /dev/null
-#ifndef _SUPERIO_NSC_PC97317
-#define _SUPERIO_NSC_PC97317
-
-#ifndef PNP_INDEX_REG
-#define PNP_INDEX_REG 0x15C
-#endif
-#ifndef PNP_DATA_REG
-#define PNP_DATA_REG 0x15D
-#endif
-
-extern struct chip_operations superio_nsc_pc97317_ops;
-
-#include <pc80/keyboard.h>
-#include <uart8250.h>
-
-struct superio_nsc_pc97317_config {
- struct uart8250 com1, com2;
- struct pc_keyboard keyboard;
-};
-#endif /* _SUPERIO_NSC_PC97317 */
+++ /dev/null
-#define PC97317_KBCK 0x00 /* Keyboard */
-#define PC97317_KBCM 0x01 /* Mouse */
-#define PC97317_RTC 0x02 /* Real-Time Clock */
-#define PC97317_FDC 0x03 /* Floppy */
-#define PC97317_PP 0x04 /* Parallel port */
-#define PC97317_SP2 0x05 /* Com2 */
-#define PC97317_SP1 0x06 /* Com1 */
-#define PC97317_GPIO 0x07
-#define PC97317_PM 0x08 /* Power Management */
-
+++ /dev/null
-#include <arch/romcc_io.h>
-#include "pc97317.h"
-
-#define PM_DEV PNP_DEV(0x2e, PC97317_PM)
-#define PM_BASE 0xe8
-
-/* The pc97317 needs clocks to be set up before the serial port will operate */
-
-static void pc97317_enable_serial(device_t dev, unsigned iobase)
-{
- /* Set base address of power management unit */
-
- pnp_set_logical_device(PM_DEV);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, PM_BASE);
- pnp_set_enable(dev, 1);
-
- /* Use on-chip clock multiplier */
-
- outb(0x03, PM_BASE);
- outb(inb(PM_BASE + 1) | 0x07, PM_BASE + 1);
-
- /* Wait for the clock to stabilise */
- while(!inb(PM_BASE + 1 & 0x80))
- ;
-
- /* Set the base address of the port */
-
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0);
- pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
- pnp_set_enable(dev, 1);
-}
+++ /dev/null
-/* Copyright 2000 AG Electronics Ltd. */
-/* This code is distributed without warranty under the GPL v2 (see COPYING) */
-
-#include <arch/io.h>
-#include <console/console.h>
-#include <device/device.h>
-#include <device/pnp.h>
-#include "chip.h"
-#include "pc97317.h"
-
-static void init(device_t dev)
-{
- struct superio_nsc_pc97317_config *conf;
- struct resource *res0, *res1;
-
- if (!dev->enabled) {
- return;
- }
- conf = dev->chip_info;
- switch(dev->path.u.pnp.device) {
- case PC97317_SP1:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com1);
- break;
-
- case PC97317_SP2:
- res0 = find_resource(dev, PNP_IDX_IO0);
- init_uart8250(res0->base, &conf->com2);
- break;
-
- case PC97317_KBCK:
- /* Enable keyboard */
- pnp_set_logical_device(dev);
- pnp_set_enable(dev, 0); /* Disable keyboard */
- pnp_write_config(dev, 0xf0, 0x40); /* Set KBC clock to 8 Mhz */
- pnp_set_enable(dev, 1); /* Enable keyboard */
-
- res0 = find_resource(dev, PNP_IDX_IO0);
- res1 = find_resource(dev, PNP_IDX_IO1);
- init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
- break;
-
-#if 0
- case PC97317_FDC:
- {
- unsigned reg;
- /* Set up floppy in PS/2 mode */
- outb(0x09, SIO_CONFIG_RA);
- reg = inb(SIO_CONFIG_RD);
- reg = (reg & 0x3F) | 0x40;
- outb(reg, SIO_CONFIG_RD);
- outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */
- break;
- }
-#endif
- default:
- break;
- }
-}
-
-static struct device_operations ops = {
- .read_resources = pnp_read_resources,
- .set_resources = pnp_set_resources,
- .enable_resources = pnp_enable_resources,
- .enable = pnp_enable,
- .init = init,
-};
-
-static struct pnp_info pnp_dev_info[] = {
- { &ops, PC97317_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xffb, 0 }, { 0xffb, 0x4}, },
- { &ops, PC97317_KBCM, PNP_IRQ0 },
- { &ops, PC97317_RTC, PNP_IO0 | PNP_IRQ0, { 0xfffe, 0}, },
- { &ops, PC97317_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0xfffa, 0}, },
- { &ops, PC97317_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x03fc, 0}, },
- { &ops, PC97317_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0xfff8, 0 }, },
- { &ops, PC97317_SP1, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 }, },
- { &ops, PC97317_GPIO, PNP_IO0, { 0xfff8, 0 } },
- { &ops, PC97317_PM, PNP_IO0, { 0xfffe, 0 } },
-};
-
-static void enable_dev(struct device *dev)
-{
- pnp_enable_devices(dev, &ops,
- sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
-}
-
-struct chip_operations superio_nsc_pc97317_ops = {
- CHIP_NAME("NSC 97317")
- .enable_dev = enable_dev,
-};
--- /dev/null
+config chip.h
+object superio.o
--- /dev/null
+struct chip_operations;
+extern struct chip_operations superio_nsc_pc8374_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc8374_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
--- /dev/null
+#define PC8374_FDC 0x00 /* Floppy */
+#define PC8374_PP 0x01 /* Parallel port */
+#define PC8374_SP2 0x02 /* Com2 */
+#define PC8374_SP1 0x03 /* Com1 */
+#define PC8374_SWC 0x04
+#define PC8374_KBCM 0x05 /* Mouse */
+#define PC8374_KBCK 0x06 /* Keyboard */
+#define PC8374_GPIO 0x07
+#define PC8374_HM 0x08
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc8374.h"
+
+
+static void pc8374_enable_serial(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 1);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* Copyright 2003-2004 Linux Networx */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <arch/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <console/console.h>
+#include <string.h>
+#include <bitops.h>
+#include <uart8250.h>
+#include <pc80/keyboard.h>
+#include "chip.h"
+#include "pc8374.h"
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc8374_config *conf;
+ struct resource *res0, *res1;
+ /* Wishlist handle well known programming interfaces more
+ * generically.
+ */
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC8374_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+ case PC8374_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+ case PC8374_KBCK:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC8374_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
+ { &ops, PC8374_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
+ { &ops, PC8374_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
+ { &ops, PC8374_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, PC8374_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
+ { &ops, PC8374_KBCM, PNP_IRQ0 },
+ { &ops, PC8374_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
+ { &ops, PC8374_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+};
+
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc8374_ops = {
+ CHIP_NAME("NSC 8374")
+ .enable_dev = enable_dev,
+};
--- /dev/null
+config chip.h
+object superio.o
--- /dev/null
+struct chip_operations;
+extern struct chip_operations superio_nsc_pc87351_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc87351_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
--- /dev/null
+#define PC87351_FDC 0x00 /* Floppy */
+#define PC87351_PP 0x01 /* Parallel port */
+#define PC87351_SP2 0x02 /* Com2 */
+#define PC87351_SP1 0x03 /* Com1 */
+#define PC87351_SWC 0x04 /* System wakeup control */
+#define PC87351_KBCM 0x05 /* Mouse */
+#define PC87351_KBCK 0x06 /* Keyboard */
+#define PC87351_GPIO 0x07 /* General purpose IO */
+#define PC87351_FSD 0x08 /* Fan speed device */
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc87351.h"
+
+static void pc87351_enable_serial(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* Copyright 2003-2004 Linux Networx */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+/*
+ * Richard A Smith
+ * I derived this code from the pc87360 device and removed the stuff the 87351
+ * dosen't do.
+*/
+
+#include <arch/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <console/console.h>
+#include <string.h>
+#include <bitops.h>
+#include <uart8250.h>
+#include <pc80/keyboard.h>
+#include "chip.h"
+#include "pc87351.h"
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc87351_config *conf;
+ struct resource *res0, *res1;
+ /* Wishlist handle well known programming interfaces more
+ * generically.
+ */
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC87351_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+ case PC87351_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+ case PC87351_KBCK:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC87351_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
+ { &ops, PC87351_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
+ { &ops, PC87351_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
+ { &ops, PC87351_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, PC87351_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
+ { &ops, PC87351_KBCM, PNP_IRQ0 },
+ { &ops, PC87351_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
+ { &ops, PC87351_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87351_FSD, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+};
+
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &pnp_ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc87351_ops = {
+ CHIP_NAME("NSC 87351")
+ .enable_dev = enable_dev,
+};
--- /dev/null
+config chip.h
+object superio.o
--- /dev/null
+struct chip_operations;
+extern struct chip_operations superio_nsc_pc87360_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc87360_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
--- /dev/null
+#define PC87360_FDC 0x00 /* Floppy */
+#define PC87360_PP 0x01 /* Parallel port */
+#define PC87360_SP2 0x02 /* Com2 */
+#define PC87360_SP1 0x03 /* Com1 */
+#define PC87360_SWC 0x04
+#define PC87360_KBCM 0x05 /* Mouse */
+#define PC87360_KBCK 0x06 /* Keyboard */
+#define PC87360_GPIO 0x07
+#define PC87360_ACB 0x08
+#define PC87360_FSCM 0x09
+#define PC87360_WDT 0x0A
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc87360.h"
+
+
+static void pc87360_enable_serial(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* Copyright 2003-2004 Linux Networx */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <arch/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <console/console.h>
+#include <string.h>
+#include <bitops.h>
+#include <uart8250.h>
+#include <pc80/keyboard.h>
+#include "chip.h"
+#include "pc87360.h"
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc87360_config *conf;
+ struct resource *res0, *res1;
+ /* Wishlist handle well known programming interfaces more
+ * generically.
+ */
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC87360_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+ case PC87360_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+ case PC87360_KBCK:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC87360_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
+ { &ops, PC87360_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
+ { &ops, PC87360_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
+ { &ops, PC87360_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, PC87360_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
+ { &ops, PC87360_KBCM, PNP_IRQ0 },
+ { &ops, PC87360_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
+ { &ops, PC87360_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87360_ACB, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87360_FSCM, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87360_WDT, PNP_IO0 | PNP_IRQ0, { 0xfffc, 0 } },
+};
+
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc87360_ops = {
+ CHIP_NAME("NSC 87360")
+ .enable_dev = enable_dev,
+};
--- /dev/null
+config chip.h
+object superio.o
--- /dev/null
+extern struct chip_operations superio_nsc_pc87366_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc87366_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
--- /dev/null
+#define PC87366_FDC 0x00 /* Floppy */
+#define PC87366_PP 0x01 /* Parallel port */
+#define PC87366_SP2 0x02 /* Com2 */
+#define PC87366_SP1 0x03 /* Com1 */
+#define PC87366_SWC 0x04
+#define PC87366_KBCM 0x05 /* Mouse */
+#define PC87366_KBCK 0x06 /* Keyboard */
+#define PC87366_GPIO 0x07
+#define PC87366_ACB 0x08
+#define PC87366_FSCM 0x09
+#define PC87366_WDT 0x0A
+#define PC87366_GMP 0x0b
+#define PC87366_MIDI 0x0C
+#define PC87366_VLM 0x0D
+#define PC87366_TMS 0x0E
+
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc87366.h"
+
+
+static void pc87366_enable_serial(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* Copyright 2003-2004 Linux Networx */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <arch/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <console/console.h>
+#include <string.h>
+#include <bitops.h>
+#include <uart8250.h>
+#include <pc80/keyboard.h>
+#include "chip.h"
+#include "pc87366.h"
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc87366_config *conf;
+ struct resource *res0, *res1;
+ /* Wishlist handle well known programming interfaces more
+ * generically.
+ */
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC87366_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+ case PC87366_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+ case PC87366_KBCK:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC87366_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
+ { &ops, PC87366_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
+ { &ops, PC87366_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
+ { &ops, PC87366_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, PC87366_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
+ { &ops, PC87366_KBCM, PNP_IRQ0 },
+ { &ops, PC87366_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
+ { &ops, PC87366_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87366_ACB, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87366_FSCM, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87366_WDT, PNP_IO0 | PNP_IRQ0, { 0xfffc, 0 } },
+};
+
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &pnp_ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc87366_ops = {
+ CHIP_NAME("NSC 87366")
+ .enable_dev = enable_dev,
+};
--- /dev/null
+config chip.h
+object superio.o
--- /dev/null
+extern struct chip_operations superio_nsc_pc87417_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc87417_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
--- /dev/null
+#define PC87417_FDC 0x00 /* Floppy */
+#define PC87417_PP 0x01 /* Parallel Port */
+#define PC87417_SP2 0x02 /* Com2 */
+#define PC87417_SP1 0x03 /* Com1 */
+#define PC87417_SWC 0x04 /* System Wake-Up Controller (SWC) */
+#define PC87417_KBCM 0x05 /* Mouse */
+#define PC87417_KBCK 0x06 /* Keyboard */
+#define PC87417_GPIO 0x07
+#define PC87417_XBUS 0x0F
+#define PC87417_RTC 0x10
+
+#define PC87417_GPIO_DEV PNP_DEV(0x2e, PC87417_GPIO)
+/* This is to get around a romcc bug */
+//#define PC87417_XBUS_DEV PNP_DEV(0x2e, PC87417_XBUS)
+#define PC87417_XBUS_DEV PNP_DEV(0x2e, 0x0f)
+
+#define PC87417_GPSEL 0xf0
+#define PC87417_GPCFG1 0xf1
+#define PC87417_GPEVR 0xf2
+#define PC87417_GPCFG2 0xf3
+#define PC87417_EXTCFG 0xf4
+#define PC87417_IOEXT1A 0xf5
+#define PC87417_IOEXT1B 0xf6
+#define PC87417_IOEXT2A 0xf7
+#define PC87417_IOEXT2B 0xf8
+
+#define PC87417_GPDO_0 0x00
+#define PC87417_GPDI_0 0x01
+#define PC87417_GPDO_1 0x02
+#define PC87417_GPDI_1 0x03
+#define PC87417_GPEVEN_1 0x04
+#define PC87417_GPEVST_1 0x05
+#define PC87417_GPDO_2 0x06
+#define PC87417_GPDI_2 0x07
+#define PC87417_GPDO_3 0x08
+#define PC87417_GPDI_3 0x09
+#define PC87417_GPDO_4 0x0a
+#define PC87417_GPDI_4 0x0b
+#define PC87417_GPEVEN_4 0x0c
+#define PC87417_GPEVST_4 0x0d
+#define PC87417_GPDO_5 0x0e
+#define PC87417_GPDI_5 0x0f
+#define PC87417_GPDO_6 0x10
+#define PC87417_GPDO_7A 0x11
+#define PC87417_GPDO_7B 0x12
+#define PC87417_GPDO_7C 0x13
+#define PC87417_GPDO_7D 0x14
+#define PC87417_GPDI_7A 0x15
+#define PC87417_GPDI_7B 0x16
+#define PC87417_GPDI_7C 0x17
+#define PC87417_GPDI_7D 0x18
+
+#define PC87417_XIOCNF 0xf0
+#define PC87417_XIOBA1H 0xf1
+#define PC87417_XIOBA1L 0xf2
+#define PC87417_XIOSIZE1 0xf3
+#define PC87417_XIOBA2H 0xf4
+#define PC87417_XIOBA2L 0xf5
+#define PC87417_XIOSIZE2 0xf6
+#define PC87417_XMEMCNF1 0xf7
+#define PC87417_XMEMCNF2 0xf8
+#define PC87417_XMEMBAH 0xf9
+#define PC87417_XMEMBAL 0xfa
+#define PC87417_XMEMSIZE 0xfb
+#define PC87417_XIRQMAP1 0xfc
+#define PC87417_XIRQMAP2 0xfd
+#define PC87417_XBIMM 0xfe
+#define PC87417_XBBSL 0xff
+
+#define PC87417_XBCNF 0x00
+#define PC87417_XZCNF0 0x01
+#define PC87417_XZCNF1 0x02
+#define PC87417_XIRQC0 0x04
+#define PC87417_XIRQC1 0x05
+#define PC87417_XIRQC2 0x06
+#define PC87417_XIMA0 0x08
+#define PC87417_XIMA1 0x09
+#define PC87417_XIMA2 0x0a
+#define PC87417_XIMA3 0x0b
+#define PC87417_XIMD 0x0c
+#define PC87417_XZCNF2 0x0d
+#define PC87417_XZCNF3 0x0e
+#define PC87417_XZM0 0x0f
+#define PC87417_XZM1 0x10
+#define PC87417_XZM2 0x11
+#define PC87417_XZM3 0x12
+#define PC87417_HAP0 0x13
+#define PC87417_HAP1 0x14
+#define PC87417_XSCNF 0x15
+#define PC87417_XWBCNF 0x16
+
+
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc87417.h"
+
+static void pc87417_disable_dev(device_t dev)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+}
+static void pc87417_enable_dev(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
+static void xbus_cfg(device_t dev)
+{
+ uint8_t i, data;
+ uint16_t xbus_index;
+
+ pnp_set_logical_device(dev);
+ /* select proper BIOS size (4MB) */
+ pnp_write_config(dev, PC87417_XMEMCNF2, (pnp_read_config(dev, PC87417_XMEMCNF2)) | 0x04);
+ xbus_index = pnp_read_iobase(dev, 0x60);
+
+ /* enable writes to devices attached to XCS0 (XBUS Chip Select 0) */
+ for (i=0; i<= 0xf; i++) {
+ outb((i<<4), xbus_index + PC87417_HAP0);
+ }
+ return;
+}
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc87417.h"
+
+
+static void pc87417_enable_serial(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
+static void pc87417_enable_dev(device_t dev)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 1);
+}
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* Copyright 2003-2004 Linux Networx */
+/* Copyright 2005 Tyan */
+/* By yhlu */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <arch/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <console/console.h>
+#include <string.h>
+#include <bitops.h>
+#include <uart8250.h>
+#include <pc80/keyboard.h>
+#include "chip.h"
+#include "pc87417.h"
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc87417_config *conf;
+ struct resource *res0, *res1;
+ /* Wishlist handle well known programming interfaces more
+ * generically.
+ */
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC87417_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+ case PC87417_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+ case PC87417_KBCK:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC87417_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
+ { &ops, PC87417_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
+ { &ops, PC87417_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
+ { &ops, PC87417_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, PC87417_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
+ { &ops, PC87417_KBCM, PNP_IRQ0 },
+ { &ops, PC87417_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
+ { &ops, PC87417_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+ { &ops, PC87417_XBUS, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
+ { &ops, PC87417_RTC, PNP_IO0 | PNP_IO1, { 0xfffe, 0 }, {0xfffe, 0x4} },
+};
+
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &pnp_ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc87417_ops = {
+ CHIP_NAME("NSC pc87417")
+ .enable_dev = enable_dev,
+};
--- /dev/null
+config chip.h
+object superio.o
--- /dev/null
+extern struct chip_operations superio_nsc_pc87427_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc87427_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
--- /dev/null
+#define PC87427_FDC 0x00 /* Floppy */
+#define PC87427_SP2 0x02 /* Com2 */
+#define PC87427_SP1 0x03 /* Com1 */
+#define PC87427_SWC 0x04
+#define PC87427_KBCM 0x05 /* Mouse */
+#define PC87427_KBCK 0x06 /* Keyboard */
+#define PC87427_GPIO 0x07
+#define PC87427_FMC 0x09
+#define PC87427_WDT 0x0A
+#define PC87427_XBUS 0x0F
+#define PC87427_RTC 0x10
+#define PC87427_MHC 0x14
+
+#define PC87427_GPIO_DEV PNP_DEV(0x2e, PC87427_GPIO)
+/* This is to get around a romcc bug */
+//#define PC87427_XBUS_DEV PNP_DEV(0x2e, PC87427_XBUS)
+#define PC87427_XBUS_DEV PNP_DEV(0x2e, 0x0f)
+
+#define PC87427_GPSEL 0xf0
+#define PC87427_GPCFG1 0xf1
+#define PC87427_GPEVR 0xf2
+#define PC87427_GPCFG2 0xf3
+#define PC87427_EXTCFG 0xf4
+#define PC87427_IOEXT1A 0xf5
+#define PC87427_IOEXT1B 0xf6
+#define PC87427_IOEXT2A 0xf7
+#define PC87427_IOEXT2B 0xf8
+
+#define PC87427_GPDO_0 0x00
+#define PC87427_GPDI_0 0x01
+#define PC87427_GPDO_1 0x02
+#define PC87427_GPDI_1 0x03
+#define PC87427_GPEVEN_1 0x04
+#define PC87427_GPEVST_1 0x05
+#define PC87427_GPDO_2 0x06
+#define PC87427_GPDI_2 0x07
+#define PC87427_GPDO_3 0x08
+#define PC87427_GPDI_3 0x09
+#define PC87427_GPDO_4 0x0a
+#define PC87427_GPDI_4 0x0b
+#define PC87427_GPEVEN_4 0x0c
+#define PC87427_GPEVST_4 0x0d
+#define PC87427_GPDO_5 0x0e
+#define PC87427_GPDI_5 0x0f
+#define PC87427_GPDO_6 0x10
+#define PC87427_GPDO_7A 0x11
+#define PC87427_GPDO_7B 0x12
+#define PC87427_GPDO_7C 0x13
+#define PC87427_GPDO_7D 0x14
+#define PC87427_GPDI_7A 0x15
+#define PC87427_GPDI_7B 0x16
+#define PC87427_GPDI_7C 0x17
+#define PC87427_GPDI_7D 0x18
+
+#define PC87427_XIOCNF 0xf0
+#define PC87427_XIOBA1H 0xf1
+#define PC87427_XIOBA1L 0xf2
+#define PC87427_XIOSIZE1 0xf3
+#define PC87427_XIOBA2H 0xf4
+#define PC87427_XIOBA2L 0xf5
+#define PC87427_XIOSIZE2 0xf6
+#define PC87427_XMEMCNF1 0xf7
+#define PC87427_XMEMCNF2 0xf8
+#define PC87427_XMEMBAH 0xf9
+#define PC87427_XMEMBAL 0xfa
+#define PC87427_XMEMSIZE 0xfb
+#define PC87427_XIRQMAP1 0xfc
+#define PC87427_XIRQMAP2 0xfd
+#define PC87427_XBIMM 0xfe
+#define PC87427_XBBSL 0xff
+
+#define PC87427_XBCNF 0x00
+#define PC87427_XZCNF0 0x01
+#define PC87427_XZCNF1 0x02
+#define PC87427_XIRQC0 0x04
+#define PC87427_XIRQC1 0x05
+#define PC87427_XIRQC2 0x06
+#define PC87427_XIMA0 0x08
+#define PC87427_XIMA1 0x09
+#define PC87427_XIMA2 0x0a
+#define PC87427_XIMA3 0x0b
+#define PC87427_XIMD 0x0c
+#define PC87427_XZCNF2 0x0d
+#define PC87427_XZCNF3 0x0e
+#define PC87427_XZM0 0x0f
+#define PC87427_XZM1 0x10
+#define PC87427_XZM2 0x11
+#define PC87427_XZM3 0x12
+#define PC87427_HAP0 0x13
+#define PC87427_HAP1 0x14
+#define PC87427_XSCNF 0x15
+#define PC87427_XWBCNF 0x16
+
+
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc87427.h"
+
+static void pc87427_disable_dev(device_t dev)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+}
+static void pc87427_enable_dev(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
+static void xbus_cfg(device_t dev)
+{
+ uint8_t i, data;
+ uint16_t xbus_index;
+
+ pnp_set_logical_device(dev);
+ /* select proper BIOS size (4MB) */
+ pnp_write_config(dev, PC87427_XMEMCNF2, (pnp_read_config(dev, PC87427_XMEMCNF2)) | 0x04);
+ xbus_index = pnp_read_iobase(dev, 0x60);
+
+ /* enable writes to devices attached to XCS0 (XBUS Chip Select 0) */
+ for (i=0; i<= 0xf; i++) {
+ outb((i<<4), xbus_index + PC87427_HAP0);
+ }
+ return;
+}
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* Copyright 2003-2004 Linux Networx */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <arch/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <console/console.h>
+#include <string.h>
+#include <bitops.h>
+#include "chip.h"
+#include "pc87427.h"
+
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc87427_config *conf;
+ struct resource *res0, *res1;
+ /* Wishlist handle well known programming interfaces more
+ * generically.
+ */
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC87427_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+ case PC87427_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+ case PC87427_KBCK:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC87427_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
+ { &ops, PC87427_SP2, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, PC87427_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, PC87427_SWC, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IO3 | PNP_IRQ0,
+ { 0xfff0, 0 }, { 0xfffc, 0 }, { 0xfffc, 0 }, { 0xfff8, 0 } },
+ { &ops, PC87427_KBCM, PNP_IRQ0 },
+ { &ops, PC87427_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
+ { &ops, PC87427_GPIO, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
+ { &ops, PC87427_WDT, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 } },
+ { &ops, PC87427_FMC, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
+ { &ops, PC87427_XBUS, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
+ { &ops, PC87427_RTC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xfffe, 0 }, { 0xfffe, 0 } },
+ { &ops, PC87427_MHC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xffe0, 0 }, { 0xffe0, 0 } },
+};
+
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc87427_ops = {
+ CHIP_NAME("NSC 87427")
+ .enable_dev = enable_dev,
+};
--- /dev/null
+config chip.h
+object superio.c
--- /dev/null
+#ifndef _SUPERIO_NSC_PC97307
+#define _SUPERIO_NSC_PC97307
+
+#ifndef PNP_INDEX_REG
+#define PNP_INDEX_REG 0x15C
+#endif
+#ifndef PNP_DATA_REG
+#define PNP_DATA_REG 0x15D
+#endif
+
+extern struct chip_operations superio_nsc_pc97307_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc97307_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
+#endif /* _SUPERIO_NSC_PC97307 */
--- /dev/null
+#define PC97307_KBCK 0x00 /* Keyboard */
+#define PC97307_KBCM 0x01 /* Mouse */
+#define PC97307_RTC 0x02 /* Real-Time Clock */
+#define PC97307_FDC 0x03 /* Floppy */
+#define PC97307_PP 0x04 /* Parallel port */
+#define PC97307_SP2 0x05 /* Com2 */
+#define PC97307_SP1 0x06 /* Com1 */
+#define PC97307_GPIO 0x07
+#define PC97307_PM 0x08 /* Power Management */
+
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <arch/io.h>
+#include <console/console.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include "chip.h"
+#include "pc97307.h"
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc97307_config *conf;
+ struct resource *res0, *res1;
+
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC97307_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+
+ case PC97307_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+
+ case PC97307_KBCK:
+ /* Enable keyboard */
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0); /* Disable keyboard */
+ pnp_write_config(dev, 0xf0, 0x40); /* Set KBC clock to 8 Mhz */
+ pnp_set_enable(dev, 1); /* Enable keyboard */
+
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+
+ case PC97307_FDC:
+ {
+ unsigned reg;
+ /* Set up floppy in PS/2 mode */
+ outb(0x09, SIO_CONFIG_RA);
+ reg = inb(SIO_CONFIG_RD);
+ reg = (reg & 0x3F) | 0x40;
+ outb(reg, SIO_CONFIG_RD);
+ outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC97307_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xffb, 0 }, { 0xffb, 0x4}, },
+ { &ops, PC97307_KBCM, PNP_IRQ0 },
+ { &ops, PC97307_RTC, PNP_IO0 | PNP_IRQ0, { 0xfffe, 0}, },
+ { &ops, PC97307_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0xfffa, 0}, },
+ { &ops, PC97307_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x03fc, 0}, },
+ { &ops, PC97307_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0xfff8, 0 }, },
+ { &ops, PC97307_SP1, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 }, },
+ { &ops, PC97307_GPIO, PNP_IO0, { 0xfff8, 0 } },
+ { &ops, PC97307_PM, PNP_IO0, { 0xfffe, 0 } },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc97307_ops = {
+ CHIP_NAME("NSC 97307")
+ .enable_dev = enable_dev,
+};
--- /dev/null
+config chip.h
+object superio.c
--- /dev/null
+#ifndef _SUPERIO_NSC_PC97317
+#define _SUPERIO_NSC_PC97317
+
+#ifndef PNP_INDEX_REG
+#define PNP_INDEX_REG 0x15C
+#endif
+#ifndef PNP_DATA_REG
+#define PNP_DATA_REG 0x15D
+#endif
+
+extern struct chip_operations superio_nsc_pc97317_ops;
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_nsc_pc97317_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
+#endif /* _SUPERIO_NSC_PC97317 */
--- /dev/null
+#define PC97317_KBCK 0x00 /* Keyboard */
+#define PC97317_KBCM 0x01 /* Mouse */
+#define PC97317_RTC 0x02 /* Real-Time Clock */
+#define PC97317_FDC 0x03 /* Floppy */
+#define PC97317_PP 0x04 /* Parallel port */
+#define PC97317_SP2 0x05 /* Com2 */
+#define PC97317_SP1 0x06 /* Com1 */
+#define PC97317_GPIO 0x07
+#define PC97317_PM 0x08 /* Power Management */
+
--- /dev/null
+#include <arch/romcc_io.h>
+#include "pc97317.h"
+
+#define PM_DEV PNP_DEV(0x2e, PC97317_PM)
+#define PM_BASE 0xe8
+
+/* The pc97317 needs clocks to be set up before the serial port will operate */
+
+static void pc97317_enable_serial(device_t dev, unsigned iobase)
+{
+ /* Set base address of power management unit */
+
+ pnp_set_logical_device(PM_DEV);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, PM_BASE);
+ pnp_set_enable(dev, 1);
+
+ /* Use on-chip clock multiplier */
+
+ outb(0x03, PM_BASE);
+ outb(inb(PM_BASE + 1) | 0x07, PM_BASE + 1);
+
+ /* Wait for the clock to stabilise */
+ while(!inb(PM_BASE + 1 & 0x80))
+ ;
+
+ /* Set the base address of the port */
+
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
--- /dev/null
+/* Copyright 2000 AG Electronics Ltd. */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <arch/io.h>
+#include <console/console.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include "chip.h"
+#include "pc97317.h"
+
+static void init(device_t dev)
+{
+ struct superio_nsc_pc97317_config *conf;
+ struct resource *res0, *res1;
+
+ if (!dev->enabled) {
+ return;
+ }
+ conf = dev->chip_info;
+ switch(dev->path.u.pnp.device) {
+ case PC97317_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+
+ case PC97317_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+
+ case PC97317_KBCK:
+ /* Enable keyboard */
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0); /* Disable keyboard */
+ pnp_write_config(dev, 0xf0, 0x40); /* Set KBC clock to 8 Mhz */
+ pnp_set_enable(dev, 1); /* Enable keyboard */
+
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+
+#if 0
+ case PC97317_FDC:
+ {
+ unsigned reg;
+ /* Set up floppy in PS/2 mode */
+ outb(0x09, SIO_CONFIG_RA);
+ reg = inb(SIO_CONFIG_RD);
+ reg = (reg & 0x3F) | 0x40;
+ outb(reg, SIO_CONFIG_RD);
+ outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */
+ break;
+ }
+#endif
+ default:
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, PC97317_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0xffb, 0 }, { 0xffb, 0x4}, },
+ { &ops, PC97317_KBCM, PNP_IRQ0 },
+ { &ops, PC97317_RTC, PNP_IO0 | PNP_IRQ0, { 0xfffe, 0}, },
+ { &ops, PC97317_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0xfffa, 0}, },
+ { &ops, PC97317_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x03fc, 0}, },
+ { &ops, PC97317_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0xfff8, 0 }, },
+ { &ops, PC97317_SP1, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 }, },
+ { &ops, PC97317_GPIO, PNP_IO0, { 0xfff8, 0 } },
+ { &ops, PC97317_PM, PNP_IO0, { 0xfffe, 0 } },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_nsc_pc97317_ops = {
+ CHIP_NAME("NSC 97317")
+ .enable_dev = enable_dev,
+};