Added the Super PC/Turbo TX, ASUS P/I-486SP3, ASUS PVI-486SP3C, PC Partner MB520N, MSI MS-6168, and Packard bell Bora Pro.

This commit is contained in:
OBattler
2021-04-06 07:17:38 +02:00
parent 03fdcf7a9e
commit 0415351497
19 changed files with 539 additions and 118 deletions

View File

@@ -135,11 +135,20 @@ fdc_handler(fdc37c66x_t *dev)
static void
ide_handler(fdc37c66x_t *dev)
{
ide_sec_disable();
ide_set_base(1, (dev->regs[0x05] & 0x02) ? 0x170 : 0x1f0);
ide_set_side(1, (dev->regs[0x05] & 0x02) ? 0x376 : 0x3f6);
if (dev->regs[0x00] & 0x01)
ide_sec_enable();
/* TODO: Make an ide_disable(channel) and ide_enable(channel) so we can simplify this. */
if (dev->has_ide == 2) {
ide_sec_disable();
ide_set_base(1, (dev->regs[0x05] & 0x02) ? 0x170 : 0x1f0);
ide_set_side(1, (dev->regs[0x05] & 0x02) ? 0x376 : 0x3f6);
if (dev->regs[0x00] & 0x01)
ide_sec_enable();
} else if (dev->has_ide == 1) {
ide_pri_disable();
ide_set_base(0, (dev->regs[0x05] & 0x02) ? 0x170 : 0x1f0);
ide_set_side(0, (dev->regs[0x05] & 0x02) ? 0x376 : 0x3f6);
if (dev->regs[0x00] & 0x01)
ide_pri_enable();
}
}
@@ -242,11 +251,12 @@ fdc37c66x_reset(fdc37c66x_t *dev)
lpt1_init(0x378);
fdc_reset(dev->fdc);
fdc_remove(dev->fdc);
dev->tries = 0;
memset(dev->regs, 0, 16);
dev->regs[0x0] = 0x3a;
dev->regs[0x0] = 0x2a;
dev->regs[0x1] = 0x9f;
dev->regs[0x2] = 0xdc;
dev->regs[0x3] = 0x78;
@@ -280,7 +290,7 @@ fdc37c66x_init(const device_t *info)
dev->uart[1] = device_add_inst(&ns16550_device, 2);
dev->chip_id = info->local & 0xff;
dev->has_ide = !!(info->local & 0x100);
dev->has_ide = (info->local >> 8) & 0xff;
io_sethandler(0x03f0, 0x0002,
fdc37c66x_read, NULL, NULL, fdc37c66x_write, NULL, NULL, dev);
@@ -302,6 +312,15 @@ const device_t fdc37c663_device = {
NULL
};
const device_t fdc37c663_ide_device = {
"SMC FDC37C663 Super I/O (With IDE)",
0,
0x163,
fdc37c66x_init, fdc37c66x_close, NULL,
{ NULL }, NULL, NULL,
NULL
};
const device_t fdc37c665_device = {
"SMC FDC37C665 Super I/O",
0,
@@ -312,9 +331,9 @@ const device_t fdc37c665_device = {
};
const device_t fdc37c665_ide_device = {
"SMC FDC37C665 Super I/O",
"SMC FDC37C665 Super I/O (With IDE)",
0,
0x165,
0x265,
fdc37c66x_init, fdc37c66x_close, NULL,
{ NULL }, NULL, NULL,
NULL

View File

@@ -36,7 +36,7 @@
typedef struct {
uint8_t tries,
uint8_t tries, has_ide,
regs[15];
int cur_reg;
fdc_t *fdc;
@@ -129,6 +129,26 @@ serial_handler(pc87332_t *dev, int uart)
}
static void
ide_handler(pc87332_t *dev)
{
/* TODO: Make an ide_disable(channel) and ide_enable(channel) so we can simplify this. */
if (dev->has_ide == 2) {
ide_sec_disable();
ide_set_base(1, (dev->regs[0x00] & 0x80) ? 0x170 : 0x1f0);
ide_set_side(1, (dev->regs[0x00] & 0x80) ? 0x376 : 0x3f6);
if (dev->regs[0x00] & 0x40)
ide_sec_enable();
} else if (dev->has_ide == 1) {
ide_pri_disable();
ide_set_base(0, (dev->regs[0x00] & 0x80) ? 0x170 : 0x1f0);
ide_set_side(0, (dev->regs[0x00] & 0x80) ? 0x376 : 0x3f6);
if (dev->regs[0x00] & 0x40)
ide_pri_enable();
}
}
static void
pc87332_write(uint16_t port, uint8_t val, void *priv)
{
@@ -177,6 +197,8 @@ pc87332_write(uint16_t port, uint8_t val, void *priv)
if ((val & 8) && !(dev->regs[2] & 1))
fdc_set_base(dev->fdc, (val & 0x20) ? 0x370 : 0x3f0);
}
if (dev->has_ide && (valxor & 0xc0))
ide_handler(dev);
break;
case 1:
if (valxor & 3) {
@@ -251,7 +273,9 @@ pc87332_reset(pc87332_t *dev)
{
memset(dev->regs, 0, 15);
dev->regs[0x00] = 0x0F;
dev->regs[0x00] = 0x07;
if (dev->has_ide == 2)
dev->regs[0x00] = 0x87;
dev->regs[0x01] = 0x10;
dev->regs[0x03] = 0x01;
dev->regs[0x05] = 0x0D;
@@ -268,6 +292,10 @@ pc87332_reset(pc87332_t *dev)
serial_handler(dev, 0);
serial_handler(dev, 1);
fdc_reset(dev->fdc);
fdc_remove(dev->fdc);
if (dev->has_ide)
ide_handler(dev);
}
@@ -291,9 +319,10 @@ pc87332_init(const device_t *info)
dev->uart[0] = device_add_inst(&ns16550_device, 1);
dev->uart[1] = device_add_inst(&ns16550_device, 2);
dev->has_ide = (info->local >> 8) & 0xff;
pc87332_reset(dev);
if (info->local == 1) {
if ((info->local & 0xff) == (0x01)) {
io_sethandler(0x398, 0x0002,
pc87332_read, NULL, NULL, pc87332_write, NULL, NULL, dev);
} else {
@@ -308,17 +337,27 @@ pc87332_init(const device_t *info)
const device_t pc87332_device = {
"National Semiconductor PC87332 Super I/O",
0,
0,
0x00,
pc87332_init, pc87332_close, NULL,
{ NULL }, NULL, NULL,
NULL
};
const device_t pc87332_ps1_device = {
"National Semiconductor PC87332 Super I/O (IBM PS/1 Model 2133 EMEA 451)",
const device_t pc87332_398_device = {
"National Semiconductor PC87332 Super I/O (Port 398h)",
0,
1,
0x01,
pc87332_init, pc87332_close, NULL,
{ NULL }, NULL, NULL,
NULL
};
const device_t pc87332_398_ide_device = {
"National Semiconductor PC87332 Super I/O (Port 398h) (With IDE)",
0,
0x101,
pc87332_init, pc87332_close, NULL,
{ NULL }, NULL, NULL,
NULL