From 3465198d320360634f8fc342fa46ef9867a42418 Mon Sep 17 00:00:00 2001 From: Panagiotis <58827426+tiseno100@users.noreply.github.com> Date: Tue, 20 Oct 2020 20:45:12 +0300 Subject: [PATCH 1/3] Apollo ProMedia Implementation Needed for excessive 686A/B development --- src/chipset/via_apollo.c | 183 ++++++++++++++++++++++++++--------- src/device/pci_bridge.c | 16 +++ src/include/86box/chipset.h | 1 + src/include/86box/machine.h | 1 + src/include/86box/pci.h | 1 + src/machine/m_at_socket370.c | 54 ++++++++++- src/machine/machine_table.c | 1 + 7 files changed, 212 insertions(+), 45 deletions(-) diff --git a/src/chipset/via_apollo.c b/src/chipset/via_apollo.c index e85bc5191..fae8f255f 100644 --- a/src/chipset/via_apollo.c +++ b/src/chipset/via_apollo.c @@ -35,10 +35,14 @@ #include <86box/chipset.h> #include <86box/spd.h> +#define VIA_597 0x05970100 +#define VIA_598 0x05980000 +#define VIA_691 0x06910000 +#define VIA_8601 0x86010500 typedef struct via_apollo_t { - uint16_t id; + uint32_t id; uint8_t pci_conf[256]; smram_t *smram; @@ -84,8 +88,8 @@ via_apollo_setup(via_apollo_t *dev) /* Host Bridge */ dev->pci_conf[0x00] = 0x06; /*VIA*/ dev->pci_conf[0x01] = 0x11; - dev->pci_conf[0x02] = dev->id & 0xff; - dev->pci_conf[0x03] = (dev->id >> 8); + dev->pci_conf[0x02] = dev->id >> 16; + dev->pci_conf[0x03] = dev->id >> 24; dev->pci_conf[0x04] = 6; dev->pci_conf[0x05] = 0; @@ -93,8 +97,7 @@ via_apollo_setup(via_apollo_t *dev) dev->pci_conf[0x06] = 0x90; dev->pci_conf[0x07] = 0x02; - if (dev->id == 0x0597) - dev->pci_conf[0x08] = 1; /* Production Silicon ("Revision B") */ + dev->pci_conf[0x08] = dev->id >> 8; dev->pci_conf[0x09] = 0; dev->pci_conf[0x0a] = 0; dev->pci_conf[0x0b] = 6; @@ -105,7 +108,9 @@ via_apollo_setup(via_apollo_t *dev) dev->pci_conf[0x10] = 0x08; dev->pci_conf[0x34] = 0xa0; - if (dev->id == 0x0691) { + if (dev->id == VIA_8601) + dev->pci_conf[0x52] = 0x10; + if (dev->id == VIA_691) { dev->pci_conf[0x56] = 0x01; dev->pci_conf[0x57] = 0x01; } @@ -119,7 +124,7 @@ via_apollo_setup(via_apollo_t *dev) dev->pci_conf[0x64] = 0xec; dev->pci_conf[0x65] = 0xec; dev->pci_conf[0x66] = 0xec; - if (dev->id == 0x0691) + if (dev->id == VIA_691) dev->pci_conf[0x67] = 0xec; /* DRAM Timing for Banks 6,7. */ dev->pci_conf[0x6b] = 0x01; @@ -138,7 +143,7 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) if (func) return; - + /*Read-only addresses*/ if ((addr < 4) || ((addr >= 5) && (addr < 7)) || ((addr >= 8) && (addr < 0xd)) || ((addr >= 0xe) && (addr < 0x12)) || ((addr >= 0x14) && (addr < 0x50)) || @@ -148,9 +153,9 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) ((addr >= 0xad) && (addr < 0xf0)) || ((addr >= 0xf8) && (addr < 0xfc)) || (addr == 0xfd)) return; - if (((addr == 0x78) || (addr >= 0xad)) && (dev->id == 0x0597)) + if (((addr == 0x78) || (addr >= 0xad)) && (dev->id == VIA_597)) return; - if (((addr == 0x67) || ((addr >= 0xf0) && (addr < 0xfc))) && (dev->id != 0x0691)) + if (((addr == 0x67) || ((addr >= 0xf0) && (addr < 0xfc))) && (dev->id != VIA_691)) return; switch(addr) { @@ -161,7 +166,11 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) dev->pci_conf[0x07] &= ~(val & 0xb0); break; case 0x0d: + if(dev->id == VIA_8601) dev->pci_conf[0x0d] = (dev->pci_conf[0x0d] & ~0x07) | (val & 0x07); + else + dev->pci_conf[0x0d] = (dev->pci_conf[0x0d] & ~0x07) | (val & 0x07); + dev->pci_conf[0x75] = (dev->pci_conf[0x75] & ~0x30) | ((val & 0x06) << 3); break; @@ -173,45 +182,51 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) break; case 0x50: /* Cache Control 1 */ - if (dev->id == 0x0691) + if (dev->id == VIA_8601) + dev->pci_conf[0x50] = (dev->pci_conf[0x50] & ~0xd3) | (val & 0xd3); + else if (dev->id == VIA_691) dev->pci_conf[0x50] = val; else dev->pci_conf[0x50] = (dev->pci_conf[0x50] & ~0xf8) | (val & 0xf8); break; case 0x51: /* Cache Control 2 */ - if (dev->id == 0x0691) + if (dev->id >= VIA_691) dev->pci_conf[0x51] = val; else dev->pci_conf[0x51] = (dev->pci_conf[0x51] & ~0xeb) | (val & 0xeb); break; case 0x52: /* Non_Cacheable Control */ - if (dev->id == 0x0691) + if (dev->id == VIA_8601) + dev->pci_conf[0x52] = (dev->pci_conf[0x52] & ~0xdf) | (val & 0xdf); + else if (dev->id == VIA_691) dev->pci_conf[0x52] = (dev->pci_conf[0x52] & ~0x9f) | (val & 0x9f); else dev->pci_conf[0x52] = (dev->pci_conf[0x52] & ~0xf5) | (val & 0xf5); break; case 0x53: /* System Performance Control */ - if (dev->id == 0x0691) + if (dev->id == VIA_8601) + dev->pci_conf[0x53] = (dev->pci_conf[0x53] & ~0xfc) | (val & 0xfc); + else if (dev->id == VIA_691) dev->pci_conf[0x53] = val; else dev->pci_conf[0x53] = (dev->pci_conf[0x53] & ~0xf0) | (val & 0xf0); break; case 0x56: case 0x57: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: /* DRAM Row Ending Address */ - if (dev->id >= 0x0691) + if (dev->id >= VIA_691) spd_write_drbs(dev->pci_conf, 0x5a, 0x56, 8); else if (addr >= 0x5a) spd_write_drbs(dev->pci_conf, 0x5a, 0x5f, 8); break; case 0x58: - if (dev->id == 0x0597) + if ((dev->id == VIA_597) || (dev->id == VIA_8601)) dev->pci_conf[0x58] = (dev->pci_conf[0x58] & ~0xee) | (val & 0xee); else dev->pci_conf[0x58] = val; break; case 0x59: - if (dev->id == 0x0691) + if (dev->id == VIA_691) dev->pci_conf[0x59] = val; else dev->pci_conf[0x59] = (dev->pci_conf[0x59] & ~0xf0) | (val & 0xf0); @@ -248,7 +263,7 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) apollo_map(0xe0000, 0x10000, (val & 0xc0) >> 6); dev->pci_conf[0x63] = val; smram_disable_all(); - if (dev->id == 0x0691) switch (val & 0x03) { + if (dev->id >= VIA_691) switch (val & 0x03) { case 0x00: default: apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1); /* SMM: Code DRAM, Data DRAM */ @@ -271,21 +286,21 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) default: /* Disable SMI Address Redirection (default) */ apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 0); - if (dev->id == 0x0597) + if (dev->id == VIA_597) apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1); apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 0); break; case 0x01: /* Allow access to DRAM Axxxx-Bxxxx for both normal and SMI cycles */ apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1); - if (dev->id == 0x0597) + if (dev->id == VIA_597) apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1); apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 1); break; case 0x02: /* Reserved */ apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 3); - if (dev->id == 0x0597) { + if (dev->id == VIA_597) { /* SMI 3xxxx-4xxxx redirect to Axxxx-Bxxxx. */ apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1); } @@ -294,38 +309,46 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) case 0x03: /* Allow SMI Axxxx-Bxxxx DRAM access */ apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1); - if (dev->id == 0x0597) + if (dev->id == VIA_597) apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1); apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 0); break; } break; case 0x68: - if (dev->id == 0x0597) + if (dev->id == VIA_597) dev->pci_conf[0x68] = (dev->pci_conf[0x6b] & ~0xfe) | (val & 0xfe); - else if (dev->id == 0x0598) + else if ((dev->id == VIA_598) || (dev->id == VIA_8601)) dev->pci_conf[0x68] = val; else dev->pci_conf[0x68] = (dev->pci_conf[0x6b] & ~0xfd) | (val & 0xfd); break; + case 0x69: + if (dev->id == VIA_8601) + dev->pci_conf[0x69] = (dev->pci_conf[0x69] & ~0xfe) | (val & 0xfe); + else + dev->pci_conf[0x69] = val; + break; case 0x6b: - if (dev->id == 0x0691) + if (dev->id == VIA_8601) + dev->pci_conf[0x6b] = val; + else if (dev->id == VIA_691) dev->pci_conf[0x6b] = (dev->pci_conf[0x6b] & ~0xcf) | (val & 0xcf); else dev->pci_conf[0x6b] = (dev->pci_conf[0x6b] & ~0xc1) | (val & 0xc1); break; case 0x6c: - if (dev->id == 0x0597) + if ((dev->id == VIA_597) || (dev->id == VIA_8601)) dev->pci_conf[0x6c] = (dev->pci_conf[0x6c] & ~0x1f) | (val & 0x1f); - else if (dev->id == 0x0598) + else if (dev->id == VIA_598) dev->pci_conf[0x6c] = (dev->pci_conf[0x6c] & ~0x7f) | (val & 0x7f); else dev->pci_conf[0x6c] = val; break; case 0x6d: - if (dev->id == 0x0597) + if (dev->id == VIA_597) dev->pci_conf[0x6d] = (dev->pci_conf[0x6d] & ~0x0f) | (val & 0x0f); - else if (dev->id == 0x0598) + else if ((dev->id == VIA_598) || (dev->id == VIA_8601)) dev->pci_conf[0x6d] = (dev->pci_conf[0x6d] & ~0x7f) | (val & 0x7f); else dev->pci_conf[0x6d] = val; @@ -335,24 +358,52 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) break; case 0x70: - if (dev->id == 0x0597) + if (dev->id == VIA_8601) + dev->pci_conf[0x70] = (dev->pci_conf[0x70] & ~0xdf) | (val & 0xdf); + else if (dev->id == VIA_597) dev->pci_conf[0x70] = (dev->pci_conf[0x70] & ~0xf1) | (val & 0xf1); else dev->pci_conf[0x70] = val; break; + case 0x73: + if (dev->id == VIA_8601) + dev->pci_conf[0x73] = (dev->pci_conf[0x73] & ~0x7f) | (val & 0x7f); + else + dev->pci_conf[0x73] = val; + break; case 0x74: - dev->pci_conf[0x74] = (dev->pci_conf[0x74] & ~0xc0) | (val & 0xc0); + if (dev->id == VIA_8601) + dev->pci_conf[0x74] = (dev->pci_conf[0x74] & ~0xdf) | (val & 0xdf); + else + dev->pci_conf[0x74] = (dev->pci_conf[0x74] & ~0xc0) | (val & 0xc0); break; case 0x75: - dev->pci_conf[0x75] = (dev->pci_conf[0x75] & ~0xcf) | (val & 0xcf); + if (dev->id == VIA_8601) + dev->pci_conf[0x75] = val; + else + dev->pci_conf[0x75] = (dev->pci_conf[0x75] & ~0xcf) | (val & 0xcf); break; case 0x76: - dev->pci_conf[0x76] = (dev->pci_conf[0x76] & ~0xf0) | (val & 0xf0); + if (dev->id == VIA_8601) + dev->pci_conf[0x75] = val; + else + dev->pci_conf[0x76] = (dev->pci_conf[0x76] & ~0xf0) | (val & 0xf0); break; case 0x77: + if (dev->id != VIA_8601) dev->pci_conf[0x77] = (dev->pci_conf[0x77] & ~0xc0) | (val & 0xc0); break; + case 0x78: + dev->pci_conf[0x78] = (dev->pci_conf[0x78] & ~0xd5) | (val & 0xd5); + break; + case 0x79: + dev->pci_conf[0x79] = (dev->pci_conf[0x79] & ~0xfc) | (val & 0xfc); + break; + case 0x7a: + dev->pci_conf[0x7a] = (dev->pci_conf[0x7a] & ~0x89) | (val & 0x89); + break; case 0x7e: + if (dev->id != VIA_8601) dev->pci_conf[0x7e] = (dev->pci_conf[0x7e] & ~0x3f) | (val & 0x3f); break; @@ -361,14 +412,25 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) break; case 0x84: /* The datasheet first mentions 7-0 but then says 3-0 are reserved - - - minimum of 16 MB for the graphics aperture? */ - dev->pci_conf[0x84] = (dev->pci_conf[0x84] & ~0xf0) | (val & 0xf0); + - minimum of 16 MB for the graphics aperture? 8601 datasheet doesn't refer it. */ + if(dev->id == VIA_8601) + dev->pci_conf[0x84] = val; + else + dev->pci_conf[0x84] = (dev->pci_conf[0x84] & ~0xf0) | (val & 0xf0); break; case 0x88: - dev->pci_conf[0x88] = (dev->pci_conf[0x88] & ~0x07) | (val & 0x07); + if(dev->id == VIA_8601) + dev->pci_conf[0x88] = (dev->pci_conf[0x88] & ~0x06) | (val & 0x06); + else + dev->pci_conf[0x88] = (dev->pci_conf[0x88] & ~0x07) | (val & 0x07); break; case 0x89: - dev->pci_conf[0x89] = (dev->pci_conf[0x89] & ~0xf0) | (val & 0xf0); + case 0x8a: + case 0x8b: + if(dev->id == VIA_8601) + dev->pci_conf[addr] = val; + else + dev->pci_conf[0x89] = (dev->pci_conf[0x89] & ~0xf0) | (val & 0xf0); break; case 0xa8: @@ -378,13 +440,29 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv) dev->pci_conf[0xa9] = (dev->pci_conf[0xa9] & ~0x03) | (val & 0x03); break; case 0xac: + if(dev->id == VIA_8601) + dev->pci_conf[0xac] = (dev->pci_conf[0xac] & ~0x7f) | (val & 0x7f); + else + dev->pci_conf[0xac] = (dev->pci_conf[0xac] & ~0x0f) | (val & 0x0f); + break; + case 0xad: dev->pci_conf[0xac] = (dev->pci_conf[0xac] & ~0x0f) | (val & 0x0f); break; + case 0xfc: - if (dev->id > 0x0597) + if (dev->id == VIA_8601) + dev->pci_conf[0xfc] = (dev->pci_conf[0xfc] & ~0x03) | (val & 0x03); + else if (dev->id > VIA_597) dev->pci_conf[0xfc] = (dev->pci_conf[0xfc] & ~0x01) | (val & 0x01); break; + case 0xfd: + if (dev->id == VIA_8601) + dev->pci_conf[0xfd] = (dev->pci_conf[0xfd] & ~0x07) | (val & 0x07); + else + dev->pci_conf[0xfd] = val; + break; + default: dev->pci_conf[addr] = val; break; @@ -442,17 +520,21 @@ via_apollo_init(const device_t *info) dev->id = info->local; switch (dev->id) { - case 0x0597: + case VIA_597: device_add(&via_vp3_agp_device); break; - case 0x0598: + case VIA_598: device_add(&via_mvp3_agp_device); break; - case 0x0691: + case VIA_691: device_add(&via_apro_agp_device); break; + + case VIA_8601: + device_add(&via_vt8601_agp_device); + break; } via_apollo_setup(dev); @@ -477,7 +559,7 @@ const device_t via_vp3_device = { "VIA Apollo VP3", DEVICE_PCI, - 0x0597, /*VT82C597*/ + VIA_597, /*VT82C597*/ via_apollo_init, via_apollo_close, via_apollo_reset, @@ -491,7 +573,7 @@ const device_t via_mvp3_device = { "VIA Apollo MVP3", DEVICE_PCI, - 0x0598, /*VT82C598MVP*/ + VIA_598, /*VT82C598MVP*/ via_apollo_init, via_apollo_close, via_apollo_reset, @@ -504,7 +586,20 @@ const device_t via_mvp3_device = const device_t via_apro_device = { "VIA Apollo Pro", DEVICE_PCI, - 0x0691, /*VT82C691*/ + VIA_691, /*VT82C691*/ + via_apollo_init, + via_apollo_close, + via_apollo_reset, + NULL, + NULL, + NULL, + NULL +}; + +const device_t via_vt8601_device = { + "VIA Apollo ProMedia", + DEVICE_PCI, + VIA_8601, /*VT8601*/ via_apollo_init, via_apollo_close, via_apollo_reset, diff --git a/src/device/pci_bridge.c b/src/device/pci_bridge.c index 1e66a339d..53e64f989 100644 --- a/src/device/pci_bridge.c +++ b/src/device/pci_bridge.c @@ -39,6 +39,7 @@ #define AGP_BRIDGE_VIA_597 0x11068597 #define AGP_BRIDGE_VIA_598 0x11068598 #define AGP_BRIDGE_VIA_691 0x11068691 +#define AGP_BRIDGE_VIA_8601 0x11068601 #define AGP_BRIDGE_VIA(x) (((x) >> 16) == 0x1106) #define AGP_BRIDGE(x) ((x) >= AGP_BRIDGE_VIA_597) @@ -227,6 +228,7 @@ pci_bridge_reset(void *priv) case AGP_BRIDGE_VIA_597: case AGP_BRIDGE_VIA_598: case AGP_BRIDGE_VIA_691: + case AGP_BRIDGE_VIA_8601: dev->regs[0x04] = 0x07; dev->regs[0x06] = 0x20; dev->regs[0x07] = 0x02; @@ -406,3 +408,17 @@ const device_t via_apro_agp_device = NULL, NULL }; + +const device_t via_vt8601_agp_device = +{ + "VIA Apollo ProMedia AGP Bridge", + DEVICE_PCI, + AGP_BRIDGE_VIA_8601, + pci_bridge_init, + NULL, + pci_bridge_reset, + NULL, + NULL, + NULL, + NULL +}; diff --git a/src/include/86box/chipset.h b/src/include/86box/chipset.h index a6cdf8742..fd16d27c0 100644 --- a/src/include/86box/chipset.h +++ b/src/include/86box/chipset.h @@ -120,6 +120,7 @@ extern const device_t via_vpx_device; extern const device_t via_vp3_device; extern const device_t via_mvp3_device; extern const device_t via_apro_device; +extern const device_t via_vt8601_device; extern const device_t via_vt82c586b_device; extern const device_t via_vt82c596_device; extern const device_t via_vt82c596b_device; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index f333c9b3f..64244d784 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -478,6 +478,7 @@ extern int machine_at_awo671r_init(const machine_t *); extern int machine_at_63a_init(const machine_t *); extern int machine_at_s370sba_init(const machine_t *); extern int machine_at_apas3_init(const machine_t *); +extern int machine_at_603tcf_init(const machine_t *); /* m_at_misc.c */ extern int machine_at_vpc2007_init(const machine_t *); diff --git a/src/include/86box/pci.h b/src/include/86box/pci.h index 2117dcbfb..07b1f3097 100644 --- a/src/include/86box/pci.h +++ b/src/include/86box/pci.h @@ -122,6 +122,7 @@ extern const device_t i440gx_agp_device; extern const device_t via_vp3_agp_device; extern const device_t via_mvp3_agp_device; extern const device_t via_apro_agp_device; +extern const device_t via_vt8601_agp_device; #endif diff --git a/src/machine/m_at_socket370.c b/src/machine/m_at_socket370.c index 0848e95f8..d313b4385 100644 --- a/src/machine/m_at_socket370.c +++ b/src/machine/m_at_socket370.c @@ -276,7 +276,6 @@ machine_at_63a_init(const machine_t *model) return ret; } - int machine_at_apas3_init(const machine_t *model) { @@ -307,3 +306,56 @@ machine_at_apas3_init(const machine_t *model) return ret; } + +int +machine_at_603tcf_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/603tcf/603tcfA4.BIN", + 0x000c0000, 262144, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init_ex(model, 2); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 0, 0); + pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x01, PCI_CARD_SPECIAL, 1, 2, 3, 4); + device_add(&via_vt8601_device); + device_add(&via_vt82c686b_device); + device_add(&via_vt82c686_sio_device); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&sst_flash_39sf020_device); + spd_register(SPD_TYPE_SDRAM, 0x3, 256); + + hwm_values_t machine_hwm = { + { /* fan speeds */ + 3000, /* Chassis */ + 3000, /* CPU */ + 3000 /* Power */ + }, { /* temperatures */ + 30, /* MB */ + 30, /* JTPWR */ + 30 /* CPU */ + }, { /* voltages */ + 2050, /* VCORE (2.05V by default) */ + 0, /* unused */ + 3300, /* +3.3V */ + RESISTOR_DIVIDER(5000, 11, 16), /* +5V (divider values bruteforced) */ + RESISTOR_DIVIDER(12000, 28, 10), /* +12V (28K/10K divider suggested in the W83781D datasheet) */ + RESISTOR_DIVIDER(12000, 59, 20), /* -12V (divider values bruteforced) */ + RESISTOR_DIVIDER(5000, 1, 2) /* -5V (divider values bruteforced) */ + } + }; + hwm_set_values(machine_hwm); + device_add(&via_vt82c686_hwm_device); + + return ret; +} diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index e011ad15f..2c47728c6 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -399,6 +399,7 @@ const machine_t machines[] = { /* VIA Apollo Pro */ { "[VIA Apollo Pro] PC Partner APAS3", "apas3", MACHINE_TYPE_SOCKET370, {{"Intel", cpus_Celeron}, {"VIA", cpus_Cyrix3}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8, 768, 8, 255, machine_at_apas3_init, NULL }, + { "[VIA Apollo ProMedia] Jetway 603TCF", "603tcf", MACHINE_TYPE_SOCKET370, {{"Intel", cpus_Celeron}, {"VIA", cpus_Cyrix3}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8, 512, 8, 255, machine_at_603tcf_init, NULL }, /* Miscellaneous/Fake/Hypervisor machines */ { "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, {{"Intel", cpus_PentiumIID}, {"Intel/PGA370", cpus_Celeron},{"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8, 1024, 8, 255, machine_at_vpc2007_init, NULL }, From c9ee3864bf61ff9dd96fc5ab7047d585e71b0ea1 Mon Sep 17 00:00:00 2001 From: Panagiotis <58827426+tiseno100@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:47:40 +0300 Subject: [PATCH 2/3] Tiny fix on the VIA PIPC suspension. Fixes dozens of boards. For some reason. SCI suspension was programmed while it's read-only. --- src/chipset/via_pipc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index 4c4917002..232f0ec89 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -53,7 +53,7 @@ #include <86box/chipset.h> #include <86box/sio.h> #include <86box/hwm.h> - +#define ENABLE_PIPC_LOG 1 /* Most revision numbers (PCI-ISA bridge or otherwise) were lifted from PCI device listings on forums, as VIA's datasheets are not very helpful regarding those. */ @@ -268,8 +268,9 @@ pipc_reset_hard(void *priv) dev->power_regs[0x08] = 0x40; break; } - if (dev->local >= VIA_PIPC_686A) - dev->power_regs[0x42] = 0x40; /* external suspend-related pin, must be set */ + dev->power_regs[0x40] = 0x20; + + dev->power_regs[0x42] = 0xd0; dev->power_regs[0x48] = 0x01; if (dev->local >= VIA_PIPC_686A) @@ -754,7 +755,7 @@ pipc_write(int func, int addr, uint8_t val, void *priv) break; case 0x42: - dev->power_regs[addr] = val & 0x0f; + dev->power_regs[addr] = (dev->power_regs[0x42] & ~0x0f) | (val & 0x0f); break; case 0x61: case 0x62: case 0x63: From 274508e7447dcd3edfa8155b8fc213c6ff70b461 Mon Sep 17 00:00:00 2001 From: Panagiotis <58827426+tiseno100@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:48:32 +0300 Subject: [PATCH 3/3] removed PIPC logging --- src/chipset/via_pipc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index 232f0ec89..0a3ed3ed9 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -53,7 +53,6 @@ #include <86box/chipset.h> #include <86box/sio.h> #include <86box/hwm.h> -#define ENABLE_PIPC_LOG 1 /* Most revision numbers (PCI-ISA bridge or otherwise) were lifted from PCI device listings on forums, as VIA's datasheets are not very helpful regarding those. */