From 44f293a509326ed72a4bdefe2b5983586f869a7a Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 29 Mar 2020 19:32:37 -0300 Subject: [PATCH 1/2] Small fixes to W83781D and SPD --- src/hwm_w83781d.c | 6 +++--- src/spd.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hwm_w83781d.c b/src/hwm_w83781d.c index b80bef7d9..19de7d997 100644 --- a/src/hwm_w83781d.c +++ b/src/hwm_w83781d.c @@ -427,7 +427,7 @@ w83781d_reset(w83781d_t *dev, uint8_t initialization) * AS99127F Rev. 2 on a P4B motherboard, and they seem to work well enough. */ if (dev->local & W83781D_AS99127F) { - dev->regs[0x00] = 0xB8; /* might be connected to IN2 Low Limit in some way */ + /* 0x00 appears to mirror IN2 Low Limit */ dev->regs[0x01] = dev->regs[0x23]; /* appears to mirror IN3 */ dev->regs[0x02] = dev->regs[0x20]; /* appears to mirror IN0 */ dev->regs[0x03] = 0x60; @@ -512,7 +512,7 @@ const device_t w83781d_device = { /* - * ASUS AS99127F is a customized W83781D with no ISA interface (SMBus only), + * The ASUS AS99127F is a customized W83781D with no ISA interface (SMBus only), * added proprietary registers and different chip/vendor IDs. */ const device_t as99127f_device = { @@ -526,7 +526,7 @@ const device_t as99127f_device = { /* - * Rev. 2 changes the vendor ID back to Winbond's. + * Rev. 2 changes the vendor ID back to Winbond's and brings some other changes. */ const device_t as99127f_rev2_device = { "ASUS AS99127F Rev. 2 Hardware Monitor", diff --git a/src/spd.c b/src/spd.c index a4abca624..2cdc81abd 100644 --- a/src/spd.c +++ b/src/spd.c @@ -184,6 +184,7 @@ spd_register(uint8_t ram_type, uint8_t slot_mask, uint16_t max_module_size) spd_log("SPD: vslot %d = %d MB\n", vslot, vslots[vslot]); total_size -= vslots[vslot]; } else { + vslots[vslot] = 0; break; } } From 0a230e9363560d5a81f4539ddef27283a42150d0 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 31 Mar 2020 13:58:19 -0300 Subject: [PATCH 2/2] SMSC SLC90E66 (Victory66) southbridge --- src/include/86box/piix.h | 1 + src/intel_piix.c | 43 +++++++++++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/include/86box/piix.h b/src/include/86box/piix.h index 5ad26a7b7..e07607606 100644 --- a/src/include/86box/piix.h +++ b/src/include/86box/piix.h @@ -20,3 +20,4 @@ extern const device_t piix_device; extern const device_t piix3_device; extern const device_t piix4_device; extern const device_t piix4e_device; +extern const device_t slc90e66_device; diff --git a/src/intel_piix.c b/src/intel_piix.c index b3f0ddb38..fdf6b6bc3 100644 --- a/src/intel_piix.c +++ b/src/intel_piix.c @@ -1110,18 +1110,29 @@ piix_reset_hard(piix_t *dev) /* Clear all 4 functions' arrays and set their vendor and device ID's. */ for (i = 0; i < 4; i++) { - memset(dev->regs[i], 0, 256); - dev->regs[i][0x00] = 0x86; dev->regs[i][0x01] = 0x80; /* Intel */ - dev->regs[i][0x02] = (dev->func0_id & 0xff) + (i << dev->func_shift); - dev->regs[i][0x03] = (dev->func0_id >> 8); + memset(dev->regs[i], 0, 256); + if (dev->func0_id == 0x9460) { + dev->regs[i][0x00] = 0x55; dev->regs[i][0x01] = 0x10; /* SMSC */ + if (i == 1) { /* IDE controller is 9130, breaking convention */ + dev->regs[i][0x02] = 0x30; + dev->regs[i][0x03] = 0x91; + } else { + dev->regs[i][0x02] = (dev->func0_id & 0xff) + (i << dev->func_shift); + dev->regs[i][0x03] = (dev->func0_id >> 8); + } + } else { + dev->regs[i][0x00] = 0x86; dev->regs[i][0x01] = 0x80; /* Intel */ + dev->regs[i][0x02] = (dev->func0_id & 0xff) + (i << dev->func_shift); + dev->regs[i][0x03] = (dev->func0_id >> 8); + } } /* Function 0: PCI to ISA Bridge */ fregs = (uint8_t *) dev->regs[0]; - piix_log("PIIX Function 0: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]); + piix_log("PIIX Function 0: %02X%02X:%02X%02X\n", fregs[0x01], fregs[0x00], fregs[0x03], fregs[0x02]); fregs[0x04] = 0x07; fregs[0x06] = 0x80; fregs[0x07] = 0x02; - if (dev->type == 4) + if (dev->type == 4 && dev->func0_id != 0x9460) fregs[0x08] = (dev->rev & 0x08) ? 0x02 : (dev->rev & 0x07); else fregs[0x08] = dev->rev; @@ -1146,7 +1157,7 @@ piix_reset_hard(piix_t *dev) /* Function 1: IDE */ fregs = (uint8_t *) dev->regs[1]; - piix_log("PIIX Function 1: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]); + piix_log("PIIX Function 1: %02X%02X:%02X%02X\n", fregs[0x01], fregs[0x00], fregs[0x03], fregs[0x02]); fregs[0x04] = (dev->type > 3) ? 0x05 : 0x07; fregs[0x06] = 0x80; fregs[0x07] = 0x02; if (dev->type == 4) @@ -1161,7 +1172,7 @@ piix_reset_hard(piix_t *dev) /* Function 2: USB */ if (dev->type > 1) { fregs = (uint8_t *) dev->regs[2]; - piix_log("PIIX Function 2: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]); + piix_log("PIIX Function 2: %02X%02X:%02X%02X\n", fregs[0x01], fregs[0x00], fregs[0x03], fregs[0x02]); fregs[0x04] = 0x05; fregs[0x06] = 0x80; fregs[0x07] = 0x02; if (dev->type == 4) @@ -1181,7 +1192,7 @@ piix_reset_hard(piix_t *dev) /* Function 3: Power Management */ if (dev->type > 3) { fregs = (uint8_t *) dev->regs[3]; - piix_log("PIIX Function 3: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]); + piix_log("PIIX Function 3: %02X%02X:%02X%02X\n", fregs[0x01], fregs[0x00], fregs[0x03], fregs[0x02]); fregs[0x06] = 0x80; fregs[0x07] = 0x02; fregs[0x08] = (dev->rev & 0x08) ? 0x02 : (dev->rev & 0x07); fregs[0x0a] = 0x80; fregs[0x0b] = 0x06; @@ -1391,3 +1402,17 @@ const device_t piix4e_device = NULL, NULL }; + +const device_t slc90e66_device = +{ + "SMSC SLC90E66 (Victory66)", + DEVICE_PCI, + 0x94600004, + piix_init, + piix_close, + NULL, + NULL, + NULL, + NULL, + NULL +};