1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include "superiotool.h"
5 #define DEVICE_ID_BYTE1_REG 0x20
6 #define DEVICE_ID_BYTE2_REG 0x21
8 #define VENDOR_ID_BYTE1_REG 0x23
9 #define VENDOR_ID_BYTE2_REG 0x24
11 #define EXAR_VENDOR_ID 0xa813
13 static const struct superio_registers reg_table
[] = {
14 {0x8403, "XR28V384", {
15 /* We assume reserved bits are read as 0. */
17 {0x02,0x07,0x20,0x21,0x23,0x24,0x25,0x26,0x27,EOT
},
18 {0x00,0x00,0x03,0x84,0x13,0xa8,0x00,0x00,0x00,EOT
}},
20 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf4,0xf5,0xf6,EOT
},
21 {0x01,0x03,0xf8,0x03,0x00,0x44,0x00,0x00,0x00,EOT
}},
23 {0x30,0x60,0x61,0x70,0xf0,0xf4,0xf5,0xf6,EOT
},
24 {0x01,0x02,0xf8,0x04,0x00,0x00,0x00,0x00,EOT
}},
26 {0x30,0x60,0x61,0x70,0xf0,0xf4,0xf5,0xf6,EOT
},
27 {0x01,0x03,0xe8,0x05,0x00,0x00,0x00,0x00,EOT
}},
29 {0x30,0x60,0x61,0x70,0xf0,0xf4,0xf5,0xf6,EOT
},
30 {0x01,0x02,0xe8,0x09,0x00,0x00,0x00,0x00,EOT
}},
32 {0x30,0x60,0x61,0x70,0xf0,0xf1,EOT
},
33 {0x01,0x04,0x42,0x00,0x02,0x0a,EOT
}},
38 void enter_conf_mode_exar(uint16_t port
)
44 void exit_conf_mode_exar(uint16_t port
)
49 void probe_idregs_exar(uint16_t port
)
53 probing_for("Exar", "", port
);
55 enter_conf_mode_exar(port
);
57 did
= regval(port
, DEVICE_ID_BYTE1_REG
);
58 did
|= (regval(port
, DEVICE_ID_BYTE2_REG
) << 8);
60 vid
= regval(port
, VENDOR_ID_BYTE1_REG
);
61 vid
|= (regval(port
, VENDOR_ID_BYTE2_REG
) << 8);
63 if (vid
!= EXAR_VENDOR_ID
|| superio_unknown(reg_table
, did
)) {
65 printf(NOTFOUND
"vid=0x%04x, id=0x%04x\n", vid
, did
);
66 exit_conf_mode_exar(port
);
70 printf("Found Exar %s (vid=0x%04x, id=0x%04x) at 0x%x\n",
71 get_superio_name(reg_table
, did
), vid
, did
, port
);
74 dump_superio("Exar", reg_table
, port
, did
, LDN_SEL
);
76 exit_conf_mode_exar(port
);
79 void print_exar_chips(void)
81 print_vendor_chips("Exar", reg_table
);