diff --git a/src/superio/sis/950/superio.c b/src/superio/sis/950/superio.c new file mode 100644 index 0000000000..6ee98dfc27 --- /dev/null +++ b/src/superio/sis/950/superio.c @@ -0,0 +1,67 @@ +// just define these here. We may never need them anywhere else +#define PNP_COM1_DEVICE 0x1 +#define PNP_COM2_DEVICE 0x2 + +#include +#include + +void +enter_pnp() +{ + // unlock it XXX make this a subr at some point + outb(0x87, 0x2e); + outb(0x01, 0x2e); + outb(0x55, 0x2e); + outb(0x55, 0x2e); +} + +void +exit_pnp() +{ + /* all done. */ + // select configure control + outb(2, 0x2e); + outb(2, 0x2f); +} + +#ifdef MUST_ENABLE_FLOPPY + +void enable_floppy() +{ + /* now set the LDN to floppy LDN */ + outb(0x7, 0x2e); /* pick reg. 7 */ + outb(0x0, 0x2f); /* LDN 0 to reg. 7 */ + + /* now select register 0x30, and set bit 1 in that register */ + outb(0x30, 0x2e); + outb(0x1, 0x2f); + +} +#endif /* MUST_ENABLE_FLOPPY */ + +void +enable_com(int com) +{ + /* now set the LDN to com LDN */ + outb(0x7, 0x2e); /* pick reg. 7 */ + outb(com, 0x2f); /* LDN 0 to reg. 7 */ + + /* now select register 0x30, and set bit 1 in that register */ + outb(0x30, 0x2e); + outb(0x1, 0x2f); + +} + +void +final_superio_fixup() +{ + + enter_pnp(); +#ifdef MUST_ENABLE_FLOPPY + enable_floppy(); +#endif + enable_com(PNP_COM1_DEVICE); + enable_com(PNP_COM2_DEVICE); + + exit_pnp(); +}