From patchwork Wed Feb 20 07:26:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 221976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9F14F2C007E for ; Wed, 20 Feb 2013 18:27:03 +1100 (EST) Received: from localhost ([::1]:38950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U844z-0003ie-QY for incoming@patchwork.ozlabs.org; Wed, 20 Feb 2013 02:27:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U844h-0003Yn-Eb for qemu-devel@nongnu.org; Wed, 20 Feb 2013 02:26:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U844f-000340-RX for qemu-devel@nongnu.org; Wed, 20 Feb 2013 02:26:43 -0500 Received: from mail-da0-f50.google.com ([209.85.210.50]:51044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U844f-000331-LJ for qemu-devel@nongnu.org; Wed, 20 Feb 2013 02:26:41 -0500 Received: by mail-da0-f50.google.com with SMTP id h15so3380602dan.23 for ; Tue, 19 Feb 2013 23:26:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state; bh=XGe51T/UIDN1ELBCd640cSUb+QqzXEAV9uq+WUtoCa0=; b=QIjsEEY49Qx6EBcu3Ihm7J6oZ6qLTciv4blABivM5IJsduOUiWdeWOhjeIOzAKZKJH DyfaUlyDI7cYFqzLf6kuj67A2wKiTFjihjIKkgBPEH8e8IIAlNY76nInMJn5YKK6yM3r ZFCIR6w9psUnPemEisSZBOMfsVVBRg+IXR4PDWtmUKvhQk8UY4JXZE/wXjrtQtHCnEud 3IlkU8Xx4HO6FTl+k7yedhMYY8SQ5hD5eUqk7lJdhfA/eqkoz3hXvUY1/Wl/qJ7li9d6 6YD3prcO/7nUpYxAgjEku3oBhoES/iVVc7OzSu33h3KoZniJsJfmL2UTJwZrhBR1adhy ojog== X-Received: by 10.66.231.39 with SMTP id td7mr956684pac.126.1361345200777; Tue, 19 Feb 2013 23:26:40 -0800 (PST) Received: from localhost ([1.133.224.226]) by mx.google.com with ESMTPS id j7sm17022622pay.10.2013.02.19.23.26.36 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 19 Feb 2013 23:26:39 -0800 (PST) From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Wed, 20 Feb 2013 17:26:03 +1000 Message-Id: <033a78bad9b41b75f1d454d882ed72bb8b2997c0.1361344859.git.peter.crosthwaite@xilinx.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQllVpBlc6cH+ASRrL6OCVGL3fa33OMDkUGVwUDvMTKWzRI+Eb3DY/Pa0S1FJatpUehrGjts X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.50 Cc: edgar.iglesias@gmail.com, Peter Crosthwaite , Nathan Rossi , peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH v1 3/5] xilinx_spips: Add missing dual-bus snoop commands 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 From: Nathan Rossi Added additional commands to the switch to check for when snooping commands in dual bus mode setups. Cleaned up code to use an enum. Signed-off-by: Nathan Rossi Signed-off-by: Peter Crosthwaite --- hw/xilinx_spips.c | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-) diff --git a/hw/xilinx_spips.c b/hw/xilinx_spips.c index 03797c3..45a1c51 100644 --- a/hw/xilinx_spips.c +++ b/hw/xilinx_spips.c @@ -115,6 +115,19 @@ #define SNOOP_NONE 0xFE #define SNOOP_STRIPING 0 +typedef enum { + READ = 0x3, + FAST_READ = 0xb, + DOR = 0x3b, + QOR = 0x6b, + DIOR = 0xbb, + QIOR = 0xeb, + + PP = 0x2, + DPP = 0xa2, + QPP = 0x32, +} FlashCMD; + typedef struct { SysBusDevice busdev; MemoryRegion iomem; @@ -251,15 +264,19 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s) switch (s->snoop_state) { case (SNOOP_CHECKING): switch (tx) { /* new instruction code */ - case 0x0b: /* dual/quad output read DOR/QOR */ - case 0x6b: - s->snoop_state = 4; + case READ: /* 3 address bytes, no dummy bytes/cycles */ + case PP: + case DPP: + case QPP: + s->snoop_state = 3; break; - /* FIXME: these vary between vendor - set to spansion */ - case 0xbb: /* high performance dual read DIOR */ + case FAST_READ: /* 3 address bytes, 1 dummy byte */ + case DOR: + case QOR: + case DIOR: /* FIXME: these vary between vendor - set to spansion */ s->snoop_state = 4; break; - case 0xeb: /* high performance quad read QIOR */ + case QIOR: /* 3 address bytes, 2 dummy bytes */ s->snoop_state = 6; break; default: