From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2607:f8b0:4001:c06::242; helo=mail-io0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (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 C57E721FCA298 for ; Wed, 1 Nov 2017 09:37:39 -0700 (PDT) Received: by mail-io0-x242.google.com with SMTP id m16so7411689iod.1 for ; Wed, 01 Nov 2017 09:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=f/Up7bLNmgeAvoWoSkb0OERgo/n9xLPpOHsf64j68+k=; b=lyFqTHu1GAPhxfmii9mJZiRu4VFOodLZq0cobMf5RZHp03EOimLIRgekgxWCM2BcIb MfooQrGKmQlAZlLH/amBrh3Xc4LOaKuaKTnlgIhFUeOJjhfdb69PR74e0KzJIUXRuJnQ tawVth6DBR6qJ+EZKVu8V8KxylVyAxBKnBNryjKKy/xKqcRl1NZGXBsx4x56q3WrwNrY +Ju0oJOZ/eRxOBYZNDjFoUsvY/tShB7WbG14RlYdS4AD6h21aqBYoSfc6Vb8ZIzHead6 dZsT1VTO72nViE1lBIsrXClfxgcsdBl8o3+0GTJJ+qasj1ZAEwu0uK59+NW2BTVFw+4C Qjhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=f/Up7bLNmgeAvoWoSkb0OERgo/n9xLPpOHsf64j68+k=; b=A1J+HLHQKjgBt0Jc5z+8reMoxR4IieAk9wVREYigVsovOT0OqbBhfHvgGMqyks8vSQ a+Brc7gg6/aUfB6dv+mIB9kwMQncAs3K5se053cZM6V4/+TUthJBxdjyspd4aUVC5u+N 9hhr+ZioPVeTNg4goS4w3Pa7zvQsvBJVRiRmVvpzGU5i4LCHBDs2TGxgqEmQpuDgrM/D 3Lx2pvteStzsqhuGx8exdtIWuriOzyl6/vn8BFchHk+y8v6R8zmviTBESNzlrjKTMwZL aelEUbatTx7OEmZX8SWIeDRDT4wGclpwETkT2IPIAqgtqh9LL8L19ZNEU2/wcqguEJ7d Q41Q== X-Gm-Message-State: AMCzsaXd6T7F8SfcV9r0HM6BIHGif6wN+Lt7BCHQHCQu17Hh4Fupz8JE GsGm2WAQ9mxxAOHMugboFlCxfoiuzfHW0c+YBGmsWg== X-Google-Smtp-Source: ABhQp+TB3tQCy15BIo2tyidyiQ87gxiw1+exL/7x8ayS/aVQ+WIGg+4NAsnIG62xmJQbCi6TWUrL/NZZ90RBvtyQTJs= X-Received: by 10.107.11.27 with SMTP id v27mr554305ioi.179.1509554492090; Wed, 01 Nov 2017 09:41:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.167.208 with HTTP; Wed, 1 Nov 2017 09:41:31 -0700 (PDT) In-Reply-To: <20171101035043.grt6awwoawl5b4mk@bivouac.eciton.net> References: <1509422375-20198-1-git-send-email-mw@semihalf.com> <1509422375-20198-6-git-send-email-mw@semihalf.com> <20171101035043.grt6awwoawl5b4mk@bivouac.eciton.net> From: Marcin Wojtas Date: Wed, 1 Nov 2017 17:41:31 +0100 Message-ID: To: Leif Lindholm Cc: edk2-devel-01 , Ard Biesheuvel , nadavh@marvell.com, Neta Zur Hershkovits , Kostya Porotchkin , Hua Jing , semihalf-dabros-jan Subject: Re: [platforms: PATCH 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: , X-List-Received-Date: Wed, 01 Nov 2017 16:37:40 -0000 Content-Type: text/plain; charset="UTF-8" 2017-11-01 4:50 GMT+01:00 Leif Lindholm : > On Tue, Oct 31, 2017 at 04:59:34AM +0100, Marcin Wojtas wrote: >> 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 | 4 ++++ >> 2 files changed, 9 insertions(+) >> >> diff --git a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c b/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c >> index 703994c..a00fc305 100755 >> --- a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c >> +++ b/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c >> @@ -150,6 +150,11 @@ SpiFlashCmdBankaddrWrite ( >> { >> UINT8 Cmd = CMD_BANK_WRITE; >> >> + /* Update bank selection command for Spansion */ >> + if (Slave->Info->Id[0] == SPI_FLASH_MFR_SPANSION) { >> + Cmd = CMD_BANKADDR_BRWR; >> + } >> + >> MvSpiFlashWriteCommon (Slave, &Cmd, 1, &BankSel, 1); >> } >> >> diff --git a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.h b/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.h >> index 2583484..00af188 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 DAMAGE. >> #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 >> @@ -72,6 +73,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> >> #define SPI_FLASH_16MB_BOUN 0x1000000 >> >> +/* Manufacturer ID's */ >> +#define SPI_FLASH_MFR_SPANSION 0x01 >> + > > Please move this definition to NorFlashInfoLib. > Otherwise this patch looks OK. > Ok. Thanks, Marcin