451bf4b8c4ffcdb8d9eb6b4a8cea6f7c1b39e751
[coreboot.git] / src / superio / NSC / pc87360 / superio.c
1 /* $Id$ */
2 /* Copyright 2000  AG Electronics Ltd. */
3 /* This code is distributed without warranty under the GPL v2 (see COPYING) */
4
5 #include <types.h>
6 #include <arch/io.h>
7
8 #ifndef PNP_INDEX_REG
9 #define PNP_INDEX_REG   0x15C
10 #endif
11 #ifndef PNP_DATA_REG
12 #define PNP_DATA_REG    0x15D
13 #endif
14 #ifndef SIO_COM1
15 #define SIO_COM1_BASE   0x3F8
16 #endif
17 #ifndef SIO_COM2
18 #define SIO_COM2_BASE   0x2F8
19 #endif
20
21 static
22 void pnp_output(char address, char data)
23 {
24     outb(address, PNP_INDEX_REG);
25     outb(data, PNP_DATA_REG);
26 }
27
28 static
29 void sio_enable(void)
30 {
31     /* Enable Super IO Chip */
32     pnp_output(0x07, 6); /* LD 6 = UART1 */
33     pnp_output(0x30, 0); /* Dectivate */
34     pnp_output(0x60, SIO_COM1_BASE >> 8); /* IO Base */
35     pnp_output(0x61, SIO_COM1_BASE & 0xFF); /* IO Base */
36     pnp_output(0x30, 1); /* Activate */
37 }
38
39 struct superio_control superio_NSC_pc87360_control = {
40         pre_pci_init:   (void *)0,
41         init:           (void *)0,
42         finishup:       (void *)0,
43         defaultport:    SIO_COM1_BASE,
44         name:           "NSC pc87360"
45 };