From patchwork Tue Oct 24 19:51:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francisco Iglesias X-Patchwork-Id: 10025449 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 1FC5F60375 for ; Tue, 24 Oct 2017 19:57:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11A6728A67 for ; Tue, 24 Oct 2017 19:57:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06B3A28A6A; Tue, 24 Oct 2017 19:57:35 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 B136228A67 for ; Tue, 24 Oct 2017 19:57:34 +0000 (UTC) Received: from localhost ([::1]:45295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e75KP-0006IT-Ux for patchwork-qemu-devel@patchwork.kernel.org; Tue, 24 Oct 2017 15:57:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e75F1-0002uT-8n for qemu-devel@nongnu.org; Tue, 24 Oct 2017 15:52:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e75F0-0003Xm-FQ for qemu-devel@nongnu.org; Tue, 24 Oct 2017 15:51:59 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:55511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e75F0-0003Wr-8L for qemu-devel@nongnu.org; Tue, 24 Oct 2017 15:51:58 -0400 Received: by mail-lf0-x241.google.com with SMTP id p184so25267387lfe.12 for ; Tue, 24 Oct 2017 12:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9xu5/rzoFSzY6PmBsxFfzODoAL0rZI9LkM6mMiQvttE=; b=e3NASwi8SehwtXVWf5rNJZ4nIOzTjHXQjflQLSHGXrZvD5iVTLmldDSwj6OVTS/2ea 7gQA6RwYX+dnhiCA/HVPOS0i1byevk7r3qiDNOnWhcwn/2RSfZHccgnASOFJkECGCXv2 0pVRfWd8U1wRb2Gli9kOU1nPx40lEknKeu0qDpGySegBbC5y7ThG8hSPpiHjGSBGZMfj 7V4I/3fnMT67YRe/WnMQQmVCOp0HHLUCKbpQQZj9sLvgz47JQl1mt4mzBhA1Bc0zl7/7 3qQaZPkNnAV3MF2QmJ3L6I2wUOrakIMSGDTssjX2EiPjjFO+QDdYXcCy24bECEFnHq4I 3IOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9xu5/rzoFSzY6PmBsxFfzODoAL0rZI9LkM6mMiQvttE=; b=pN2KP2UuiMPtNKy9gszVY7ocw0a3xUvlzLWkaLtXUcusPzfI1fmY3kEF0EZXTjoRKJ haJ8qSZkeaSXjqxNoLkY75vnP3FHsIntn1ar1Z+UghALF5Iy5Sva7lZ46pe42NS2Kw6/ T7t57FVzdRuCECb0155J5LIQX4Zv5MQRVTb8zpmAlwkN7KZpXB2uaRhIqvpGP3nUCWmm TaE7FyIYLxwqeLdx6GdFff+QsT/NohBRPj0yqjrZhMzE/qbMN/htzSzmkekh2MjC+zla Fw1nbzQaCTlLEOk28gvs8AnpEeRyLa343yFiu30ulxZjsx9m+CgK5W0cTsWiNNbjom8B BoiQ== X-Gm-Message-State: AMCzsaXXHx7zyTavmGXKxy/nPNqMRrk9+8T4bAvS+A311qlpeQmNn1r1 pXzxHmf6N7qqVKmVgCbW9ZKbdRul X-Google-Smtp-Source: ABhQp+Rx1LQY7uKNcQSWu7uZgLfNF9Yp3Mi/DQD6xe7my/XDZ0BWlkc/b7H5uaD6mzHfmzdUu1e3bA== X-Received: by 10.46.23.85 with SMTP id l82mr6991862lje.178.1508874716693; Tue, 24 Oct 2017 12:51:56 -0700 (PDT) Received: from localhost.localdomain (c83-254-152-225.bredband.comhem.se. [83.254.152.225]) by smtp.gmail.com with ESMTPSA id a78sm184390lfa.86.2017.10.24.12.51.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 12:51:56 -0700 (PDT) From: Francisco Iglesias To: qemu-devel@nongnu.org Date: Tue, 24 Oct 2017 21:51:36 +0200 Message-Id: <20171024195139.28179-11-frasse.iglesias@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171024195139.28179-1-frasse.iglesias@gmail.com> References: <20171024195139.28179-1-frasse.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::241 Subject: [Qemu-devel] [PATCH v3 10/13] xilinx_spips: Add support for 4 byte addresses in the LQSPI 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: edgari@xilinx.com, alistai@xilinx.com, francisco.iglesias@feimtech.se Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add support for 4 byte addresses in the LQSPI and correct LQSPI_CFG_SEP_BUS. Signed-off-by: Francisco Iglesias --- hw/ssi/xilinx_spips.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index df5d908..5e5e8cc 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -92,8 +92,9 @@ #define R_LQSPI_CFG_RESET 0x03A002EB #define LQSPI_CFG_LQ_MODE (1U << 31) #define LQSPI_CFG_TWO_MEM (1 << 30) -#define LQSPI_CFG_SEP_BUS (1 << 30) +#define LQSPI_CFG_SEP_BUS (1 << 29) #define LQSPI_CFG_U_PAGE (1 << 28) +#define LQSPI_CFG_ADDR4 (1 << 27) #define LQSPI_CFG_MODE_EN (1 << 25) #define LQSPI_CFG_MODE_WIDTH 8 #define LQSPI_CFG_MODE_SHIFT 16 @@ -697,6 +698,9 @@ static void lqspi_load_cache(void *opaque, hwaddr addr) fifo8_push(&s->tx_fifo, s->regs[R_LQSPI_CFG] & LQSPI_CFG_INST_CODE); /* read address */ DB_PRINT_L(0, "pushing read address %06x\n", flash_addr); + if (s->regs[R_LQSPI_CFG] & LQSPI_CFG_ADDR4) { + fifo8_push(&s->tx_fifo, (uint8_t)(flash_addr >> 24)); + } fifo8_push(&s->tx_fifo, (uint8_t)(flash_addr >> 16)); fifo8_push(&s->tx_fifo, (uint8_t)(flash_addr >> 8)); fifo8_push(&s->tx_fifo, (uint8_t)flash_addr);