From: <jasper.lowell@bt.com>
To: <balaton@eik.bme.hu>
Cc: jsnow@redhat.com, mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/ide: Remove status register read side effect
Date: Wed, 4 Mar 2020 03:11:53 +0000 [thread overview]
Message-ID: <06be591e667c6b72c78ae3a33e3092ab323fdb8b.camel@bt.com> (raw)
In-Reply-To: <alpine.BSF.2.22.395.2003011847220.28669@zero.eik.bme.hu>
> cmd646_update_irq() only seems to raise PCI interrupt, should it also
> have
> an option to use INT 14 and 15 in legacy mode similar to what my
> patch
> does for via-ide?
Looking through /qemu/hw/ide/cmd646.c it doesn't look like QEMU has
support for legacy mode. At the very least, it looks like we default to
PCI native mode:
static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp)
...
pci_conf[PCI_CLASS_PROG] = 0x8f;
...
To add support for legacy mode it would require changing
cmd646_update_irq() and maybe cmd646_set_irq() so that interrupts are
conditionally raised on IRQ14 and/or IRQ15 when the ports are in legacy
mode.
Thanks,
Jasper Lowell.
On Sun, 2020-03-01 at 19:02 +0100, BALATON Zoltan wrote:
> Hello,
>
> On Wed, 26 Feb 2020, jasper.lowell@bt.com wrote:
> > According to the CMD646U2 specification:
> > "When an IDE port is in PCI IDE Legacy Mode, the PCI646U2 is
> > compatible
> > with standard ISA IDE. The IDE task file registers are mapped to
> > the
> > standard ISA port addresses, and IDE drive interrupts occur at
> > IRQ14
> > (primary) or IRQ15 (secondary)."
> >
> > In legacy mode, IRQ14 and IRQ15 mirror the state of INTRQ on each
> > of
> > the selected IDE devices. QEMU appears to emulate this correctly.
>
> So CMD646 also seems to have a legacy mode. I've also seen a CMD
> PCI0640B
> spec which is proabably a similar chip which says for interrupt
> handling:
>
> "When DSA1 is pulled low during reset, both IDE ports are in PCI IDE
> Legacy Mode. When DSA1 has no pull-down during reset, each IDE port
> may
> independently be set to PCI IDE Legacy Mode or Native Mode via the
> Programming Interface Byte (configuration register PROGIF, Index 9h).
> When
> an IDE port is in PCI IDE Legacy Mode, the PCI-0640B is compatible
> with
> standard ISA IDE. The IDE task file registers are mapped to the
> standard
> ISA port addresses, and IDE drive interrupts occur at IRQ14 (primary)
> or
> IRQ15 (secondary).
>
> When an IDE port is in PCI IDE Native Mode, the IDE task file
> registers
> may be mapped to non-standard port addresses, and IDE drive
> interrupts
> occur at PCI INTA. Therefore, if both IDE ports are in PCI IDE
> Native
> Mode, drive interrupts from both IDE ports are multiplexed into PCI
> INTA.
> In this case, the interrupt status bits must be polled to determine
> which
> IDE port generated the interrupt, or whether the interrupt was
> generated
> by another PCI device sharing INTA on the bus."
>
> This same explanation also appears in CMD646 doc. So what mode is
> the
> PROG_IF config reg set to and do the interrupts raised match that?
> cmd646_update_irq() only seems to raise PCI interrupt, should it also
> have
> an option to use INT 14 and 15 in legacy mode similar to what my
> patch
> does for via-ide?
>
> Additionally Solaris may also get info from the OF device tree so
> that may
> also have to match the device config.
>
> I'm not sure this helps but I don't have any better idea.
>
> Regards,
> BALATON Zoltan
>
next prev parent reply other threads:[~2020-03-04 3:12 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 6:50 [PATCH] hw/ide: Remove status register read side effect jasper.lowell
2020-02-21 8:08 ` no-reply
2020-02-21 15:43 ` BALATON Zoltan
2020-02-22 2:07 ` jasper.lowell
2020-02-22 11:47 ` BALATON Zoltan
2020-02-22 17:50 ` BALATON Zoltan
2020-02-22 19:26 ` BALATON Zoltan
2020-02-22 19:32 ` Mark Cave-Ayland
2020-02-22 19:45 ` BALATON Zoltan
2020-02-22 20:05 ` BALATON Zoltan
2020-02-23 7:23 ` jasper.lowell
2020-02-23 15:16 ` BALATON Zoltan
2020-02-25 3:55 ` jasper.lowell
2020-02-25 15:08 ` BALATON Zoltan
2020-02-26 5:22 ` jasper.lowell
2020-02-26 11:07 ` BALATON Zoltan
2020-02-27 5:10 ` jasper.lowell
2020-02-27 5:56 ` jasper.lowell
2020-02-27 11:35 ` BALATON Zoltan
2020-03-04 0:55 ` jasper.lowell
2020-02-27 11:38 ` BALATON Zoltan
2020-03-04 0:58 ` jasper.lowell
2020-03-01 18:02 ` BALATON Zoltan
2020-03-04 3:11 ` jasper.lowell [this message]
2020-03-04 8:48 ` BALATON Zoltan
2020-03-04 21:07 ` Mark Cave-Ayland
2020-03-05 0:47 ` jasper.lowell
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=06be591e667c6b72c78ae3a33e3092ab323fdb8b.camel@bt.com \
--to=jasper.lowell@bt.com \
--cc=balaton@eik.bme.hu \
--cc=jsnow@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).