qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: gerg@uclinux.org
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Greg Ungerer <gerg@uclinux.org>
Subject: [Qemu-devel] [PATCH v2 1/3] m68k: implement more ColdFire 5208 interrupt controller functionality
Date: Fri, 19 Jun 2015 23:43:24 +1000	[thread overview]
Message-ID: <1434721406-25288-2-git-send-email-gerg@uclinux.org> (raw)
In-Reply-To: <1434721406-25288-1-git-send-email-gerg@uclinux.org>

From: Greg Ungerer <gerg@uclinux.org>

Implement the SIMR and CIMR registers of the 5208 interrupt controller.
These are used by modern versions of Linux running on ColdFire (not sure
of the exact version they were introduced, but they have been in for quite
a while now).

Without this change when attempting to run a linux-3.5 kernel you will
see:

  qemu: hardware error: mcf_intc_write: Bad write offset 28

and execution will stop and dump out.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
 hw/m68k/mcf_intc.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c
index 621423c..f13c7f3 100644
--- a/hw/m68k/mcf_intc.c
+++ b/hw/m68k/mcf_intc.c
@@ -102,6 +102,20 @@ static void mcf_intc_write(void *opaque, hwaddr addr,
     case 0x0c:
         s->imr = (s->imr & 0xffffffff00000000ull) | (uint32_t)val;
         break;
+    case 0x1c:
+        if (val & 0x40) {
+            s->imr = ~0ull;
+        } else {
+            s->imr |= (0x1ull << (val & 0x3f));
+        }
+        break;
+    case 0x1d:
+        if (val & 0x40) {
+            s->imr = 0ull;
+        } else {
+            s->imr &= ~(0x1ull << (val & 0x3f));
+        }
+        break;
     default:
         hw_error("mcf_intc_write: Bad write offset %d\n", offset);
         break;
-- 
1.9.1

  reply	other threads:[~2015-06-19 13:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 13:43 [Qemu-devel] [PATCH v2 0/3] m68k: fix ColdFire support gerg
2015-06-19 13:43 ` gerg [this message]
2015-06-19 13:43 ` [Qemu-devel] [PATCH v2 2/3] m68k: implement move to/from usp register instruction gerg
2015-06-19 19:28   ` Laurent Vivier
2015-06-19 13:43 ` [Qemu-devel] [PATCH v2 3/3] m68k: fix usp processing on interrupt entry and exception exit gerg
2015-06-19 19:35   ` Laurent Vivier
2015-06-21 23:11     ` Greg Ungerer
2015-06-19 19:39 ` [Qemu-devel] [PATCH v2 0/3] m68k: fix ColdFire support Laurent Vivier
2015-06-20  4:55   ` Greg Ungerer
2015-06-20 17:03     ` Laurent Vivier
2015-06-22 16:49     ` Andreas Färber
2015-06-23  0:37       ` Greg Ungerer
2015-06-20 17:24 ` Laurent Vivier
2015-06-22 15:34 ` Peter Maydell

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=1434721406-25288-2-git-send-email-gerg@uclinux.org \
    --to=gerg@uclinux.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).