From: deller@kernel.org
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
Helge Deller <deller@gmx.de>, Bruno Haible <bruno@clisp.org>
Subject: [PATCH v3 3/9] hw/pci-host/astro: Add missing astro & elroy registers for NetBSD
Date: Fri, 12 Jan 2024 11:29:21 +0100 [thread overview]
Message-ID: <20240112102927.35406-4-deller@kernel.org> (raw)
In-Reply-To: <20240112102927.35406-1-deller@kernel.org>
From: Helge Deller <deller@gmx.de>
NetBSD accesses some astro and elroy registers which aren't accessed
by Linux yet. Add emulation for those registers to allow NetBSD to
boot further.
Please note that this patch is not sufficient to completely boot up
NetBSD on the 64-bit C3700 machine yet.
Signed-off-by: Helge Deller <deller@gmx.de>
Tested-by: Bruno Haible <bruno@clisp.org>
---
hw/pci-host/astro.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c
index 7d68ccee7e..cb2c8a828d 100644
--- a/hw/pci-host/astro.c
+++ b/hw/pci-host/astro.c
@@ -166,6 +166,8 @@ static MemTxResult elroy_chip_write_with_attrs(void *opaque, hwaddr addr,
trace_elroy_write(addr, size, val);
switch ((addr >> 3) << 3) {
+ case 0x000: /* PCI_ID & PCI_COMMAND_STATUS_REG */
+ break;
case 0x080:
put_val_in_int64(&s->arb_mask, addr, size, val);
break;
@@ -175,6 +177,9 @@ static MemTxResult elroy_chip_write_with_attrs(void *opaque, hwaddr addr,
case 0x200 ... 0x250 - 1: /* LMMIO, GMMIO, WLMMIO, WGMMIO, ... */
put_val_in_arrary(s->mmio_base, 0x200, addr, size, val);
break;
+ case 0x300: /* ibase */
+ case 0x308: /* imask */
+ break;
case 0x0680:
put_val_in_int64(&s->error_config, addr, size, val);
break;
@@ -538,6 +543,9 @@ static MemTxResult astro_chip_read_with_attrs(void *opaque, hwaddr addr,
case 0x0030: /* HP-UX 10.20 and 11.11 reads it. No idea. */
val = -1;
break;
+ case 0x0078: /* NetBSD reads 0x78 ? */
+ val = -1;
+ break;
case 0x0300 ... 0x03d8: /* LMMIO_DIRECT0_BASE... */
index = (addr - 0x300) / 8;
val = s->ioc_ranges[index];
@@ -624,31 +632,43 @@ static MemTxResult astro_chip_write_with_attrs(void *opaque, hwaddr addr,
case 0x10220:
case 0x10230: /* HP-UX 11.11 reads it. No idea. */
break;
- case 0x22108: /* IOC STATUS_CONTROL */
- put_val_in_int64(&s->ioc_status_ctrl, addr, size, val);
- break;
case 0x20200 ... 0x20240 - 1: /* IOC Rope0_Control ... */
put_val_in_arrary(s->ioc_rope_control, 0x20200, addr, size, val);
break;
case 0x20040: /* IOC Rope config */
+ case 0x22040:
put_val_in_int64(&s->ioc_rope_config, addr, size, val);
break;
case 0x20300:
+ case 0x22300:
put_val_in_int64(&s->tlb_ibase, addr, size, val);
break;
case 0x20308:
+ case 0x22308:
put_val_in_int64(&s->tlb_imask, addr, size, val);
break;
case 0x20310:
+ case 0x22310:
put_val_in_int64(&s->tlb_pcom, addr, size, val);
/* TODO: flush iommu */
break;
case 0x20318:
+ case 0x22318:
put_val_in_int64(&s->tlb_tcnfg, addr, size, val);
break;
case 0x20320:
+ case 0x22320:
put_val_in_int64(&s->tlb_pdir_base, addr, size, val);
break;
+ case 0x22000: /* func_id */
+ break;
+ case 0x22008: /* func_class */
+ break;
+ case 0x22050: /* rope_debug */
+ break;
+ case 0x22108: /* IOC STATUS_CONTROL */
+ put_val_in_int64(&s->ioc_status_ctrl, addr, size, val);
+ break;
/*
* empty placeholders for non-existent elroys, e.g.
* func_class, pci config & data
--
2.43.0
next prev parent reply other threads:[~2024-01-12 10:29 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 10:29 [PATCH v3 0/9] target/hppa qemu v8.2 regression fixes deller
2024-01-12 10:29 ` [PATCH v3 1/9] hw/hppa/machine: Allow up to 3840 MB total memory deller
2024-01-12 10:29 ` [PATCH v3 2/9] hw/hppa/machine: Disable default devices with --nodefaults option deller
2024-01-12 20:39 ` Richard Henderson
2024-01-26 12:02 ` David Woodhouse
2024-01-26 14:49 ` Helge Deller
2024-01-26 14:51 ` David Woodhouse
2024-01-12 10:29 ` deller [this message]
2024-01-12 10:29 ` [PATCH v3 4/9] target/hppa: Fix PDC address translation on PA2.0 with PSW.W=0 deller
2024-01-12 21:54 ` Richard Henderson
2024-01-12 22:23 ` Helge Deller
2024-01-12 22:24 ` Richard Henderson
2024-01-12 10:29 ` [PATCH v3 5/9] hw/hppa: Move software power button address back into PDC deller
2024-01-12 22:07 ` Richard Henderson
2024-01-12 22:44 ` Helge Deller
2024-01-12 23:11 ` Richard Henderson
2024-01-12 23:15 ` Helge Deller
2024-01-12 23:27 ` Richard Henderson
2024-01-12 10:29 ` [PATCH v3 6/9] target/hppa: Avoid accessing %gr0 when raising exception deller
2024-01-12 10:29 ` [PATCH v3 7/9] target/hppa: Export function hppa_set_ior_and_isr() deller
2024-01-12 22:08 ` Richard Henderson
2024-01-12 10:29 ` [PATCH v3 8/9] target/hppa: Fix IOR and ISR on unaligned access trap deller
2024-01-12 22:08 ` Richard Henderson
2024-01-12 10:29 ` [PATCH v3 9/9] target/hppa: Fix IOR and ISR on error in probe deller
2024-01-12 22:08 ` Richard Henderson
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=20240112102927.35406-4-deller@kernel.org \
--to=deller@kernel.org \
--cc=bruno@clisp.org \
--cc=deller@gmx.de \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).