This adds register definitions for all logical devices on the SMSC
[coreboot.git] / util / superiotool / nsc.c
index 86c96839b1ab404f4799b4bfff9df794e7dae23d..c5d5b5203b8fa9d50b81541e41b28c856b6eebaa 100644 (file)
@@ -62,6 +62,40 @@ static const struct superio_registers reg_table[] = {
                        {0x00,0x00,0x00,0x00,0x04,0x04,EOT}},
                {EOT}}},
        {0xd0, "PC87317", {
+               {NOLDN, NULL,
+                       {0x20,0x21,0x22,0x23,0x24,0x25,EOT},
+                       {0xd0,MISC,MISC,0x00,0x00,0x00,EOT}},
+               {0x0, "Keyboard",
+                       {0x30,0x31,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,
+                        0xf0,EOT},
+                       {MISC,0x00,0x00,0x60,0x00,0x64,0x01,0x02,0x04,0x04,
+                        0x40,EOT}},
+               {0x1, "Mouse",
+                       {0x30,0x70,0x71,0x74,0x75,EOT},
+                       {0x00,0x0c,0x02,0x04,0x04,EOT}},
+               {0x2, "Real-time clock (RTC), advanced power control (APC)",
+                       {0x30,0x31,0x60,0x61,0x70,0x71,0x74,0x75,EOT},
+                       {MISC,0x00,0x00,0x70,0x08,0x00,0x04,0x04,EOT}},
+               {0x3, "Floppy",
+                       {0x30,0x31,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,
+                        EOT},
+                       {MISC,0x00,0x03,0xf2,0x06,0x03,0x02,0x04,0x20,0x00,
+                        EOT}},
+               {0x4, "Parallel port",
+                       {0x30,0x31,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x00,0x02,0x78,0x07,0x00,0x04,0x04,0xf2,EOT}},
+               {0x5, "COM2 / IR",
+                       {0x30,0x31,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x00,0x02,0xf8,0x03,0x03,0x04,0x04,0x02,EOT}},
+               {0x6, "COM1",
+                       {0x30,0x31,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x00,0x03,0xf8,0x04,0x03,0x04,0x04,0x02,EOT}},
+               {0x7, "GPIO",
+                       {0x30,0x31,0x60,0x61,0x74,0x75,EOT},
+                       {0x00,0x00,0x00,0x00,0x04,0x04,EOT}},
+               {0x8, "Power management",
+                       {0x30,0x31,0x60,0x61,0x74,0x75,EOT},
+                       {0x00,0x00,0x00,0x00,0x04,0x04,EOT}},
                {EOT}}},
        {0xdf, "PC97317", {
                {NOLDN, NULL,
@@ -274,6 +308,42 @@ static const struct superio_registers reg_table[] = {
 
        /* SID[7..0]: family, SRID[7..5]: ID, SRID[4..0]: rev. */
        {0xea, "PC8739x", {
+               {NOLDN, NULL,
+                       {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
+                        0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
+                       {0xea,0x11,MISC,MISC,MISC,0x80,0x00,NANA,0x00,MISC,
+                        0x37,RSVD,RSVD,RSVD,RSVD,RSVD,EOT}},
+               {0x0, "Floppy",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,EOT},
+                       {0x00,0x03,0xf2,0x06,0x03,0x02,0x04,0x24,0x00,EOT}},
+               {0x1, "Parallel port",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x02,0x78,0x07,0x02,0x04,0x04,0xf2,EOT}},
+               {0x2, "COM2 / FIR",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x02,0xf8,0x03,0x03,0x04,0x04,0x02,EOT}},
+               {0x3, "COM1",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x03,0xf8,0x04,0x03,0x04,0x04,0x02,EOT}},
+               {0x7, "GPIO",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,0xf2,
+                        EOT},
+                       {0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x00,0x44,0x01,
+                        EOT}},
+               {0xa, "Watchdog timer (WDT)",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x02,EOT}},
+               {0xb, "Game port",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x02,0x01,0x00,0x03,0x04,0x04,0x00,EOT}},
+               {0xc, "MIDI port",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x03,0x30,0x00,0x03,0x04,0x04,0x00,EOT}},
+               {0xf, "X-Bus",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,0xf2,
+                        0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x00,0x00,0x00,
+                        0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
                {EOT}}},
        {0xec, "PC87591x", {
                /* SRID[7..5]: 000=PC87591E, 001=PC87591S, 100=PC87591L */
@@ -374,6 +444,65 @@ static const struct superio_registers reg_table[] = {
                {EOT}}},
        {0xf2, "PC87427", {
                /* SRID[7..5] is marked as "not applicable for the PC87427". */
+               {NOLDN, NULL,
+                       {0x10,0x12,0x13,0x1d,0x20,0x21,0x22,0x23,0x24,0x25,
+                        0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
+                        EOT},
+                       {0x00,0x00,0x00,0x00,0xf2,0x11,0xa0,MISC,MISC,MISC,
+                        0x02,NANA,0x00,MISC,0x00,0x00,MISC,MISC,RSVD,RSVD,
+                        EOT}},
+               {0x0, "Floppy",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,EOT},
+                       {0x00,0x03,0xf2,0x06,0x03,0x02,0x04,0x24,0x00,EOT}},
+               {0x2, "COM2",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x02,0xf8,0x03,0x03,0x04,0x04,0x02,EOT}},
+               {0x3, "COM1",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x03,0xf8,0x04,0x03,0x04,0x04,0x02,EOT}},
+               {0x4, "System wake-up control (SWC)",
+                       {0x30,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x70,
+                        0x71,0x74,0x75,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+                        0x03,0x04,0x04,EOT}},
+               {0x5, "Mouse",
+                       {0x30,0x70,0x71,0x74,0x75,EOT},
+                       {0x00,0x0c,0x02,0x04,0x04,EOT}},
+               {0x6, "Keyboard",
+                       {0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,0xf0,
+                        EOT},
+                       {0x00,0x00,0x60,0x00,0x64,0x01,0x02,0x04,0x04,0x40,
+                        EOT}},
+               {0x7, "GPIO",
+                       {0x30,0x50,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,
+                        0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x00,MISC,
+                        0x01,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
+               {0x9, "Fan Monitor and Control (FMC)",
+                       {0x30,0x50,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,
+                        EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x19,0x06,
+                        EOT}},
+               {0xa, "Watchdog timer (WDT)",
+                       {0x30,0x50,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x00,EOT}},
+               {0xf, "X-Bus",
+                       {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,0xf2,
+                        0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,
+                        0xfd,0xfe,0xff,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x00,0x00,0x00,
+                        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+                        0x00,0x80,0x10,EOT}},
+               {0x10, "Real-time clock (RTC)",
+                       {0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,0xf0,
+                        0xf1,0xf2,0xf3,0xf6,0xf7,EOT},
+                       {0x00,0x00,0x70,0x00,0x72,0x08,0x00,0x04,0x04,0x00,
+                        0x00,0x00,0x00,MISC,0x00,EOT}},
+               {0x14, "Health monitoring and control (HMC)",
+                       {0x30,0x50,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,
+                        0xf0,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,
+                        0x05,EOT}},
                {EOT}}},
        {0xf3, "PC87373", {
                {EOT}}},
@@ -386,21 +515,21 @@ void probe_idregs_nsc(uint16_t port)
 
        probing_for("NSC", "", port);
 
-       outb(CHIP_ID_REG, port);
-       if (inb(port) != CHIP_ID_REG) {
+       OUTB(CHIP_ID_REG, port);
+       if (INB(port) != CHIP_ID_REG) {
                if (verbose)
                        printf(NOTFOUND "port=0x%02x, port+1=0x%02x\n",
-                              inb(port), inb(port + 1));
+                              INB(port), INB(port + 1));
                return;
        }
-       id = inb(port + 1);
+       id = INB(port + 1);
 
-       outb(CHIP_REV_REG, port);
-       if (inb(port) != CHIP_REV_REG) {
+       OUTB(CHIP_REV_REG, port);
+       if (INB(port) != CHIP_REV_REG) {
                printf("Warning: Can't get chip revision. Setting to 0xff.\n");
                rev = 0xff;
        } else {
-               rev = inb(port + 1);
+               rev = INB(port + 1);
        }
 
        if (superio_unknown(reg_table, id)) {
@@ -413,5 +542,10 @@ void probe_idregs_nsc(uint16_t port)
               get_superio_name(reg_table, id), id, rev, port);
        chip_found = 1;
 
-       dump_superio("NSC", reg_table, port, id);
+       dump_superio("NSC", reg_table, port, id, LDN_SEL);
+}
+
+void print_nsc_chips(void)
+{
+       print_vendor_chips("NSC", reg_table);
 }