soc/intel/denverton_ns: Remove variable set but not used
[coreboot.git] / util / superiotool / infineon.c
blobf38714acd240eac9f55993af4231eeda8cb631ab
1 /*
2 * This file is part of the superiotool project.
4 * Copyright (C) 2011 Jonathan A. Kollasch <jakllsch@kollasch.net>
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.
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.
17 #include "superiotool.h"
19 #define DEVICE_ID_REG 0x20
20 #define DEVICE_REV_REG 0x21
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}
34 /* same as some SMSC */
35 static void enter_conf_mode_infineon(uint16_t port)
37 OUTB(0x55, port);
40 static void exit_conf_mode_infineon(uint16_t port)
42 OUTB(0xaa, port);
45 void probe_idregs_infineon(uint16_t port)
47 uint8_t rev, devid;
49 probing_for("Infineon", "", port);
51 enter_conf_mode_infineon(port);
53 devid = regval(port, DEVICE_ID_REG);
54 rev = regval(port, DEVICE_REV_REG);
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;
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;
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;
75 dump_superio("Infineon", reg_table, port, devid, LDN_SEL);
77 exit_conf_mode_infineon(port);
80 void print_infineon_chips(void)
82 print_vendor_chips("Infineon", reg_table);