From 710796a180aa7afe93314d769f9453d03e9eb3f0 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 6 Jul 2020 21:12:09 -0300 Subject: [PATCH] Add ITOX STAR, a STPC Client machine with hardware monitoring and AMIBIOS 6 --- src/chipset/stpc.c | 14 ++++++++++ src/include/86box/machine.h | 1 + src/machine/m_at_386dx_486.c | 53 ++++++++++++++++++++++++++++++++++-- src/machine/machine_table.c | 1 + 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/src/chipset/stpc.c b/src/chipset/stpc.c index 915621339..399f0ab00 100644 --- a/src/chipset/stpc.c +++ b/src/chipset/stpc.c @@ -558,6 +558,20 @@ stpc_init(const device_t *info) } +const device_t stpc_client_device = +{ + "STPC Client", + DEVICE_PCI, + 0, + stpc_init, + stpc_close, + stpc_reset, + NULL, + NULL, + NULL, + NULL +}; + const device_t stpc_consumer2_device = { "STPC Consumer-II", diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 3848e7762..918d007f5 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -283,6 +283,7 @@ extern int machine_at_alfredo_init(const machine_t *); extern int machine_at_486sp3g_init(const machine_t *); extern int machine_at_486ap4_init(const machine_t *); #if defined(DEV_BRANCH) && defined(USE_STPC) +extern int machine_at_itoxstar_init(const machine_t *); extern int machine_at_arb1479_init(const machine_t *); extern int machine_at_pcm9340_init(const machine_t *); extern int machine_at_pcm5330_init(const machine_t *); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 5f600e98d..55cbf7589 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -611,8 +611,57 @@ machine_at_486ap4_init(const machine_t *model) return ret; } - +#include <86box/hwm.h> #if defined(DEV_BRANCH) && defined(USE_STPC) +int +machine_at_itoxstar_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/itoxstar/stara.rom", + 0x000c0000, 262144, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x0B, PCI_CARD_SPECIAL, 0, 0, 0, 0); + pci_register_slot(0x0C, PCI_CARD_SPECIAL, 0, 0, 0, 0); + pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 0, 0, 0); + pci_register_slot(0x1E, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x1D, PCI_CARD_NORMAL, 3, 4, 1, 2); + device_add(&w83977f_device); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&stpc_client_device); + device_add(&ide_pci_device); + device_add(&sst_flash_39sf020_device); + + hwm_values_t machine_hwm = { + { /* fan speeds (incorrect divisor for some reason) */ + 3000, /* Chassis */ + 3000 /* CPU */ + }, { /* temperatures */ + 30, /* Chassis */ + 30 /* CPU */ + }, { /* voltages */ + 0, /* unused */ + 0, /* unused */ + 3300, /* Vio */ + 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, 853, 347), /* -12V (divider values bruteforced) */ + RESISTOR_DIVIDER(5000, 1, 2) /* -5V (divider values bruteforced) */ + } + }; + hwm_set_values(machine_hwm); + device_add(&w83781d_device); + + return ret; +} + + int machine_at_arb1479_init(const machine_t *model) { @@ -636,7 +685,7 @@ machine_at_arb1479_init(const machine_t *model) device_add(&keyboard_ps2_ami_pci_device); device_add(&stpc_consumer2_device); device_add(&ide_pci_2ch_device); - device_add(&sst_flash_29ee020_device); + device_add(&sst_flash_39sf020_device); return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 019d844d9..b785f2008 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -228,6 +228,7 @@ const machine_t machines[] = { { "[SiS 496] Rise Computer R418", "r418", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 1, 255, 1, 255, machine_at_r418_init, NULL }, { "[SiS 496] Zida Tomato 4DP", "4dps", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_HDC, 1, 255, 1, 255, machine_at_4dps_init, NULL }, #if defined(DEV_BRANCH) && defined(USE_STPC) + { "[STPC Client] ITOX STAR", "itoxstar", MACHINE_TYPE_486, {{"ST", cpus_STPC}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 255, machine_at_itoxstar_init, NULL }, { "[STPC Consumer-II] Acrosser AR-B1479", "arb1479", MACHINE_TYPE_486, {{"ST", cpus_STPC}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 32, 160, 8, 255, machine_at_arb1479_init, NULL }, { "[STPC Elite] Advantech PCM-9340", "pcm9340", MACHINE_TYPE_486, {{"ST", cpus_STPC}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 32, 32, 0, 255, machine_at_pcm9340_init, NULL }, { "[STPC Atlas] AAEON PCM-5330", "pcm5330", MACHINE_TYPE_486, {{"ST", cpus_STPC}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 64, 64, 0, 255, machine_at_pcm5330_init, NULL },