From nobody Fri Dec 27 03:47:59 2024 Delivered-To: importer@patchew.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; 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 1504271106282216.81334744130993; Fri, 1 Sep 2017 06:05:06 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E430221E62BB0; Fri, 1 Sep 2017 06:01:55 -0700 (PDT) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) (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 E9BD021E2BE4D for ; Fri, 1 Sep 2017 06:01:53 -0700 (PDT) Received: by mail-lf0-x233.google.com with SMTP id d202so558119lfd.5 for ; Fri, 01 Sep 2017 06:04:38 -0700 (PDT) Received: from enkidu.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id m129sm21754lfg.26.2017.09.01.06.04.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Sep 2017 06:04:35 -0700 (PDT) X-Original-To: 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=u8gIICXSSajUhtvQ3RNTcCk/T6DmLmWgV9PVsRoau8A=; b=cF4AzHP1UWtcDYYE4WPEmWBgwTTiE5TPdAfA6stvK9xuy2XSHfJ/NN/IAhl0f1WVAU UWLgqzVTiqQ0lp3CLesUhhdn01Dqvvdh5aXubX0sr3FpoZcUnUrBidx+2EjoWo4Bo7xu ETmJoh2NPsvkegyMfHi7zZSHPphBzFHLLp5MHJI5CfbJ4quqCgb09yRPcuM8pgoV4lcG TveWCJgGLwOJEDDWO1ML3BG6MC8sBAcHEI/+32URaJZGy8y02qXmsS4SW+mCRk33ombl /Snv1lYY+J0l7947CADNXVHP9DnFUCInXGWzgVxpOpGQBB5cpGPzXmmoLC7jvHLXnbc1 fuWQ== 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=u8gIICXSSajUhtvQ3RNTcCk/T6DmLmWgV9PVsRoau8A=; b=OIrbOXTie4bye6stqv0/8cZXnfIY4RpL3XxXhVp/J1VSxz95TSJqkzdOjld5rJQxbt 1DDkmDNv2J+ruks0OqDOy2nxAPl4CGSfZb2Ho85S6IieDafcyZWFS4rNDKzwBp30PJd0 RZ47AV82GeukvwpRq+FWKkj84OPSjCLhmaHfGK6VrYglcUQXHEMYM0e/B/eEXtEeKbG+ dg/kLknD1ZOcCO1zAYkcbGvH4QVFuzuPtYrdxJB0ZIx3cVAZptSLkFQRslIUgoIGRk9j TZvHJdAxJL0XjDrCreMML72q79+ECdsfq/C/PgQ2GUyOmrsLFsxZJSAOjXcoRi0Qvf2h zbrw== X-Gm-Message-State: AHPjjUiJ+rhr5PCJuNs9ZpSWMR7jOghCHd43nc1x83PdD1vfnc39ECUt pmSN4khtgvIHLZepsMXoFA== X-Google-Smtp-Source: ADKCNb7aZdA153bgQ8FjKEgspPEbdkGdNFKc5TuENaixTLUdY1cGLEZa9QdGd8XmENrQyj+pWb4Uzw== X-Received: by 10.25.215.169 with SMTP id q41mr921900lfi.120.1504271076454; Fri, 01 Sep 2017 06:04:36 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Fri, 1 Sep 2017 15:08:23 +0200 Message-Id: <1504271303-1782-12-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1504271303-1782-1-git-send-email-mw@semihalf.com> References: <1504271303-1782-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 11/11] Drivers/Spi/Devices/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, agraf@suse.de, 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 bfb8fa3..4c15513 100755 --- a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c +++ b/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c @@ -280,6 +280,11 @@ SpiFlashCmdBankaddrWrite ( { UINT8 Cmd =3D CMD_BANK_WRITE; =20 + /* Update bank selection command for Spansion */ + if (Slave->Info->Id[0] =3D=3D 0x01) { + 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 b876966..d44c56f 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 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel