From patchwork Tue Oct 25 02:06:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9393851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 244D3607F0 for ; Tue, 25 Oct 2016 02:07:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14B2B2923D for ; Tue, 25 Oct 2016 02:07:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06FEC29241; Tue, 25 Oct 2016 02:07:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0B36F2923D for ; Tue, 25 Oct 2016 02:07:23 +0000 (UTC) Received: from localhost ([::1]:51153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byr98-0004fU-Rr for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Oct 2016 22:07:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byr8k-0004eO-TN for qemu-devel@nongnu.org; Mon, 24 Oct 2016 22:06:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byr8h-0008El-Ne for qemu-devel@nongnu.org; Mon, 24 Oct 2016 22:06:58 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:34044) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byr8h-0008ES-IO for qemu-devel@nongnu.org; Mon, 24 Oct 2016 22:06:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=0H8s+0eVYUqDzbPyWDK+boo9sCWWwOHjYmiNduSI8DE=; b=FF1Zu6mVTXh5R1LU7Bi7Xn8xz1 n+yzsvXfcOTz7d3cfh0C8KthMXynUTrZsumlkLv82N2PralC3r6FRFeXDg0ViqbBg4515TFRlSWu3 POjysKknxR/eDKFKMSw/F4l268RvoOMolRA/N53jwes0xcX91zRJewGU5zziJ1u7hdQzoXajkY5TT TzCb4R0a1j8/0zfNdcFzFUId8D+z0rfz1PseQzkJa6rF+xEBx4fqhRsJziR9MO3wNUf7dxZSn9FjE PCuyHeZmuzZxZUXKk+8+6B1Wm9gatu4vc0H1zkcu4z59AW9Y2t3FTsqJF1zSNKLY89PLghnd4Apl8 8otwptfQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:34858 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1byr8c-0021CU-Qy; Tue, 25 Oct 2016 02:06:51 +0000 From: Guenter Roeck To: qemu-devel@nongnu.org Date: Mon, 24 Oct 2016 19:06:52 -0700 Message-Id: <1477361212-18833-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - nongnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.91.199.152 Subject: [Qemu-devel] [PATCH] hw/arm/pxa2xx: Correctly handle external GPIO reset requests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guenter Roeck Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The internal GPIO reset, enabled with GPR_EN, only applies to GPIO pin 1. If other GPIO pins are used for reset, this is unrelated to GPR_EN, the reset is an external reset pin, and it resets the entire system. This fixes GPIO reset failures seen with various PXA270 emulations (akita, borzoi, spitz, tosa, terrier) when running Linux. Signed-off-by: Guenter Roeck --- hw/arm/pxa2xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index cb55704..2a2a821 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -2048,10 +2048,18 @@ static void pxa2xx_reset(void *opaque, int line, int level) { PXA2xxState *s = (PXA2xxState *) opaque; - if (level && (s->pm_regs[PCFR >> 2] & 0x10)) { /* GPR_EN */ + /* + * GPIO pin 1 is the CPU internal GPIO reset, enabled with GPR_EN. + * Any other pin is board specific and resets the entire system. + */ + if (line == 1 && level && (s->pm_regs[PCFR >> 2] & 0x10)) { /* GPR_EN */ cpu_reset(CPU(s->cpu)); /* TODO: reset peripherals */ } + + if (line != 1 && level) { + qemu_system_reset_request(); + } } /* Initialise a PXA270 integrated chip (ARM based core). */