- Remove all of the annoying $Id strings
[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 <ppc.h>
5 #include <ppcreg.h>
6 #include <types.h>
7 #include <arch/io.h>
8
9 #ifndef PNP_INDEX_REG
10 #define PNP_INDEX_REG   0x15C
11 #endif
12 #ifndef PNP_DATA_REG
13 #define PNP_DATA_REG    0x15D
14 #endif
15 #ifndef SIO_COM1
16 #define SIO_COM1_BASE   0x3F8
17 #endif
18 #ifndef SIO_COM2
19 #define SIO_COM2_BASE   0x2F8
20 #endif
21
22 void pnp_output(char address, char data)
23 {
24     outb(address, PNP_INDEX_REG);
25     outb(data, PNP_DATA_REG);
26 }
27
28 void sio_enable(void)
29 {
30     /* Enable Super IO Chip */
31     pnp_output(0x07, 6); /* LD 6 = UART1 */
32     pnp_output(0x30, 0); /* Dectivate */
33     pnp_output(0x60, SIO_COM1_BASE >> 8); /* IO Base */
34     pnp_output(0x61, SIO_COM1_BASE & 0xFF); /* IO Base */
35     pnp_output(0x30, 1); /* Activate */
36 }
37
38 #if 0
39 struct superio_control superio_NSC_pc97307_control = {
40         pre_pci_init:   (void *)0,
41         init:           (void *)0,
42         finishup:       (void *)0,
43         defaultport:    SIO_COM1_BASE,
44         name:           "NSC 87307"
45 };
46 #endif