From patchwork Fri Jun 28 02:14:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Landley X-Patchwork-Id: 255262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 07ED52C0359 for ; Fri, 28 Jun 2013 12:26:09 +1000 (EST) Received: from localhost ([::1]:50370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsONy-0006gN-Rv for incoming@patchwork.ozlabs.org; Thu, 27 Jun 2013 22:26:06 -0400 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:subject:to:x-mailer:message-id:mime-version:content-type :x-gm-message-state; bh=6R4MvCUaL/udFFXaVzEq1SQZp5t28KgBIzE8x9cRSHE=; b=a2m+tnY0HNo6cToWAld62MRehi+XpNZNFHYYm3mCBV/ufGM5bnfP1j0ZM5m/uJXvD8 o7xNINvo0gB88oSxWhZWOpVc90bzIurWIO95vSzPSwCI5uJbj3De9tjrSaQyWvxmCq7f 1m8sk/lpL28NQI8sFFdZHI66JxPjI+Db9zqYfONZl/C7xr8prB4GQiIsR6yuHfNDPIaX nROTbmVCQwQp+ghHjp+v9fRgSBsHckBMLJqrtmzqPsgCttDN9et9Sg2EGmgp16dnQR9X tEE8N0I8hG+5HQ6OfSEnbKXB5d9KvxVgdLcULwT6zuiedwdPpxHJJQUAMyW0UnXQngBH 6ffw== X-Received: by 10.50.60.2 with SMTP id d2mr1425232igr.52.1372386341243; 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 To: qemu-devel@nongnu.org X-Mailer: Balsa 2.4.11 Message-Id: <1372385680.2776.154@driftwood> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl8PbNfrKMwK3b6zxOtNLju76Q6V2PUzrU2yHLtB3w3NTDojTk7KDy1h/80RBFei/ZA9dhI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.223.169 Subject: [Qemu-devel] Patch to fix linux for sh4. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 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);