From: David Gibson <david@gibson.dropbear.id.au>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 5/6] ppc/pegasos2: Add constants for PCI config addresses
Date: Fri, 15 Oct 2021 14:19:11 +1100 [thread overview]
Message-ID: <YWjzL1bM23tNnP9y@yekko> (raw)
In-Reply-To: <9bd8e84d02d91693b71082a1fadeb86e6bce3025.1634241019.git.balaton@eik.bme.hu>
[-- Attachment #1: Type: text/plain, Size: 1996 bytes --]
On Thu, Oct 14, 2021 at 09:50:19PM +0200, BALATON Zoltan wrote:
> Define a constant for PCI config addresses to make it clearer what
> these numbers are.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Applied, thanks.
> ---
> hw/ppc/pegasos2.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
> index a861bf16b8..39e96d323f 100644
> --- a/hw/ppc/pegasos2.c
> +++ b/hw/ppc/pegasos2.c
> @@ -54,11 +54,13 @@
>
> #define BUS_FREQ_HZ 133333333
>
> +#define PCI0_CFG_ADDR 0xcf8
> #define PCI0_MEM_BASE 0xc0000000
> #define PCI0_MEM_SIZE 0x20000000
> #define PCI0_IO_BASE 0xf8000000
> #define PCI0_IO_SIZE 0x10000
>
> +#define PCI1_CFG_ADDR 0xc78
> #define PCI1_MEM_BASE 0x80000000
> #define PCI1_MEM_SIZE 0x40000000
> #define PCI1_IO_BASE 0xfe000000
> @@ -226,7 +228,7 @@ static void pegasos2_mv_reg_write(Pegasos2MachineState *pm, uint32_t addr,
> static uint32_t pegasos2_pci_config_read(Pegasos2MachineState *pm, int bus,
> uint32_t addr, uint32_t len)
> {
> - hwaddr pcicfg = bus ? 0xc78 : 0xcf8;
> + hwaddr pcicfg = bus ? PCI1_CFG_ADDR : PCI0_CFG_ADDR;
> uint64_t val = 0xffffffffULL;
>
> if (len <= 4) {
> @@ -239,7 +241,7 @@ static uint32_t pegasos2_pci_config_read(Pegasos2MachineState *pm, int bus,
> static void pegasos2_pci_config_write(Pegasos2MachineState *pm, int bus,
> uint32_t addr, uint32_t len, uint32_t val)
> {
> - hwaddr pcicfg = bus ? 0xc78 : 0xcf8;
> + hwaddr pcicfg = bus ? PCI1_CFG_ADDR : PCI0_CFG_ADDR;
>
> pegasos2_mv_reg_write(pm, pcicfg, 4, addr | BIT(31));
> pegasos2_mv_reg_write(pm, pcicfg + 4, len, val);
--
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:[~2021-10-15 7:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-14 19:50 [PATCH 0/6] Misc pegasos2 patches BALATON Zoltan
2021-10-14 19:50 ` [PATCH 1/6] ppc/pegasos2: Restrict memory to 2 gigabytes BALATON Zoltan
2021-10-15 3:15 ` David Gibson
2021-10-14 19:50 ` [PATCH 5/6] ppc/pegasos2: Add constants for PCI config addresses BALATON Zoltan
2021-10-15 3:19 ` David Gibson [this message]
2021-10-14 19:50 ` [PATCH 4/6] ppc/pegasos2: Access MV64361 registers via their memory region BALATON Zoltan
2021-10-15 3:18 ` David Gibson
2021-10-14 19:50 ` [PATCH 2/6] ppc/pegasos2: Warn when using VOF but no kernel is specified BALATON Zoltan
2021-10-15 3:15 ` David Gibson
2021-10-14 19:50 ` [PATCH 3/6] ppc/pegasos2: Implement get-time-of-day RTAS function with VOF BALATON Zoltan
2021-10-15 3:17 ` David Gibson
2021-10-15 9:26 ` BALATON Zoltan
2021-10-15 21:51 ` BALATON Zoltan
2021-10-14 19:50 ` [PATCH 6/6] ppc/pegasos2: Implement power-off " BALATON Zoltan
2021-10-15 3:19 ` David Gibson
2021-10-15 3:20 ` [PATCH 0/6] Misc pegasos2 patches David Gibson
2021-10-15 9:28 ` 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=YWjzL1bM23tNnP9y@yekko \
--to=david@gibson.dropbear.id.au \
--cc=balaton@eik.bme.hu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).