2 * This file is part of the superiotool project.
4 * Copyright (C) 2016 Derek Waldner
5 * Copyright (C) 2016 Sencore Inc <opensource@sencore.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #include "superiotool.h"
20 #define DEVICE_ID_BYTE1_REG 0x20
21 #define DEVICE_ID_BYTE2_REG 0x21
23 #define VENDOR_ID_BYTE1_REG 0x23
24 #define VENDOR_ID_BYTE2_REG 0x24
26 #define EXAR_VENDOR_ID 0xa813
28 static const struct superio_registers reg_table
[] = {
29 {0x8403, "XR28V384", {
30 /* We assume reserved bits are read as 0. */
32 {0x02,0x07,0x20,0x21,0x23,0x24,0x25,0x26,0x27,EOT
},
33 {0x00,0x00,0x03,0x84,0x13,0xa8,0x00,0x00,0x00,EOT
}},
35 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf4,0xf5,0xf6,EOT
},
36 {0x01,0x03,0xf8,0x03,0x00,0x44,0x00,0x00,0x00,EOT
}},
38 {0x30,0x60,0x61,0x70,0xf0,0xf4,0xf5,0xf6,EOT
},
39 {0x01,0x02,0xf8,0x04,0x00,0x00,0x00,0x00,EOT
}},
41 {0x30,0x60,0x61,0x70,0xf0,0xf4,0xf5,0xf6,EOT
},
42 {0x01,0x03,0xe8,0x05,0x00,0x00,0x00,0x00,EOT
}},
44 {0x30,0x60,0x61,0x70,0xf0,0xf4,0xf5,0xf6,EOT
},
45 {0x01,0x02,0xe8,0x09,0x00,0x00,0x00,0x00,EOT
}},
47 {0x30,0x60,0x61,0x70,0xf0,0xf1,EOT
},
48 {0x01,0x04,0x42,0x00,0x02,0x0a,EOT
}},
53 void enter_conf_mode_exar(uint16_t port
)
59 void exit_conf_mode_exar(uint16_t port
)
64 void probe_idregs_exar(uint16_t port
)
68 probing_for("Exar", "", port
);
70 enter_conf_mode_exar(port
);
72 did
= regval(port
, DEVICE_ID_BYTE1_REG
);
73 did
|= (regval(port
, DEVICE_ID_BYTE2_REG
) << 8);
75 vid
= regval(port
, VENDOR_ID_BYTE1_REG
);
76 vid
|= (regval(port
, VENDOR_ID_BYTE2_REG
) << 8);
78 if (vid
!= EXAR_VENDOR_ID
|| superio_unknown(reg_table
, did
)) {
80 printf(NOTFOUND
"vid=0x%04x, id=0x%04x\n", vid
, did
);
81 exit_conf_mode_exar(port
);
85 printf("Found Exar %s (vid=0x%04x, id=0x%04x) at 0x%x\n",
86 get_superio_name(reg_table
, did
), vid
, did
, port
);
89 dump_superio("Exar", reg_table
, port
, did
, LDN_SEL
);
91 exit_conf_mode_exar(port
);
94 void print_exar_chips(void)
96 print_vendor_chips("Exar", reg_table
);