Add support for the LPC47M182 to superiotool
authorStefan Reinauer <stepan@coresystems.de>
Wed, 11 Mar 2009 14:48:20 +0000 (14:48 +0000)
committerStefan Reinauer <stepan@openbios.org>
Wed, 11 Mar 2009 14:48:20 +0000 (14:48 +0000)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Joseph Smith <joe@settoplinux.org>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3990 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/superiotool/smsc.c
util/superiotool/superiotool.c
util/superiotool/superiotool.h

index bf23188168584d08b1fcc0d190339b5f59097464..cc796b1127709c94d8a26f023b78f7ec0bf58884 100644 (file)
@@ -437,7 +437,41 @@ static const struct superio_registers reg_table[] = {
                {EOT}}},
        {0x6f, "LPC47B397", {
                {EOT}}},
-       {0x74, "LPC47M182", {
+       {0x74, "LPC47M182", { /* Only for LD_NUM = 0 */
+               {NOLDN, NULL, 
+                       {0x02,0x03,0x07,0x20,0x21,0x22,0x23,0x24,0x26,0x27,
+                        0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
+                       {0x00,RSVD,0x00,0x74,RSVD,0x00,RSVD,0x44,MISC,0x00,
+                        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
+               {0x0, "Floppy",
+                       {0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
+                        0xf8,EOT},
+                       {0x00,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,
+                        0x24,EOT}},
+               {0x1, "Parallel port",
+                       {0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf8,EOT},
+                       {0x00,0x00,0x00,0x00,0x04,0x3c,0x00,0x08,EOT}},
+               {0x2, "COM2",
+                       {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x02,0x03,EOT}},
+               {0x3, "COM1",
+                       {0x30,0x60,0x61,0x70,0xf0,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,EOT}},
+               {0x4, "Power Control",
+                       {0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
+                       {0x00,0x00,0x00,0x00,NANA,0x00,EOT}},
+               {0x5, "Mouse",
+                       {0x30,0x70,EOT},
+                       {0x00,0x00,EOT}},
+               {0x6, "Keyboard",
+                       {0x30,0x70,0xf0,EOT},
+                       {0x00,0x00,0x00,EOT}},
+               {0x7, "GPIO",
+                       {0x30,0x60,0x61,0x70,0x72,0xf0,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
+               {0xa, "Runtime registers",
+                       {0x30,0x60,0x61,0x62,0x63,0xf0,0xf1,0xf2,EOT},
+                       {0x00,0x00,0x00,0x00,0x00,NANA,RSVD,0x04,EOT}},
                {EOT}}},
        {0x76, "LPC47M584", {   /* From sensors-detect (no datasheet) */
                {EOT}}},
@@ -646,6 +680,22 @@ static void probe_idregs_smsc_helper(uint16_t port, uint8_t idreg,
        dump_superio((id == 0x77 ? "ASUS" : "SMSC"), reg_table, port, id,
                     LDN_SEL);
 
+       if (extra_dump) {
+               uint16_t runtime_base;
+               switch (id) {
+               case 0x5a:
+                       runtime_base = regval(port, 0x30) << 4;
+                       if (runtime_base)
+                               dump_io(runtime_base, 16);
+                       else
+                               printf("Runtime Register Block not mapped on this SuperIO.\n");
+                       
+                       break;
+               default:
+                       printf("No extra registers known for this chip\n");
+               }
+       }
+
        exit_conf_mode_smsc(port);
 }
 
index 9d3840f1f7230f3ce3df786300fd680d7981643b..583a974fd4231abdab6e24eeef034114b13b082a 100644 (file)
@@ -157,6 +157,20 @@ void dump_superio(const char *vendor,
        }
 }
 
+void dump_io(uint16_t iobase, uint16_t length)
+{
+       uint16_t i;
+
+       printf("Dumping %d IO mapped registers at base 0x%04x:\n", 
+                       length, iobase);
+       for (i=0; i<length; i++)
+               printf ("%02x ", i);
+       printf("\n");
+       for (i=0; i<length; i++)
+               printf ("%02x ", INB(iobase +i));
+       printf("\n");
+}
+
 void probing_for(const char *vendor, const char *info, uint16_t port)
 {
        if (!verbose)
index e26f21c59c18db070dd1701614e087aa9c7d1ce9..5df60a785dcc67bc14ca5ba4d18088966d80f21d 100644 (file)
@@ -107,6 +107,7 @@ const char *get_superio_name(const struct superio_registers reg_table[],
                             uint16_t id);
 void dump_superio(const char *name, const struct superio_registers reg_table[],
                  uint16_t port, uint16_t id, uint8_t ldn_sel);
+void dump_io(uint16_t iobase, uint16_t length);
 void probing_for(const char *vendor, const char *info, uint16_t port);
 void print_vendor_chips(const char *vendor,
                        const struct superio_registers reg_table[]);