From patchwork Mon Mar 4 05:04:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 224586 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 B682E2C030B for ; Mon, 4 Mar 2013 16:07:22 +1100 (EST) Received: from localhost ([::1]:59030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCNcO-0003Wt-QS for incoming@patchwork.ozlabs.org; Mon, 04 Mar 2013 00:07:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCNby-0003M5-MO for qemu-devel@nongnu.org; Mon, 04 Mar 2013 00:06:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCNbu-00008r-Jl for qemu-devel@nongnu.org; Mon, 04 Mar 2013 00:06:54 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:62189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCNbu-00008g-Db for qemu-devel@nongnu.org; Mon, 04 Mar 2013 00:06:50 -0500 Received: by mail-pa0-f47.google.com with SMTP id bj3so2928828pad.34 for ; Sun, 03 Mar 2013 21:06:49 -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=PVK500QgE8DtrPfPGbFnjxFp3ASLsSl8EKEO5DirAgVmdMXv7FzD2qpNOvVdcPKp/m ouKBuO0D3K+OFHhVUFhda4BAH4JivMB25ZQOjG+kc+neDUI8wpP5l1R18G86SkqYMZIO 1o+Ozc4ST+zHwkB90hGnOTtHDEN3IluLNpSfVqyqzjnsyAE/GBOFlmIBQFEHCsWz69d5 W8ePpYdQC8rWqiOKGcrG2NP4VD8bhj8sv3XBZLEYbgQ0pBhXeKunqpcYVZj5fXgoZUeD hFP1iFKxk4Cm8C0BngCu1Mz7L5XPNuGK9TRl4fgwXmbHYGcVi/szryT/aP+PM1dw9ORM y9lw== X-Received: by 10.66.4.136 with SMTP id k8mr30315671pak.22.1362373609768; Sun, 03 Mar 2013 21:06:49 -0800 (PST) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPS id ix6sm20951739pbc.17.2013.03.03.21.06.47 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Sun, 03 Mar 2013 21:06:48 -0800 (PST) From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Mon, 4 Mar 2013 15:04:53 +1000 Message-Id: <848c116c711dab0af10729a487968384aadd9faf.1362373359.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: ALoCoQkPug+sHaSQ/olNNVckufiGO5NvJl5xqitWtevGeOPVRmtn1j/t5QhXsFRwwR9wL1+gf3cq X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.47 Cc: edgar.iglesias@gmail.com, Peter Crosthwaite , Nathan Rossi , peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH v2 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: