UMC UM88xx fixes, ALi M1429 documentation, and added the DataExpert 386SX, PC Chips M919, Samsung SPC7700P-LW, and Acrosser AR-B1423C. Also renamed the ALi M1429G AMI WinBIOS 486 to Kaimei 486.
This commit is contained in:
@@ -8,15 +8,71 @@
|
||||
*
|
||||
* Implementation of the ALi M1429 chipset.
|
||||
*
|
||||
* Note: This chipset has no datasheet, everything were done via
|
||||
* reverse engineering the BIOS of various machines using it.
|
||||
* Note: This chipset has no datasheet, everything were done via
|
||||
* reverse engineering the BIOS of various machines using it.
|
||||
*
|
||||
* Authors: Tiseno100
|
||||
*
|
||||
* Copyright 2020 Tiseno100
|
||||
* Authors: Tiseno100,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2020,2021 Tiseno100.
|
||||
* Copyright 2021,2021 Miran Grca.
|
||||
*/
|
||||
|
||||
/*
|
||||
ALi M1429/M1429G Configuration Registers
|
||||
|
||||
Notes: Incorporated sometimes with a M1435 PCI-to-VLB Bridge
|
||||
M1429G is just a 1429 with Green Functionality
|
||||
SMM in it's entirety needs more research
|
||||
|
||||
Warning: Register documentation may be inaccurate!
|
||||
|
||||
Register 03h: Write C5h to unlock the configuration registers
|
||||
|
||||
Register 10h & 11h: DRAM Bank Configuration
|
||||
|
||||
Register 12h:
|
||||
Bit 2: Memory Remapping Enable (128KB)
|
||||
|
||||
Register 13h:
|
||||
Bit 7: Shadow RAM Enable for F8000-FFFFF
|
||||
Bit 6: Shadow RAM Enable for F0000-F7FFF
|
||||
Bit 5: Shadow RAM Enable for E8000-FFFFF
|
||||
Bit 4: Shadow RAM Enable for E0000-F7FFF
|
||||
Bit 3: Shadow RAM Enable for D8000-FFFFF
|
||||
Bit 2: Shadow RAM Enable for D0000-F7FFF
|
||||
Bit 1: Shadow RAM Enable for C8000-FFFFF
|
||||
Bit 0: Shadow RAM Enable for C0000-F7FFF
|
||||
|
||||
Register 14h:
|
||||
Bit 1: Shadow RAM Write for Enabled Segments
|
||||
Bit 0: Shadow RAM Read for Enabled Segments
|
||||
|
||||
Register 18h:
|
||||
Bit 6-5-4 (Cache Size)
|
||||
0 0 0 32KB
|
||||
0 0 1 128KB
|
||||
0 1 0 256KB
|
||||
0 1 1 512KB
|
||||
1 0 0 64KB
|
||||
1 0 1 256KB
|
||||
1 1 0 512KB
|
||||
1 1 1 1MB
|
||||
|
||||
Bit 1: L2 Cache Enable
|
||||
|
||||
Register 20h:
|
||||
Bits 2-1-0: Bus Clock Speed
|
||||
0 0 0: 7.1519Mhz (ATCLK2)
|
||||
0 0 1: CLK2IN/4
|
||||
0 1 0: CLK2IN/5
|
||||
0 1 1: CLK2IN/6
|
||||
1 0 0: CLK2IN/8
|
||||
1 0 1: CLK2IN/10
|
||||
1 1 0: CLK2IN/12
|
||||
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -12,8 +12,10 @@
|
||||
* reverse engineering the BIOS of various machines using it.
|
||||
*
|
||||
* Authors: Tiseno100,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2021 Tiseno100.
|
||||
* Copyright 2021 Miran Grca.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -35,9 +37,9 @@
|
||||
Bits 7-4 PCI IRQ for INTD
|
||||
Bits 3-0 PCI IRQ for INTC
|
||||
|
||||
Function 0 Register 46:
|
||||
Bit 7: PMU Trigger(1: By IRQ/0: By SMI)
|
||||
Bit 6: IRQ SMI Request (1: IRQ 10) (Supposedly 0 according to Phoenix is IRQ 15 but doesn't seem to make sense)
|
||||
Function 0 Register 46 (corrected by Miran Grca):
|
||||
Bit 7: IRQ SMI Request (1: IRQ 15, 0: IRQ 10)
|
||||
Bit 6: PMU Trigger(1: By IRQ/0: By SMI)
|
||||
|
||||
Function 0 Register 56:
|
||||
Bit 1-0 ISA Bus Speed
|
||||
@@ -45,9 +47,17 @@
|
||||
0 1 PCICLK/4
|
||||
1 0 PCICLK/2
|
||||
|
||||
Function 0 Register A3:
|
||||
Function 0 Register A2 - non-software SMI# status register
|
||||
(documented by Miran Grca):
|
||||
Bit 4: I set, graphics card goes into sleep mode
|
||||
This register is most likely R/WC
|
||||
|
||||
Function 0 Register A3 (added more details by Miran Grca):
|
||||
Bit 7: Unlock SMM
|
||||
Bit 6: Software SMI trigger
|
||||
Bit 6: Software SMI trigger (also doubles as software SMI# status register,
|
||||
cleared by writing a 0 to it - see the handler used by Phoenix BIOS'es):
|
||||
If Function 0 Register 46 Bit 6 is set, it raises the specified IRQ (15
|
||||
or 10) instead.
|
||||
|
||||
Function 0 Register A4:
|
||||
Bit 0: Host to PCI Clock (1: 1 by 1/0: 1 by half)
|
||||
@@ -78,6 +88,9 @@
|
||||
#include <86box/chipset.h>
|
||||
|
||||
|
||||
#define IDE_BIT 0x01
|
||||
|
||||
|
||||
#ifdef ENABLE_UMC_8886_LOG
|
||||
int umc_8886_do_log = ENABLE_UMC_8886_LOG;
|
||||
|
||||
@@ -113,10 +126,10 @@ umc_8886_log(const char *fmt, ...)
|
||||
|
||||
typedef struct umc_8886_t
|
||||
{
|
||||
uint8_t pci_conf_sb[2][256]; /* PCI Registers */
|
||||
uint8_t max_func, /* Last function number */
|
||||
pci_conf_sb[2][256]; /* PCI Registers */
|
||||
uint16_t sb_id; /* Southbridge Revision */
|
||||
int has_ide; /* Check if Southbridge Revision is AF or F */
|
||||
|
||||
} umc_8886_t;
|
||||
|
||||
|
||||
@@ -138,7 +151,7 @@ umc_8886_write(int func, int addr, uint8_t val, void *priv)
|
||||
{
|
||||
umc_8886_t *dev = (umc_8886_t *)priv;
|
||||
|
||||
switch (func) {
|
||||
if (func <= dev->max_func) switch (func) {
|
||||
case 0: /* PCI to ISA Bridge */
|
||||
umc_8886_log("UM8886: dev->regs[%02x] = %02x POST %02x\n", addr, val, inb(0x80));
|
||||
|
||||
@@ -171,11 +184,8 @@ umc_8886_write(int func, int addr, uint8_t val, void *priv)
|
||||
break;
|
||||
|
||||
case 0x46:
|
||||
/* Bit 6 seems to be the IRQ/SMI# toggle, 1 = IRQ, 0 = SMI#. */
|
||||
dev->pci_conf_sb[func][addr] = val;
|
||||
|
||||
if (val & 0x40)
|
||||
picint(1 << ((val & 0x80) ? 15 : 10));
|
||||
|
||||
break;
|
||||
|
||||
case 0x47:
|
||||
@@ -208,17 +218,25 @@ umc_8886_write(int func, int addr, uint8_t val, void *priv)
|
||||
case 0x70 ... 0x76:
|
||||
case 0x80: case 0x81:
|
||||
case 0x90 ... 0x92:
|
||||
case 0xa0 ... 0xa2:
|
||||
case 0xa0 ... 0xa1:
|
||||
dev->pci_conf_sb[func][addr] = val;
|
||||
break;
|
||||
|
||||
case 0xa2:
|
||||
dev->pci_conf_sb[func][addr] &= ~val;
|
||||
break;
|
||||
|
||||
case 0xa3:
|
||||
/* SMI Provocation (Bit 7 Enable SMM + Bit 6 Software SMI) */
|
||||
if (((val & 0xc0) == 0xc0) && !(dev->pci_conf_sb[0][0xa3] & 0x40)) {
|
||||
if (dev->pci_conf_sb[0][0x46] & 0x40)
|
||||
picint(1 << ((dev->pci_conf_sb[0][0x46] & 0x80) ? 15 : 10));
|
||||
else
|
||||
smi_line = 1;
|
||||
dev->pci_conf_sb[0][0xa3] |= 0x04;
|
||||
}
|
||||
|
||||
dev->pci_conf_sb[func][addr] = val;
|
||||
|
||||
/* SMI Provocation (Bit 7 Enable SMM + Bit 6 Software SMI */
|
||||
if (((dev->pci_conf_sb[0][0xa3] >> 6) == 3) && !in_smm)
|
||||
smi_line = 1;
|
||||
|
||||
break;
|
||||
|
||||
case 0xa4:
|
||||
@@ -259,8 +277,12 @@ static uint8_t
|
||||
umc_8886_read(int func, int addr, void *priv)
|
||||
{
|
||||
umc_8886_t *dev = (umc_8886_t *)priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
return dev->pci_conf_sb[func][addr];
|
||||
if (func <= dev->max_func)
|
||||
ret = dev->pci_conf_sb[func][addr];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,6 +361,8 @@ umc_8886_init(const device_t *info)
|
||||
if (HAS_IDE)
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
dev->max_func = (HAS_IDE) ? 1 : 0;
|
||||
|
||||
/* Get the Southbridge Revision */
|
||||
SB_ID = info->local;
|
||||
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
* around the web.
|
||||
*
|
||||
* Authors: Tiseno100,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2021 Tiseno100.
|
||||
* Copyright 2021 Miran Grca.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -81,11 +83,9 @@
|
||||
Register 58h & 59h: DRAM Bank 1 Configuration
|
||||
|
||||
Register 60:
|
||||
Bit 5-4: SMRAM Position(Lot's of uncertainty to those bits)
|
||||
0 0 A0000 to E0000
|
||||
1 0 A0000 to ????? (Phoenix uses it to no avail)
|
||||
|
||||
Bit 0: SMRAM Local Access Enable
|
||||
Bit 5: If set and SMRAM is enabled, data cycles go to PCI and code cycles go to DRAM
|
||||
Bit 0: SMRAM Local Access Enable - if set, SMRAM is also enabled outside SMM
|
||||
SMRAM appears to always be enabled in SMM, and always set to A0000-BFFFF.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
@@ -165,7 +165,17 @@ hb4_smram(hb4_t *dev)
|
||||
{
|
||||
smram_disable_all();
|
||||
|
||||
/* Bit 0, if set, enables SMRAM access outside SMM. SMRAM appears to be always enabled
|
||||
in SMM, and is always set to A0000-BFFFF. */
|
||||
smram_enable(dev->smram, 0x000a0000, 0x000a0000, 0x20000, dev->pci_conf[0x60] & 0x01, 1);
|
||||
|
||||
/* Bit 5 seems to set data to go to PCI and code to DRAM. The Samsung SPC7700P-LW uses
|
||||
this. */
|
||||
if (dev->pci_conf[0x60] & 0x20) {
|
||||
if (dev->pci_conf[0x60] & 0x01)
|
||||
mem_set_mem_state_smram_ex(0, 0x000a0000, 0x20000, 0x02);
|
||||
mem_set_mem_state_smram_ex(1, 0x000a0000, 0x20000, 0x02);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user