From patchwork Mon Nov 14 09:39:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bertrand.cachet@heig-vd.ch X-Patchwork-Id: 125504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 782E0B71E8 for ; Mon, 14 Nov 2011 20:40:27 +1100 (EST) Received: from localhost ([::1]:53385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPt1X-0002SQ-0W for incoming@patchwork.ozlabs.org; Mon, 14 Nov 2011 04:40:19 -0500 Received: from eggs.gnu.org ([140.186.70.92]:41332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPt1R-0002SL-AE for qemu-devel@nongnu.org; Mon, 14 Nov 2011 04:40:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPt1L-000129-Gf for qemu-devel@nongnu.org; Mon, 14 Nov 2011 04:40:13 -0500 Received: from mailcl1.heig-vd.ch ([193.134.216.182]:47693 helo=heig-vd.ch) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPt1L-0000yu-Bt for qemu-devel@nongnu.org; Mon, 14 Nov 2011 04:40:07 -0500 Received: from [10.192.41.23] (helo=EINTFE01A.einet.ad.eivd.ch) by heig-vd.ch stage1 with esmtp (Exim MailCleaner) id 1RPtaP-0008KZ-G9 for from ; Mon, 14 Nov 2011 11:16:21 +0100 Received: from localhost.localdomain (10.192.51.133) by EINTFE01A.einet.ad.eivd.ch (10.192.41.25) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 14 Nov 2011 10:40:03 +0100 From: Bertrand Cachet To: Date: Mon, 14 Nov 2011 10:39:57 +0100 Message-ID: <1321263597-17479-1-git-send-email-bertrand.cachet@heig-vd.ch> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-Originating-IP: [10.192.51.133] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 193.134.216.182 Cc: Bertrand Cachet Subject: [Qemu-devel] [PATCH] LAN9118: Handling write to BYTE_TEST register 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 Prevent LAN9118 driver to finish in hardware error when writing to the BYTE_TEST register. This register (even if ReadOnly) is used to wake-up the device when it is in low power consumption mode. Add case for BYTE_TEST in lan9118_writel method. Just write some documentation explaining use its use. Signed-off-by: Bertrand Cachet --- hw/lan9118.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/hw/lan9118.c b/hw/lan9118.c index f8149e6..65096d4 100644 --- a/hw/lan9118.c +++ b/hw/lan9118.c @@ -977,6 +977,15 @@ static void lan9118_writel(void *opaque, target_phys_addr_t offset, s->pmt_ctrl &= ~0x34e; s->pmt_ctrl |= (val & 0x34e); break; + case CSR_BYTE_TEST: + /* Even if this register is marked ReadOnly in the datasheet, + a write to this register will wake up the device when + PM_MODE is currently in D1 or D2 mode. + + As Power Modes are not handled in this driver, we will + leave this case with no implementation. + */ + break; case CSR_GPIO_CFG: /* Probably just enabling LEDs. */ s->gpio_cfg = val & 0x7777071f;