From: David Gibson <david@gibson.dropbear.id.au>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
Thomas Huth <thuth@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] ppc440_pcix: Add dummy implementation of BRDGOPT registers
Date: Thu, 8 Mar 2018 17:17:07 +1100 [thread overview]
Message-ID: <20180308061707.GP3083@umbus.fritz.box> (raw)
In-Reply-To: <20180307205427.3A2877456C6@zero.eik.bme.hu>
[-- Attachment #1: Type: text/plain, Size: 2761 bytes --]
On Wed, Mar 07, 2018 at 09:43:59PM +0100, BALATON Zoltan wrote:
> I don't know what should be the correct implementation for these so
> these are just stored and returned as is without doing anything for
> now only to silence warnings when u-boot accesses these registers.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
I'm a bit dubious about putting in a dummy register implementation.
Specifically, I think the case needs to be made that the dummy
implementation is preferable to just putting up with the test errors.
At the very least there should be a comment in the code indicating
that it's just a dummy stub implementation.
> ---
> hw/ppc/ppc440_pcix.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c
> index ab2626a..3f177d3 100644
> --- a/hw/ppc/ppc440_pcix.c
> +++ b/hw/ppc/ppc440_pcix.c
> @@ -55,6 +55,8 @@ typedef struct PPC440PCIXState {
> PCIDevice *dev;
> struct PLBOutMap pom[PPC440_PCIX_NR_POMS];
> struct PLBInMap pim[PPC440_PCIX_NR_PIMS];
> + uint32_t brdgopt1;
> + uint32_t brdgopt2;
> uint32_t sts;
> qemu_irq irq[PCI_NUM_PINS];
> AddressSpace bm_as;
> @@ -95,6 +97,8 @@ typedef struct PPC440PCIXState {
> #define PCIX0_PIM0SAH 0xf8
> #define PCIX0_PIM2SAH 0xfc
>
> +#define PCIX0_BRDGOPT1 0x40
> +#define PCIX0_BRDGOPT2 0x44
> #define PCIX0_STS 0xe0
>
> #define PCI_ALL_SIZE (PPC440_REG_BASE + PPC440_REG_SIZE)
> @@ -270,6 +274,12 @@ static void ppc440_pcix_reg_write4(void *opaque, hwaddr addr,
> ppc440_pcix_update_pim(s, 2);
> break;
>
> + case PCIX0_BRDGOPT1:
> + s->brdgopt1 = val;
> + break;
> + case PCIX0_BRDGOPT2:
> + s->brdgopt2 = val;
> + break;
> case PCIX0_STS:
> s->sts = val;
> break;
> @@ -365,6 +375,12 @@ static uint64_t ppc440_pcix_reg_read4(void *opaque, hwaddr addr,
> val = s->pim[2].la >> 32;
> break;
>
> + case PCIX0_BRDGOPT1:
> + val = s->brdgopt1;
> + break;
> + case PCIX0_BRDGOPT2:
> + val = s->brdgopt2;
> + break;
> case PCIX0_STS:
> val = s->sts;
> break;
> @@ -408,6 +424,8 @@ static void ppc440_pcix_reset(DeviceState *dev)
> for (i = 0; i < PPC440_PCIX_NR_PIMS; i++) {
> s->pim[i].sa = 0xffffffff00000000ULL;
> }
> + s->brdgopt1 = 0;
> + s->brdgopt2 = 0;
> s->sts = 0;
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-03-08 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 20:43 [Qemu-devel] [PATCH] ppc440_pcix: Add dummy implementation of BRDGOPT registers BALATON Zoltan
2018-03-08 4:37 ` Thomas Huth
2018-03-08 6:17 ` David Gibson [this message]
2018-03-08 10:26 ` BALATON Zoltan
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=20180308061707.GP3083@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=balaton@eik.bme.hu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/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).