From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 240E721EB88C9 for ; Fri, 1 Sep 2017 08:32:10 -0700 (PDT) Received: by mail-wm0-x229.google.com with SMTP id u26so3663818wma.0 for ; Fri, 01 Sep 2017 08:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uBKPeJdyIAv5juvjqAoW9+HfffTZ03Z06oapDEHtfDg=; b=iJSkgpR5DKop3H6ww6CHKXafbUre5EA7bIY8FwDwZ+KTQgmJZ6mN/fuw/kQzvattu4 56DHm7Un7IcFzhzNTLQ0dhOKBX9pCYIf9a8E1H6mZ1ezAny71q7BU9UT5PXKs6YEJ38s e3+sf/gc8kvlDepN6eqLNGr9Iu6L0wk9F4BZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uBKPeJdyIAv5juvjqAoW9+HfffTZ03Z06oapDEHtfDg=; b=O35E/5TUHCmYkaWrPDSdznOz63NelzKSprsor7fyt1OGK9W5pTWWYrl2nH1eaq7P9j I0xsnwIJgHPYE2eaxVfQpjCfDrCiYVRUdWXoOnRlM2BKqgbgcJWHBZdKTN1AjHn39Eaz bWVBCbpPGqWWy9PWdJ+nNjvLL9LRrP6sjyythPON/00oipo51dE0z5BQpQiYmL0euQIo xDZF+BTVRKT8YZUK+V/MgJ5r9WAP0KVRU4BK4fb84xVbfi7km3PE54Nc7rXQTS9QSphP 9n4nFG4Szwd3cGPZFsQUT/VLgX9hkjUuu+iOXtosuLjZy6/nmXDlqZzsih3m3yU+HHHN EdNw== X-Gm-Message-State: AHPjjUi5GrXgJARq4bxCgFlBWnWWgaTM3tnVdvJl0Qe7DCr5pnr1t0kv uhCq+dJF5wXdTPEo X-Google-Smtp-Source: ADKCNb6L21UZc1g0wK5rQ8ADbMFdtnsj4Qr6PRJ/DwuF81DdM+EsRKNV6Cf8nTWXgpfZhQQjXLVz/Q== X-Received: by 10.28.232.82 with SMTP id f79mr650979wmh.179.1504280093303; Fri, 01 Sep 2017 08:34:53 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id t12sm376623wra.20.2017.09.01.08.34.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 08:34:52 -0700 (PDT) Date: Fri, 1 Sep 2017 16:34:50 +0100 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com, jinghua@marvell.com, agraf@suse.de, jsd@semihalf.com Message-ID: <20170901153450.2ctuu2s4pi22rvu6@bivouac.eciton.net> References: <1504271303-1782-1-git-send-email-mw@semihalf.com> <1504271303-1782-12-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1504271303-1782-12-git-send-email-mw@semihalf.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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: , X-List-Received-Date: Fri, 01 Sep 2017 15:32:10 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 01, 2017 at 03:08:23PM +0200, 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 | 1 + > 2 files changed, 6 insertions(+) > > diff --git a/Platform/Marvell/Drivers/Spi/Devices/MvSpiFlash.c b/Platform/Marvell/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 = CMD_BANK_WRITE; > > + /* Update bank selection command for Spansion */ > + if (Slave->Info->Id[0] == 0x01) { Need a #define for that 0x01. / Leif > + 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 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 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 > -- > 1.8.3.1 >