Jonathan A. Kollasch | 3d1d6bb | 2011-11-07 10:56:42 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the superiotool project. |
| 3 | * |
| 4 | * Copyright (C) 2011 Jonathan A. Kollasch <jakllsch@kollasch.net> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Jonathan A. Kollasch | 3d1d6bb | 2011-11-07 10:56:42 -0600 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include "superiotool.h" |
| 18 | |
| 19 | #define DEVICE_ID_REG 0x20 |
| 20 | #define DEVICE_REV_REG 0x21 |
| 21 | |
| 22 | static const struct superio_registers reg_table[] = { |
| 23 | {0x0b, "SLB9635TT12", { |
| 24 | {NOLDN, NULL, |
| 25 | {0x20,0x21,0x26,0x27,EOT}, |
| 26 | {0x0b,0x00,NANA,NANA,EOT}}, |
| 27 | {0, NULL, |
| 28 | {0x30,0x38,0x60,0x61,0x70,0x71,0xf1,0xf2,0xf3,0xf4,0xf5,EOT}, |
| 29 | {0x00,0x00,NANA,NANA,0x00,0x02,0xd1,0x15,0x0b,0x00,NANA,EOT}}, |
| 30 | {EOT}}}, |
| 31 | {EOT} |
| 32 | }; |
| 33 | |
| 34 | /* same as some SMSC */ |
| 35 | static void enter_conf_mode_infineon(uint16_t port) |
| 36 | { |
| 37 | OUTB(0x55, port); |
| 38 | } |
| 39 | |
| 40 | static void exit_conf_mode_infineon(uint16_t port) |
| 41 | { |
| 42 | OUTB(0xaa, port); |
| 43 | } |
| 44 | |
| 45 | void probe_idregs_infineon(uint16_t port) |
| 46 | { |
| 47 | uint8_t rev, devid; |
| 48 | |
| 49 | probing_for("Infineon", "", port); |
| 50 | |
| 51 | enter_conf_mode_infineon(port); |
| 52 | |
| 53 | devid = regval(port, DEVICE_ID_REG); |
| 54 | rev = regval(port, DEVICE_REV_REG); |
| 55 | |
| 56 | if (superio_unknown(reg_table, devid)) { |
| 57 | if (verbose) |
| 58 | printf(NOTFOUND "id=0x%02x, rev=0x%02x\n", devid, rev); |
| 59 | exit_conf_mode_infineon(port); |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | /* Attempt to prevent false matches on SMSC FDC37N972, see smsc.c */ |
| 64 | if (((regval(port, 0x27)<<8)|regval(port, 0x26)) != port) { |
| 65 | if (verbose) |
| 66 | printf(NOTFOUND "id=0x%02x, rev=0x%02x\n", devid, rev); |
| 67 | exit_conf_mode_infineon(port); |
| 68 | return; |
| 69 | } |
| 70 | |
| 71 | printf("Found Infineon %s (id=0x%02x, rev=0x%02x) at 0x%x\n", |
| 72 | get_superio_name(reg_table, devid), devid, rev, port); |
| 73 | chip_found = 1; |
| 74 | |
| 75 | dump_superio("Infineon", reg_table, port, devid, LDN_SEL); |
| 76 | |
| 77 | exit_conf_mode_infineon(port); |
| 78 | } |
| 79 | |
| 80 | void print_infineon_chips(void) |
| 81 | { |
| 82 | print_vendor_chips("Infineon", reg_table); |
| 83 | } |