diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 3fc4d43df..98b885cd7 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -537,7 +537,7 @@ cpu_set(void) is_p6 = (cpu_s->cpu_type == CPU_PENTIUMPRO) || (cpu_s->cpu_type == CPU_PENTIUM2) || (cpu_s->cpu_type == CPU_PENTIUM2D); /* The Samuel 2 datasheet claims it's Celeron-compatible. */ - is_p6 |= (cpu_s->cpu_type == CPU_CYRIX3S); + is_p6 |= (cpu_s->cpu_type == CPU_CYRIX3S) || (cpu_s->cpu_type == CPU_EDEN); #if defined(DEV_BRANCH) && defined(USE_CYRIX_6X86) is_cx6x86 = (cpu_s->cpu_type == CPU_Cx6x86) || (cpu_s->cpu_type == CPU_Cx6x86MX) || (cpu_s->cpu_type == CPU_Cx6x86L) || (cpu_s->cpu_type == CPU_CxGX1); @@ -1807,6 +1807,7 @@ cpu_set(void) break; case CPU_CYRIX3S: + case CPU_EDEN: /* This till proper timings get discovered */ #ifdef USE_DYNAREC x86_setopcodes(ops_386, ops_winchip2_0f, dynarec_ops_386, dynarec_ops_winchip2_0f); #else @@ -2600,6 +2601,65 @@ cpu_CPUID(void) break; } break; + + case CPU_EDEN: + switch (EAX) + { + case 0: + EAX = 1; + if (msr.fcr2 & (1 << 14)) + { + EBX = msr.fcr3 >> 32; + ECX = msr.fcr3 & 0xffffffff; + EDX = msr.fcr2 >> 32; + } + else + { + EBX = 0x746e6543; /*CentaurHauls*/ + ECX = 0x736c7561; + EDX = 0x48727561; + } + break; + case 1: + EAX = CPUID; + EBX = ECX = 0; + EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MMX | CPUID_MTRR; + if (cpu_has_feature(CPU_FEATURE_CX8)) + EDX |= CPUID_CMPXCHG8B; + break; + case 0x80000000: + EAX = 0x80000006; + break; + case 0x80000001: + EAX = CPUID; + EDX = CPUID_FPU | CPUID_TSC | CPUID_MSR | CPUID_MMX | CPUID_MTRR | CPUID_3DNOW; + if (cpu_has_feature(CPU_FEATURE_CX8)) + EDX |= CPUID_CMPXCHG8B; + break; + case 0x80000002: /*Processor name string*/ + case 0x80000003: + case 0x80000004: + EAX = 0x20414956; /*VIA Samuel 2*/ + EBX = 0x756d6153; + ECX = 0x32206c65; + EDX = 0x00000000; + break; + + case 0x80000005: /*Cache information*/ + EBX = 0x08800880; /*TLBs*/ + ECX = 0x40040120; /*L1 data cache*/ + EDX = 0x40020120; /*L1 instruction cache*/ + break; + + case 0x80000006: + ECX = 0x40040120; /*L2 data cache*/ + break; + + default: + EAX = EBX = ECX = EDX = 0; + break; + } + break; } } @@ -2714,6 +2774,7 @@ void cpu_RDMSR() break; case CPU_CYRIX3S: + case CPU_EDEN: EAX = EDX = 0; switch (ECX) { @@ -3318,6 +3379,7 @@ void cpu_WRMSR() } break; case CPU_CYRIX3S: + case CPU_EDEN: switch (ECX) { case 0x10: diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index ffe4c129e..061f8154c 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -81,6 +81,7 @@ enum { CPU_K6_2P, CPU_K6_3P, CPU_CYRIX3S, + CPU_EDEN, CPU_PENTIUMPRO, /* 686 class CPUs */ CPU_PENTIUM2, CPU_PENTIUM2D @@ -108,7 +109,8 @@ enum { CPU_PKG_SOCKET8 = (1 << 18), CPU_PKG_SLOT1 = (1 << 19), CPU_PKG_SLOT2 = (1 << 20), - CPU_PKG_SOCKET370 = (1 << 21) + CPU_PKG_SOCKET370 = (1 << 21), + CPU_PKG_EBGA368 = (1 << 22) }; diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index dda032c19..94cc0d169 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -967,6 +967,16 @@ const cpu_family_t cpu_families[] = { {"733", CPU_CYRIX3S, fpus_internal, 733333333, 5.5, 2050, 0x663, 0x663, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 66, 66, 18, 18, 88}, {"", 0} } + }, { + .package = CPU_PKG_SOCKET370, + .manufacturer = "VIA", + .name = "Eden(Model 7)", + .internal_name = "c3_eden", + .cpus = (const CPU[]) { + {"100", CPU_EDEN, fpus_internal, 100000000, 1.5, 2050, 0x673, 0x673, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 9, 9, 4, 4, 12}, /* out of spec */ + {"400", CPU_EDEN, fpus_internal, 400000000, 6.0, 2050, 0x673, 0x673, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 36, 36, 17, 17, 48}, + {"600", CPU_EDEN, fpus_internal, 600000000, 6.0, 2050, 0x673, 0x673, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 54, 54, 18, 18, 72}, + } }, { .package = 0, } diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index a419de290..4673d37f5 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -106,6 +106,7 @@ enum { MACHINE_TYPE_SLOT1, MACHINE_TYPE_SLOT2, MACHINE_TYPE_SOCKET370, + MACHINE_TYPE_EBGA368, MACHINE_TYPE_MISC, MACHINE_TYPE_MAX }; @@ -532,6 +533,9 @@ extern int machine_at_603tcf_init(const machine_t *); extern int machine_at_trinity371_init(const machine_t *); extern int machine_at_p6bap_init(const machine_t *); +/* m_at_ebga368.c */ +extern int machine_at_arb9673_init(const machine_t *); + /* m_at_misc.c */ extern int machine_at_vpc2007_init(const machine_t *); diff --git a/src/machine/CMakeLists.txt b/src/machine/CMakeLists.txt index 846ab6074..9df45ef05 100644 --- a/src/machine/CMakeLists.txt +++ b/src/machine/CMakeLists.txt @@ -20,7 +20,8 @@ add_library(mch OBJECT machine.c machine_table.c m_xt.c m_xt_compaq.c m_at_t3100e.c m_at_t3100e_vid.c m_ps1.c m_ps1_hdc.c m_ps2_isa.c m_ps2_mca.c m_at_compaq.c m_at_286_386sx.c m_at_386dx_486.c m_at_socket4_5.c m_at_socket7.c m_at_sockets7.c m_at_socket8.c - m_at_slot1.c m_at_slot2.c m_at_socket370.c m_at_misc.c) + m_at_slot1.c m_at_slot2.c m_at_socket370.c m_at_ebga368.c + m_at_misc.c) if(HEDAKA) target_compile_definitions(mch PRIVATE USE_HEDAKA) diff --git a/src/machine/m_at_ebga368.c b/src/machine/m_at_ebga368.c new file mode 100644 index 000000000..b6ac02418 --- /dev/null +++ b/src/machine/m_at_ebga368.c @@ -0,0 +1,71 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * Implementation of VIA EBGA368 Based Single Board Computers. + * + * Note: 86Box doesn't emulate all the components a SBC may have. + * + * Authors: Miran Grca, + * Tiseno100 + * + * Copyright 2016-2019 Miran Grca. + * Copyright 2021 Tiseno100. + */ +#include +#include +#include +#include +#include +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/chipset.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/keyboard.h> +#include <86box/flash.h> +#include <86box/sio.h> +#include <86box/hwm.h> +#include <86box/spd.h> +#include <86box/video.h> +#include "cpu.h" +#include <86box/machine.h> + +int +machine_at_arb9673_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/arb9673/W9673.v12", + 0x00080000, 524288, 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, 3, 4); + 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(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); + device_add(&via_vt8601_device); + device_add(&via_vt82c686b_device); + device_add(&via_vt82c686_sio_device); + device_add(&via_vt82c686_hwm_device); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&sst_flash_39sf040_device); + spd_register(SPD_TYPE_SDRAM, 0xf, 32); + + + return ret; +} diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 8c7b6cd71..02115cafa 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -50,6 +50,7 @@ const machine_type_t machine_types[] = { { "Slot 1", MACHINE_TYPE_SLOT1 }, { "Slot 2", MACHINE_TYPE_SLOT2 }, { "Socket 370", MACHINE_TYPE_SOCKET370 }, + { "EBGA 368", MACHINE_TYPE_EBGA368 }, { "Miscellaneous", MACHINE_TYPE_MISC } }; @@ -433,6 +434,10 @@ const machine_t machines[] = { { "[VIA Apollo Pro133A] Acorp 6VIA90AP", "6via90ap", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1572864, 8192, 255, machine_at_6via90ap_init, NULL }, { "[VIA Apollo ProMedia] Jetway 603TCF", "603tcf", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 150000000, 1300, 3500, 2.0, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_603tcf_init, NULL }, + /* PGA370 machines */ + /* VIA Apollo Pro */ + { "[VIA Apollo ProMedia] Acrosser AR-B9673", "arb9673", MACHINE_TYPE_EBGA368, CPU_PKG_EBGA368, 0, 66666667, 150000000, 1300, 3500, 2.0, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 131072,131072, 0, 31, machine_at_arb9673_init, NULL }, + /* Miscellaneous/Fake/Hypervisor machines */ { "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, CPU_PKG_SLOT1, CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), 0, 0, 0, 0, 0, 0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, machine_at_vpc2007_init, NULL }, diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 162512e66..9124db63f 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -644,6 +644,7 @@ MCHOBJ := machine.o machine_table.o \ m_at_286_386sx.o m_at_386dx_486.o \ m_at_socket4_5.o m_at_socket7.o m_at_sockets7.o \ m_at_socket8.o m_at_slot1.o m_at_slot2.o m_at_socket370.o \ + m_at_ebga368.o \ m_at_misc.o DEVOBJ := bugger.o hwm.o hwm_lm75.o hwm_lm78.o hwm_gl518sm.o hwm_vt82c686.o ibm_5161.o isamem.o isartc.o \