From nobody Wed Dec 25 14:35:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1509731864300524.0768151596578; Fri, 3 Nov 2017 10:57:44 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3F80D202E5E70; Fri, 3 Nov 2017 10:53:41 -0700 (PDT) Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 08A8C202E5E70 for ; Fri, 3 Nov 2017 10:53:38 -0700 (PDT) Received: by mail-lf0-x243.google.com with SMTP id w21so4064086lfc.6 for ; Fri, 03 Nov 2017 10:57:34 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g29sm1120441lfh.3.2017.11.03.10.57.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 10:57:31 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::243; helo=mail-lf0-x243.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WBAZ7p8GvIMHhYUJbATgoQurxwgGRZPPImZqi0oww+Q=; b=oE3zpOCrdVJio2ePyaKlHBShHL/978hYDr3q/Vm+X+I5y1yj5KuAA2z6+WZq7Mipgl IlQOPJeoKoB2CupFbqvtYvpb+gX1rDMxkyVCzCf+GxqEFEJtNovKprwecCPh23GF2Gat aZkyRf6yJYZ468gtzR5K8cssomCs1VmDAUbQzszI36tfw07XUPg7c2dqsUOrBMLqxgZd XydOuuHNQz8VSgxdMH5QsnE7vIqC8AHWH29m2WT7TQ54SOODvCLzgkOtZBnYElOWmA48 rUbFg/JeNLWBp+Wxc5WXYsiJ1HHJig/yJ6unVAbL0GNWMkaonnyvwgPTqLeWtGJncm10 QXuw== 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=WBAZ7p8GvIMHhYUJbATgoQurxwgGRZPPImZqi0oww+Q=; b=qFiASNA9A3nd45YuNak1uNtpIiQ8xaAT9LA70K+gOlFaPWQk7F7PxLIJdhz5wty3er ew1Yy/eQ3xarnaKusBBryvoyH7LZQzc8JvkM3DRwwi+QaWSFT8evRPDsrrNXzlE18isi gddBaBX6gw1dePSoMuSB8W7sk2HulejHD/c/q/O+KT59uc+mhvugtd+Ga5rMsEOL7yri aGqZS1MiFaqiasckt4mQj1RlrN/XvQu/S1er/eefdQtqJWunD17/DD2xfX+jrrlS0cxg 02ITmN9XjNRBhbOe+tWbSj/s0uzEXXCP3DvwBRRD6vL2VE5xCpZO2SGpf4SLSoDRghuS 73hA== X-Gm-Message-State: AMCzsaUxBNofA82BrVVBzlM18Npcp6kauAbXVzJWWmAul5El6++2bOeE hN5RJW47QUSupS3pFdq7VaqmKh+xVkw= X-Google-Smtp-Source: ABhQp+RRWaMYrqIXPNjkVydhWKNBllQcTWzBO7NjbqM1ixhappcJfX01a+t0+JRsoygAZ4RKWjvHBQ== X-Received: by 10.46.4.85 with SMTP id 82mr3392478lje.4.1509731852479; Fri, 03 Nov 2017 10:57:32 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Fri, 3 Nov 2017 18:57:14 +0100 Message-Id: <1509731835-5664-6-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509731835-5664-1-git-send-email-mw@semihalf.com> References: <1509731835-5664-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH v2 5/6] Marvell/Drivers: MvSpiFlash: Fix bank selection for Spansion X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Spansion SPI flash devices use different command for bank selection. Update it, basing on the first byte of flash ID. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c | 5 +++++ Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c b/Platform/M= arvell/Drivers/Spi/Devices/MvSpiFlash.c index 4a97ba9..456d9f9 100755 --- a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c +++ b/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c @@ -150,6 +150,11 @@ SpiFlashCmdBankaddrWrite ( { UINT8 Cmd =3D CMD_BANK_WRITE; =20 + /* Update bank selection command for Spansion */ + if (Slave->Info->Id[0] =3D=3D NOR_FLASH_ID_SPANSION) { + Cmd =3D CMD_BANKADDR_BRWR; + } + MvSpiFlashWriteCommon (Slave, &Cmd, 1, &BankSel, 1); } =20 diff --git a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.h b/Platform/M= arvell/Drivers/Spi/Devices/MvSpiFlash.h index 2583484..f09ff50 100755 --- a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.h +++ b/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.h @@ -57,6 +57,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMA= GE. #define CMD_READ_ARRAY_FAST 0x0b #define CMD_PAGE_PROGRAM 0x02 #define CMD_BANK_WRITE 0xc5 +#define CMD_BANKADDR_BRWR 0x17 #define CMD_ERASE_4K 0x20 #define CMD_ERASE_32K 0x52 #define CMD_ERASE_64K 0xd8 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel