From: Rob Landley <rob@landley.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Patch to fix linux for sh4.
Date: Thu, 27 Jun 2013 21:14:40 -0500 [thread overview]
Message-ID: <1372385680.2776.154@driftwood> (raw)
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
I have images that boot under qemu-system-sh4 at:
http://landley.net/aboriginal/bin/system-image-sh4.tar.bz2
But in order to get them to work with current kernels, I have to apply
the attached sh4.patch to qemu.
What I did with earlier kernels was apply the attached
linux-fixsh4-2.patch but more recent kernels added another access to
the same register somewhere and the proper fix is for qemu to ignore it
(it's a NOP) rather than exiting the emulator.
Rob
[-- Attachment #2: sh4.patch --]
[-- Type: text/x-patch, Size: 457 bytes --]
diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index b328643..81d374a 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -248,11 +248,9 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,
s->flags &= ~SH_SERIAL_FLAG_RDF;
}
break;
-#if 0
case 0x18:
ret = s->fcr;
break;
-#endif
case 0x1c:
ret = s->rx_cnt;
break;
[-- Attachment #3: linux-fixsh4-2.patch --]
[-- Type: text/x-patch, Size: 729 bytes --]
This is "the wrong fix". The correct fix is to qemu (take out the "#ifdef 0"
around the 0x18 case in hw/sh_serial.c line 250 or so, or just don't
abort() on unknown register reads), and I pinged the qemu
mailing list about that, but this works with existing qemu releases.
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 1bd9163..fa043f1 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1879,7 +1879,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
sci_init_pins(port, termios->c_cflag);
- reg = sci_getreg(port, SCFCR);
+ reg = sci_getreg(port, 0x30);
if (reg->size) {
unsigned short ctrl = serial_port_in(port, SCFCR);
reply other threads:[~2013-06-28 2:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1372385680.2776.154@driftwood \
--to=rob@landley.net \
--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 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.