From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsONb-0006gA-Ow for qemu-devel@nongnu.org; Thu, 27 Jun 2013 22:25:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsONa-00064k-2D for qemu-devel@nongnu.org; Thu, 27 Jun 2013 22:25:43 -0400 Received: from mail-ie0-f169.google.com ([209.85.223.169]:59489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsONZ-00064W-QC for qemu-devel@nongnu.org; Thu, 27 Jun 2013 22:25:41 -0400 Received: by mail-ie0-f169.google.com with SMTP id 10so3109163ied.14 for ; Thu, 27 Jun 2013 19:25:41 -0700 (PDT) Received: from driftwood (c-50-148-218-118.hsd1.mn.comcast.net. [50.148.218.118]) by mx.google.com with ESMTPSA id j3sm6029530igv.4.2013.06.27.19.25.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Jun 2013 19:25:40 -0700 (PDT) Date: Thu, 27 Jun 2013 21:14:40 -0500 From: Rob Landley Message-Id: <1372385680.2776.154@driftwood> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-u0h/X27XxKgVj2qgAc0c" Subject: [Qemu-devel] Patch to fix linux for sh4. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-u0h/X27XxKgVj2qgAc0c Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =20 the attached sh4.patch to qemu. What I did with earlier kernels was apply the attached =20 linux-fixsh4-2.patch but more recent kernels added another access to =20 the same register somewhere and the proper fix is for qemu to ignore it =20 (it's a NOP) rather than exiting the emulator. Rob= --=-u0h/X27XxKgVj2qgAc0c Content-Type: text/x-patch; charset=us-ascii; name=sh4.patch Content-Disposition: attachment; filename=sh4.patch 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; --=-u0h/X27XxKgVj2qgAc0c Content-Type: text/x-patch; charset=us-ascii; name=linux-fixsh4-2.patch Content-Disposition: attachment; filename=linux-fixsh4-2.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); --=-u0h/X27XxKgVj2qgAc0c--