All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: richard.henderson@linaro.org, deller@gmx.de, qemu-devel@nongnu.org
Subject: [PULL 28/53] lasi: replace lasi_get_irq() with defined constants
Date: Sun,  8 May 2022 20:56:25 +0100	[thread overview]
Message-ID: <20220508195650.28590-29-mark.cave-ayland@ilande.co.uk> (raw)
In-Reply-To: <20220508195650.28590-1-mark.cave-ayland@ilande.co.uk>

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-29-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/hppa/lasi.c | 31 ++++---------------------------
 hw/hppa/lasi.h |  9 +++++++++
 2 files changed, 13 insertions(+), 27 deletions(-)

diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c
index c1dfd5310f..ec079601a1 100644
--- a/hw/hppa/lasi.c
+++ b/hw/hppa/lasi.c
@@ -231,29 +231,6 @@ static void lasi_set_irq(void *opaque, int irq, int level)
     }
 }
 
-static int lasi_get_irq(unsigned long hpa)
-{
-    switch (hpa) {
-    case LASI_HPA:
-        return 14;
-    case LASI_UART_HPA:
-        return 5;
-    case LASI_LPT_HPA:
-        return 7;
-    case LASI_LAN_HPA:
-        return 8;
-    case LASI_SCSI_HPA:
-        return 9;
-    case LASI_AUDIO_HPA:
-        return 13;
-    case LASI_PS2KBD_HPA:
-    case LASI_PS2MOU_HPA:
-        return 26;
-    default:
-        g_assert_not_reached();
-    }
-}
-
 DeviceState *lasi_initfn(MemoryRegion *address_space)
 {
     DeviceState *dev;
@@ -266,20 +243,20 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
     /* LAN */
     if (enable_lasi_lan()) {
         qemu_irq lan_irq = qemu_allocate_irq(lasi_set_irq, s,
-                lasi_get_irq(LASI_LAN_HPA));
+                                             LASI_IRQ_LAN_HPA);
         lasi_82596_init(address_space, LASI_LAN_HPA, lan_irq);
     }
 
     /* Parallel port */
     qemu_irq lpt_irq = qemu_allocate_irq(lasi_set_irq, s,
-            lasi_get_irq(LASI_LPT_HPA));
+                                         LASI_IRQ_LPT_HPA);
     parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0,
                      lpt_irq, parallel_hds[0]);
 
     if (serial_hd(1)) {
         /* Serial port */
         qemu_irq serial_irq = qemu_allocate_irq(lasi_set_irq, s,
-                lasi_get_irq(LASI_UART_HPA));
+                                                LASI_IRQ_UART_HPA);
         serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0,
                 serial_irq, 8000000 / 16,
                 serial_hd(0), DEVICE_NATIVE_ENDIAN);
@@ -287,7 +264,7 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
 
     /* PS/2 Keyboard/Mouse */
     qemu_irq ps2kbd_irq = qemu_allocate_irq(lasi_set_irq, s,
-            lasi_get_irq(LASI_PS2KBD_HPA));
+                                            LASI_IRQ_PS2KBD_HPA);
     lasips2_init(address_space, LASI_PS2KBD_HPA,  ps2kbd_irq);
 
     return dev;
diff --git a/hw/hppa/lasi.h b/hw/hppa/lasi.h
index 559aae2560..f40546da6e 100644
--- a/hw/hppa/lasi.h
+++ b/hw/hppa/lasi.h
@@ -38,6 +38,15 @@ OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP)
 #define ICR_BUS_ERROR_BIT  LASI_BIT(8)  /* bit 8 in ICR */
 #define ICR_TOC_BIT        LASI_BIT(1)  /* bit 1 in ICR */
 
+#define LASI_IRQ_HPA        14
+#define LASI_IRQ_UART_HPA   5
+#define LASI_IRQ_LPT_HPA    7
+#define LASI_IRQ_LAN_HPA    8
+#define LASI_IRQ_SCSI_HPA   9
+#define LASI_IRQ_AUDIO_HPA  13
+#define LASI_IRQ_PS2KBD_HPA 26
+#define LASI_IRQ_PS2MOU_HPA 26
+
 struct LasiState {
     PCIHostState parent_obj;
 
-- 
2.20.1



  parent reply	other threads:[~2022-05-08 20:19 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08 19:55 [PULL 00/53] qemu-sparc queue 20220508 Mark Cave-Ayland
2022-05-08 19:55 ` [PULL 01/53] dino: checkpatch fixes Mark Cave-Ayland
2022-05-08 19:55 ` [PULL 02/53] dino: move registers from dino_init() to DINO_PCI_BRIDGE init function Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 03/53] dino: move PCI bus initialisation to dino_pcihost_init() Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 04/53] dino: move PCI windows " Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 05/53] dino: add memory-as property containing a link to the memory address space Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 06/53] dino: move pci_setup_iommu() to dino_pcihost_init() Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 07/53] dino: move PCI bus master address space setup to dino_pcihost_realize() Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 08/53] dino: move initial register configuration to new dino_pcihost_reset() function Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 09/53] dino: use QOM cast instead of directly referencing parent_obj Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 10/53] dino: return PCIBus from dino_init() using qdev_get_child_bus() Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 11/53] dino: split declarations from dino.c into dino.h Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 12/53] hppa: use new CONFIG_HPPA_B160L option instead of CONFIG_DINO to build hppa machine Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 13/53] dino: change dino_init() to return the DINO device instead of PCIBus Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 14/53] machine.c: map DINO device during board configuration Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 15/53] dino.h: add defines for DINO IRQ numbers Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 16/53] dino: define IRQ inputs as qdev GPIOs Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 17/53] dino: wire up serial IRQ using a qdev GPIO in machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 18/53] dino: remove unused dino_set_timer_irq() IRQ handler Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 19/53] hppa: move dino_init() from dino.c to machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 20/53] dino: use numerical constant for iar0 and iar1 reset values Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 21/53] dino: move DINO HPA constants from hppa_hardware.h to dino.h Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 22/53] dino: move from hw/hppa to hw/pci-host Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 23/53] lasi: checkpatch fixes Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 24/53] lasi: move memory region initialisation to new lasi_init() function Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 25/53] lasi: move register memory mapping from lasi.c to machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 26/53] lasi: move initialisation of iar and rtc to new lasi_reset() function Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 27/53] lasi: move LASIState and associated QOM structures to lasi.h Mark Cave-Ayland
2022-05-08 19:56 ` Mark Cave-Ayland [this message]
2022-05-08 19:56 ` [PULL 29/53] lasi: define IRQ inputs as qdev GPIOs Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 30/53] lasi: use qdev GPIOs to wire up IRQs in lasi_initfn() Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 31/53] lasi: fix serial port initialisation Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 32/53] lasi: update lasi_initfn() to return LASIState Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 33/53] lasi: move LAN initialisation to machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 34/53] lasi: move parallel port " Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 35/53] lasi: move second serial " Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 36/53] lasi: move PS2 " Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 37/53] lasi: remove address space parameter from lasi_initfn() Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 38/53] lasi: move lasi_initfn() to machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 39/53] lasi: use constants for device register offsets Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 40/53] lasi: use numerical constant for iar reset value Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 41/53] hppa: move device headers from hppa_sys.h into individual .c files Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 42/53] lasi: move from hw/hppa to hw/misc Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 43/53] hppa: move hppa_pci_ignore_ops from pci.c to machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 44/53] hppa: remove hw/hppa/pci.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 45/53] hppa: remove unused trace-events from from hw/hppa Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 46/53] hppa: move enable_lan() define from hppa_sys.h to machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 47/53] hppa: remove the empty hppa_sys.h file Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 48/53] hppa: use MACHINE QOM macros for defining the hppa machine Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 49/53] hppa: fold machine_hppa_machine_init() into machine_hppa_machine_init_class_init() Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 50/53] hppa: simplify machine function names in machine.c Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 51/53] artist: checkpatch and newline style fixes Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 52/53] artist: remove unused ROP8OFF() macro Mark Cave-Ayland
2022-05-08 19:56 ` [PULL 53/53] artist: only render dirty scanlines on the display surface Mark Cave-Ayland
2022-05-09  1:07 ` [PULL 00/53] qemu-sparc queue 20220508 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=20220508195650.28590-29-mark.cave-ayland@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.