From: Stefan Roese Date: Sat, 2 Mar 2019 13:33:59 +0100 Subject: [U-Boot] [PATCH] ARM: mvebu: db-88f6820-amc: enable SPI_FLASH_BAR In-Reply-To: <9b5dccc6-7fea-f9f6-112f-2d3949b9bdc0@ti.com> References: <20190302074535.14302-1-judge.packham@gmail.com> <024d77db-4456-311a-941d-d1803031ce4c@ti.com> <534795af-069c-ea7f-7030-8a49999bec0c@denx.de> <469c173a-16ee-4b72-b030-102ed2b15b9f@ti.com> <44169484-f9b4-b4b7-06f3-1ce714416c83@denx.de> <9b5dccc6-7fea-f9f6-112f-2d3949b9bdc0@ti.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02.03.19 12:53, Vignesh Raghavendra wrote: > > > On 02-Mar-19 5:02 PM, Stefan Roese wrote: > [...] >>> >>> It would be great if driver could be modified to support 3 and 4 byte >>> addressing modes. >> >> I fail to see, what really is needed to make the SPI driver support >> 3 and 4 byte addressing modes. I recently added the MT7688 SPI >> driver (mt7621_spi.c) which supports 3 and 4 byte mode and I remember >> no driver specials that I needed to implement for this feature. Its >> address mode agnostic AFAICT and just xfers a buffer of data to and >> from the SPI device. >> > > Certain SPI controllers have special HW support to support SPI flashes > and therefore need knowledge of flash specific information such as > opcode, no. of address bytes etc. More details in this blog[1] Such > controllers should ideally use spi-mem interface like [2] > I see this line in kirkwood_spi.c[3] which seems to hard code address > bytes to 3? Can't really be sure w/o looking at the datasheet of SPI > controllers. I remember working on the Marvell SPI controller for Armada XP a few years ago. This 3BYTE mode is only for the special "direct mode", that is also supported by this controller. AFAIR, we don't use this direct mode in U-Boot at all. So setting this register to 3BYTE mode should be a "no-op" right now. > [1] > https://bootlin.com/blog/spi-mem-bringing-some-consistency-to-the-spi-memory-ecosystem/ > [2] https://patchwork.ozlabs.org/patch/1039718/ > [3] > https://elixir.bootlin.com/u-boot/latest/source/drivers/spi/kirkwood_spi.c#L132 > >> Could you please let me know, what exactly is missing for this 4 byte >> mode? >> >> Thanks, >> Stefan >> Thanks, Stefan