[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 7/8] q800: wire up remaining IRQs in classic mode
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v2 7/8] q800: wire up remaining IRQs in classic mode |
Date: |
Wed, 20 Oct 2021 14:41:30 +0100 |
Explicitly wire up the remaining IRQs in classic mode to enable the use of
g_assert_not_reached() in the default case to detect any unexpected IRQs.
Add a comment explaining the IRQ routing differences in A/UX mode based
upon the comments in NetBSD (also noting that at least A/UX 3.0.1 still
uses classic mode).
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
hw/m68k/q800.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 7a8de089f4..83fde39298 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -111,6 +111,37 @@ struct GLUEState {
#define GLUE_IRQ_NUBUS_9 0
+/*
+ * The GLUE logic on the Quadra 800 supports 2 different IRQ routing modes
+ * controlled from the VIA1 auxmode GPIO (port B bit 6) which are documented
+ * in NetBSD as follows:
+ *
+ * A/UX mode (Linux, NetBSD, auxmode GPIO low)
+ *
+ * Level 0: Spurious: ignored
+ * Level 1: Software
+ * Level 2: VIA2 (except ethernet, sound)
+ * Level 3: Ethernet
+ * Level 4: Serial (SCC)
+ * Level 5: Sound
+ * Level 6: VIA1
+ * Level 7: NMIs: parity errors, RESET button, YANCC error
+ *
+ * Classic mode (default: used by MacOS, A/UX 3.0.1, auxmode GPIO high)
+ *
+ * Level 0: Spurious: ignored
+ * Level 1: VIA1 (clock, ADB)
+ * Level 2: VIA2 (NuBus, SCSI)
+ * Level 3:
+ * Level 4: Serial (SCC)
+ * Level 5:
+ * Level 6:
+ * Level 7: Non-maskable: parity errors, RESET button
+ *
+ * Note that despite references to A/UX mode in Linux and NetBSD, at least
+ * A/UX 3.0.1 still uses Classic mode.
+ */
+
static void GLUE_set_irq(void *opaque, int irq, int level)
{
GLUEState *s = opaque;
@@ -119,10 +150,25 @@ static void GLUE_set_irq(void *opaque, int irq, int level)
if (s->auxmode) {
/* Classic mode */
switch (irq) {
+ case GLUE_IRQ_IN_VIA1:
+ irq = 0;
+ break;
+
+ case GLUE_IRQ_IN_VIA2:
+ irq = 1;
+ break;
+
case GLUE_IRQ_IN_SONIC:
/* Route to VIA2 instead */
qemu_set_irq(s->irqs[GLUE_IRQ_NUBUS_9], level);
return;
+
+ case GLUE_IRQ_IN_ESCC:
+ irq = 3;
+ break;
+
+ default:
+ g_assert_not_reached();
}
} else {
/* A/UX mode */
@@ -142,6 +188,9 @@ static void GLUE_set_irq(void *opaque, int irq, int level)
case GLUE_IRQ_IN_ESCC:
irq = 3;
break;
+
+ default:
+ g_assert_not_reached();
}
}
--
2.20.1
- [PATCH v2 0/8] q800: GLUE updates for A/UX mode, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 1/8] mac_via: update comment for VIA1B_vMystery bit, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 2/8] q800: move VIA1 IRQ from level 1 to level 6, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 3/8] q800: use GLUE IRQ numbers instead of IRQ level for GLUE IRQs, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 5/8] q800: wire up auxmode GPIO to GLUE, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 4/8] mac_via: add GPIO for A/UX mode, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 6/8] q800: route SONIC on-board Ethernet IRQ via nubus IRQ 9 in classic mode, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 8/8] q800: add NMI handler, Mark Cave-Ayland, 2021/10/20
- [PATCH v2 7/8] q800: wire up remaining IRQs in classic mode,
Mark Cave-Ayland <=