more chip stuff
[coreboot.git] / src / superio / NSC / pc97307 / superio.c
1 /* Copyright 2000  AG Electronics Ltd. */
2 /* This code is distributed without warranty under the GPL v2 (see COPYING) */
3
4 #include <arch/io.h>
5 #include <device/chip.h>
6 #include "chip.h"
7
8 void pnp_output(char address, char data)
9 {
10         outb(address, PNP_INDEX_REG);
11         outb(data, PNP_DATA_REG);
12 }
13
14 void sio_enable(struct chip *chip, enum chip_pass pass)
15 {
16
17         struct superio_NSC_pc97307_config *conf = (struct superio_NSC_pc97307_config *)chip->chip_info;
18
19         switch (pass) {
20         case CHIP_PRE_CONSOLE:
21                 /* Enable Super IO Chip */
22                 pnp_output(0x07, 6); /* LD 6 = UART1 */
23                 pnp_output(0x30, 0); /* Dectivate */
24                 pnp_output(0x60, conf->port >> 8); /* IO Base */
25                 pnp_output(0x61, conf->port & 0xFF); /* IO Base */
26                 pnp_output(0x30, 1); /* Activate */
27                 break;
28         default:
29                 /* nothing yet */
30                 break;
31         }
32 }
33
34 struct chip_control superio_NSC_pc97307_control = {
35         enable: sio_enable,
36         name:   "NSC 87307"
37 };