All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Patch to fix linux for sh4.
@ 2013-06-28  2:14 Rob Landley
  0 siblings, 0 replies; only message in thread
From: Rob Landley @ 2013-06-28  2:14 UTC (permalink / raw)
  To: qemu-devel

[-- 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);
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-28  2:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-28  2:14 [Qemu-devel] Patch to fix linux for sh4 Rob Landley

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.