All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <1921635@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Bug 1921635] Re: ESP SCSI adapter not working with DOS ASPI drivers
Date: Mon, 05 Apr 2021 10:23:40 -0000	[thread overview]
Message-ID: <161761822079.18133.9922501482394382678.malone@soybean.canonical.com> (raw)
In-Reply-To: 161695258717.25953.1383463253951082358.malonedeb@wampee.canonical.com

I've had a look at your am53c974 boot floppy with PcSCSI drivers and I'm
fairly sure that disabling INT13 support isn't helping here. With your
custom SeaBIOS I see a hang issuing the first SCSI command: without your
custom SeaBIOS I can see that the default SeaBIOS issues several
successful commands to the SCSI bus before booting from the floppy.

Dropping the -bios option and booting your floppy here I see the
following sequence with -trace 'scsi*' -trace 'esp*' after the BIOS has
initialised:


esp_mem_writeb reg[3]: 0x42 -> 0x02
esp_mem_writeb_cmd_reset Chip reset (0x02)
esp_mem_writeb reg[3]: 0x02 -> 0x80
esp_mem_writeb_cmd_nop NOP (0x80)
esp_mem_writeb reg[11]: 0x00 -> 0x40
esp_mem_readb reg[14]: 0x12
esp_pci_sbac_read sbac: 0x00000000
esp_pci_sbac_write sbac: 0x00000000 -> 0x02000000
esp_mem_writeb reg[3]: 0x80 -> 0x02
esp_mem_writeb_cmd_reset Chip reset (0x02)
esp_mem_writeb reg[3]: 0x02 -> 0x80
esp_mem_writeb_cmd_nop NOP (0x80)
esp_mem_writeb reg[8]: 0x00 -> 0x17
esp_mem_writeb reg[12]: 0x00 -> 0x88
esp_mem_writeb reg[13]: 0x00 -> 0x40
esp_mem_writeb reg[11]: 0x00 -> 0x40
esp_mem_writeb reg[9]: 0x00 -> 0x07
esp_mem_writeb reg[5]: 0x00 -> 0x8d
esp_mem_writeb reg[5]: 0x8d -> 0x02
esp_mem_readb reg[8]: 0x17
esp_mem_writeb reg[8]: 0x17 -> 0x07
esp_mem_writeb reg[4]: 0x00 -> 0x00
esp_mem_writeb reg[3]: 0x80 -> 0x01
esp_mem_writeb_cmd_flush Flush FIFO (0x01)
esp_mem_writeb reg[2]: 0x00 -> 0x00
esp_mem_writeb reg[2]: 0x00 -> 0x00
esp_mem_writeb reg[2]: 0x00 -> 0x00
esp_mem_writeb reg[2]: 0x00 -> 0x00
esp_mem_writeb reg[2]: 0x00 -> 0x00
esp_mem_writeb reg[2]: 0x00 -> 0x00
esp_mem_writeb reg[3]: 0x01 -> 0x41
esp_mem_writeb_cmd_sel Select without ATN (0x41)
esp_get_cmd len 6 target 0
esp_do_busid_cmd busid 0x0
scsi_req_parsed target 0 lun 0 tag 0 command 0 dir 0 length 0
scsi_req_parsed_lba target 0 lun 0 tag 0 command 0 lba 0
scsi_req_alloc target 0 lun 0 tag 0
scsi_disk_new_request Command: lun=0 tag=0x0 data= 0x00 0x00 0x00 0x00 0x00 0x00
scsi_test_unit_ready target 0 lun 0 tag 0
scsi_req_dequeue target 0 lun 0 tag 0
esp_command_complete SCSI Command complete
esp_raise_irq Raise IRQ
esp_lower_drq Lower DREQ

******
esp_pci_dma_read reg[5]: 0x00000018
esp_mem_readb reg[4]: 0x93
esp_mem_readb reg[6]: 0x00
esp_lower_irq Lower IRQ
esp_mem_readb reg[5]: 0x18
esp_mem_readb reg[8]: 0x07
esp_mem_writeb reg[8]: 0x07 -> 0x47
esp_mem_writeb reg[3]: 0x41 -> 0x03
esp_mem_writeb_cmd_bus_reset Bus reset (0x03)
******


The loading of the "test unit ready" command and execution look fine to me: QEMU's SCSI layer is executing the command (indicating success) and raises the ESP IRQ. However at this point in the section marked by "******" the ASPI driver seems not be happy with the RSTAT/RINTR register contents or the 0x18 read back from the PCI DMA registers, issues a bus reset and stops.

What is interesting here is that the "Select without ATN (0x41)" command
issued is a non-DMA command so I wouldn't expect it to affect the ESP
PCI DMA register state, but I suspect you'll need to have a look what
the driver is doing using a disassembler/gdbstub and the am53c974
datasheet to try and understand what is happening here.

Finally it may be worth checking the IRQ routing with -trace 'pci*' to
see if SeaBIOS updates the PCI "Interrupt Pin" register indicating where
it thinks the IRQ should be routed, and stepping through the
esp_raise_irq() in QEMU for the final test unit ready command to ensure
that all of QEMU, SeaBIOS and AMSIDA.SYS all agree on what IRQ is being
used.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1921635

Title:
  ESP SCSI adapter not working with DOS ASPI drivers

Status in QEMU:
  New

Bug description:
  I have been trying to install the DOS ASPI drivers for the ESP scsi
  card. Both in am53c974 and dc390 modes. Neither works but they don't
  work in different ways.

  The following things appear to be problematic:

  * The am53c974 should work with the PcSCSI drivers (AMSIDA.SYS) but the ASPI driver never manages to get past initializing the card. The VM never continues.
  * The dc390 ASPI driver fares a little better. The ASPI driver loads and is semi-functional but the drivers for the peripherals don't work.
   - ASPI.SYS (creative name) loads
   - TRMDISK.SYS fails to load when a cd-drive is attached and will crashs scanning the scsi-id where the cd drive is attached
   - TRMDISK.SYS loads without a CD drive attached but fails to read any scsi-hd devices attached. The TFDISK.EXE formatter crashes.
   - TRMCD.SYS loads, but can not detect any CD drives.

  The various permutations:
  am53c974 hang on ASPI driver load: (CD only attached)

  ~/src/qemu/build/qemu-system-i386 -m 64 -device am53c974,id=scsi0
  -device scsi-cd,drive=drive0,bus=scsi0.0,channel=0,scsi-id=0,lun=0
  -drive file=../Windows\ 98\ Second\ Edition.iso,if=none,id=drive0 -vga
  cirrus -fda am53c974_aspi.img -bios /home/hp/src/seabios/out/bios.bin
  -boot a  -trace 'scsi*' -trace 'esp*' -D log

  dc390 crash because of CDROM attachment and loading TRMDISK.SYS (Only CD attached)
  ~/src/qemu/build/qemu-system-i386 -m 64 -device dc390,id=scsi0,rombar=0 -device scsi-cd,drive=drive0,bus=scsi0.0,channel=0,scsi-id=0,lun=0 -drive file=../Windows\ 98\ Second\ Edition.iso,if=none,id=drive0 -vga cirrus -fda dc390_all.img  -bios /home/hp/src/seabios/out/bios.bin -boot a  -trace 'scsi*' -trace 'esp*' -D log

  dc390 successful boot, but TRMDISK.SYS not working (TFDISK.EXE will crash)
  ~/src/qemu/build/qemu-system-i386 -m 64 -device dc390,id=scsi0 -device scsi-hd,drive=drive0,bus=scsi0.0,channel=0,scsi-id=0,lun=0,logical_block_size=512 -drive file=small.qcow2,if=none,id=drive0 -vga cirrus -fda dc390_all.img -bios /home/hp/src/seabios/out/bios.bin -boot a  -trace 'scsi*' -trace 'esp*' -D log

  dc390 successful boot, TRMDISK.SYS not loaded, only TRMCD.SYS. CDROM not detected
  ~/src/qemu/build/qemu-system-i386 -m 64 -device dc390,id=scsi0,rombar=0 -device scsi-cd,drive=drive0,bus=scsi0.0,channel=0,scsi-id=0,lun=0 -drive file=../Windows\ 98\ Second\ Edition.iso,if=none,id=drive0 -vga cirrus -fda dc390_cd.img  -bios /home/hp/src/seabios/out/bios.bin -boot a  -trace 'scsi*' -trace 'esp*' -D log

  All of these tests were done on
  7b9a3c9f94bcac23c534bc9f42a9e914b433b299 as well as the 'esp-next'
  branch found here: https://github.com/mcayland/qemu/tree/esp-next

  The bios file is a seabios master with all int13 support disabled.
  With it enabled even less works but I figured this would be a seabios
  bug and not a qemu one.

  The actual iso and qcow2 files used don't appear the matter. the
  'small.qcow2' is an empty drive of 100MB. I have also tried other ISOs
  in the CD drives, or even not put any cd in the drives with the same
  results.

  I will attach all of the above images.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1921635/+subscriptions


  parent reply	other threads:[~2021-04-05 10:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 17:29 [Bug 1921635] [NEW] ESP SCSI adapter not working with DOS ASPI drivers Hein-PietervanBraam
2021-03-28 17:30 ` [Bug 1921635] " Hein-PietervanBraam
2021-03-28 17:30 ` Hein-PietervanBraam
2021-03-28 17:31 ` Hein-PietervanBraam
2021-03-28 17:31 ` Hein-PietervanBraam
2021-03-28 17:38 ` Hein-PietervanBraam
2021-04-05 10:23 ` Mark Cave-Ayland [this message]
2021-04-06  2:54 ` Hein-PietervanBraam
2021-05-14 19:03 ` Thomas Huth
2021-07-14  4:17 ` Launchpad Bug Tracker
2021-08-27 10:31 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161761822079.18133.9922501482394382678.malone@soybean.canonical.com \
    --to=1921635@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.