2 * Enable the serial evices on the VIA
6 /* The base address is 0x15c, 0x2e, depending on config bytes */
9 #define SIO_DATA SIO_BASE+1
11 static void vt8235_writepnpaddr(uint8_t val)
17 static void vt8235_writepnpdata(uint8_t val)
24 static void vt8235_writesiobyte(uint16_t reg, uint8_t val)
29 static void vt8235_writesioword(uint16_t reg, uint16_t val)
35 /* regs we use: 85, and the southbridge devfn is defined by the
39 static void enable_vt8235_serial(void)
42 vt8235_writepnpaddr(0x87);
43 vt8235_writepnpaddr(0x87);
44 // now go ahead and set up com1.
46 vt8235_writepnpaddr(0x7);
47 vt8235_writepnpdata(0x2);
49 vt8235_writepnpaddr(0x30);
50 vt8235_writepnpdata(0x1);
51 // serial port 1 base address (FEh)
52 vt8235_writepnpaddr(0x60);
53 vt8235_writepnpdata(0xfe);
54 // serial port 1 IRQ (04h)
55 vt8235_writepnpaddr(0x70);
56 vt8235_writepnpdata(0x4);
57 // serial port 1 control
58 vt8235_writepnpaddr(0xf0);
59 vt8235_writepnpdata(0x2);
61 vt8235_writepnpaddr(0xaa);
63 // set up reg to set baud rate.
64 vt8235_writesiobyte(0x3fb, 0x80);
66 vt8235_writesioword(0x3f8, 1);
68 // WRITESIOWORD(0x3f8, 12)
69 // now set no parity, one stop, 8 bits
70 vt8235_writesiobyte(0x3fb, 3);
71 // now turn on RTS, DRT
72 vt8235_writesiobyte(0x3fc, 3);
74 vt8235_writesiobyte(0x3f9, 0xf);
75 // should be done. Dump a char for fun.
76 vt8235_writesiobyte(0x3f8, 48);