aboutsummaryrefslogtreecommitdiff
path: root/src/disk.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-12-05 11:25:09 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-12-05 11:25:09 -0500
commit4ccb23125e8653e9dc1c42f2f2ae57594ef072c3 (patch)
tree2d42689725468749953e7b0a5767b84b01b094b4 /src/disk.c
parent6080fe0687436991314a09fe05dbe4d69212cd26 (diff)
downloadseabios-hppa-4ccb23125e8653e9dc1c42f2f2ae57594ef072c3.zip
seabios-hppa-4ccb23125e8653e9dc1c42f2f2ae57594ef072c3.tar.gz
seabios-hppa-4ccb23125e8653e9dc1c42f2f2ae57594ef072c3.tar.bz2
Support ISA ATA devices for qemu's "-M isapc" mode.
Add probing for ISA ATA devices when no pci devices found. Also, add defines for common ATA ports. Also, make sure irq and pci_bdf are defined for both pci ata controllers.
Diffstat (limited to 'src/disk.c')
-rw-r--r--src/disk.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/disk.c b/src/disk.c
index 30b6e7b..ef4866f 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -602,15 +602,25 @@ disk_1348(struct bregs *regs, struct drive_s *drive_g)
SET_INT13DPT(regs, reserved1, 0);
SET_INT13DPT(regs, reserved2, 0);
- SET_INT13DPT(regs, host_bus[0], 'P');
- SET_INT13DPT(regs, host_bus[1], 'C');
- SET_INT13DPT(regs, host_bus[2], 'I');
- SET_INT13DPT(regs, host_bus[3], 0);
-
- u32 bdf = GET_GLOBAL(ATA_channels[channel].pci_bdf);
- u32 path = (pci_bdf_to_bus(bdf) | (pci_bdf_to_dev(bdf) << 8)
- | (pci_bdf_to_fn(bdf) << 16));
- SET_INT13DPT(regs, iface_path, path);
+ int bdf = GET_GLOBAL(ATA_channels[channel].pci_bdf);
+ if (bdf != -1) {
+ SET_INT13DPT(regs, host_bus[0], 'P');
+ SET_INT13DPT(regs, host_bus[1], 'C');
+ SET_INT13DPT(regs, host_bus[2], 'I');
+ SET_INT13DPT(regs, host_bus[3], 0);
+
+ u32 path = (pci_bdf_to_bus(bdf) | (pci_bdf_to_dev(bdf) << 8)
+ | (pci_bdf_to_fn(bdf) << 16));
+ SET_INT13DPT(regs, iface_path, path);
+ } else {
+ // ISA
+ SET_INT13DPT(regs, host_bus[0], 'I');
+ SET_INT13DPT(regs, host_bus[1], 'S');
+ SET_INT13DPT(regs, host_bus[2], 'A');
+ SET_INT13DPT(regs, host_bus[3], 0);
+
+ SET_INT13DPT(regs, iface_path, iobase1);
+ }
SET_INT13DPT(regs, iface_type[0], 'A');
SET_INT13DPT(regs, iface_type[1], 'T');