qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Artyom Tarasenko <atar4qemu@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] apb: add implementation of UltraSPARC IIi PCI TAS register
Date: Fri, 05 Sep 2014 14:42:16 +0100	[thread overview]
Message-ID: <5409BDB8.2050607@ilande.co.uk> (raw)
In-Reply-To: <CACXAS8CsOn_98LN+6R3O3nwz-fCtQS4vNXsnfSZw7sWNvqk3jg@mail.gmail.com>

On 28/08/14 12:33, Artyom Tarasenko wrote:

> On Mon, Aug 25, 2014 at 7:58 PM, Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
>> FreeBSD SPARC64 checks the value of this register on boot in order to calculate
>> the DVMA base address.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> ---
>>   hw/pci-host/apb.c |   11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
>> index 60bd81e..3b7fb13 100644
>> --- a/hw/pci-host/apb.c
>> +++ b/hw/pci-host/apb.c
>> @@ -68,6 +68,11 @@ do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0)
>>   #define PBM_PCI_IMR_MASK    0x7fffffff
>>   #define PBM_PCI_IMR_ENABLED 0x80000000
>>
>> +/* PCI Target Address Space Register (see UltraSPARC IIi User's Manual
>> +   section 19.3.0.4) */
>> +#define PBM_PCI_TARGET_AS              0x2028
>> +#define PBM_PCI_TARGET_AS_CD_ENABLE    0x40
>> +
>>   #define POR          (1U << 31)
>>   #define SOFT_POR     (1U << 30)
>>   #define SOFT_XIR     (1U << 29)
>> @@ -731,6 +736,12 @@ static void pci_pbm_reset(DeviceState *d)
>>       s->irq_request = NO_IRQ_REQUEST;
>>       s->pci_irq_in = 0ULL;
>>
>> +    /* Set target address space register to base 0xc0000000, size 0x20000000
>> +       to match OpenBIOS virtual-dma properties */
>> +    s->pci_control[((PBM_PCI_TARGET_AS & 0x3f) >> 2)] = 0x0;
>> +    s->pci_control[((PBM_PCI_TARGET_AS & 0x3f) >> 2) + 1] =
>> +            PBM_PCI_TARGET_AS_CD_ENABLE;
>> +
>
> [nit-picking]
> Shouldn't it be other way around: set the register to POR state (0)
> here and set in OpenBIOS the desired values?
> Currently OpenBIOS is the only firmware, so it doesn't matter, but who knows...
> [/nit-picking]

Yes you could be right, at least it would make more sense to have 
OpenBIOS control the register so that we can guarantee that the value 
programmed matches the virtual-dma device tree properties. I'll go ahead 
and submit a pull request with just the PCI error register patch for the 
moment.


ATB,

Mark.

  reply	other threads:[~2014-09-05 13:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-25 17:58 [Qemu-devel] [PATCH 0/2] apb: more PCI fixes Mark Cave-Ayland
2014-08-25 17:58 ` [Qemu-devel] [PATCH 1/2] apb: add implementation of UltraSPARC IIi PCI TAS register Mark Cave-Ayland
2014-08-28 11:33   ` Artyom Tarasenko
2014-09-05 13:42     ` Mark Cave-Ayland [this message]
2014-08-25 17:58 ` [Qemu-devel] [PATCH 2/2] apb: implement PCI bus error interrupt map registers Mark Cave-Ayland
2014-08-28 11:15   ` Artyom Tarasenko

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=5409BDB8.2050607@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=atar4qemu@gmail.com \
    --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).