Patchwork Patch to fix linux for sh4.

login
register
mail settings
Submitter Rob Landley
Date June 28, 2013, 2:14 a.m.
Message ID <1372385680.2776.154@driftwood>
Download mbox | patch
Permalink /patch/255262/
State New
Headers show

Comments

Rob Landley - June 28, 2013, 2:14 a.m.
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

Patch

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