Re: [U-Boot] [PATCH v10 20/27] mtd: spi-nor: Add 4-byte addresswidth support

2017-12-28 Thread Cyrille Pitchen
Le 28/12/2017 à 09:06, Cyrille Pitchen a écrit : > Hi Jagan, > > Le 28/12/2017 à 07:12, Jagan Teki a écrit : >> Add 4-byte address supports, so-that SPI-NOR chips >> has > 16MiB should accessible. >> >> Signed-off-by: Jagan Teki >> --- >> drivers/

Re: [U-Boot] [PATCH v10 20/27] mtd: spi-nor: Add 4-byte addresswidth support

2017-12-28 Thread Cyrille Pitchen
Hi Jagan, Le 28/12/2017 à 07:12, Jagan Teki a écrit : > Add 4-byte address supports, so-that SPI-NOR chips > has > 16MiB should accessible. > > Signed-off-by: Jagan Teki > --- > drivers/mtd/spi-nor/m25p80.c | 1 + > drivers/mtd/spi-nor/spi-nor.c | 38 ++ >

Re: [U-Boot] [PATCH 3/3] sf: parse Serial Flash Discoverable Parameters (SFDP) tables

2017-12-20 Thread Cyrille Pitchen
spi-nor: parse Serial Flash > Discoverable Parameters (SFDP) tables". It Also ports all modifications > done on top of the mentioned commit. > > This feature is enabled by defining FLASH_SFDP in spi_flash_info's flag > field. > > Signed-off-by: Prabhakar Kushwaha >

Re: [U-Boot] [PATCH 2/3] sf: add method to support memory size above 128Mib

2017-12-20 Thread Cyrille Pitchen
e into 4byte opcode based upon > OPCODES_4B or Spansion flash. Also the commands are malloc'ed > at run time based on 3byte or 4byte address opcode requirement. > > Signed-off-by: Prabhakar Kushwaha > CC: Cyrille Pitchen > CC: Marek Vasut > CC: Vignesh R > --- &g

[U-Boot] [PATCH 8/8] sf: add driver for Atmel QSPI controller

2017-05-19 Thread Cyrille Pitchen
This patch adds support to the Atmel Quad SPI controller. Signed-off-by: Cyrille Pitchen --- drivers/spi/Kconfig | 7 + drivers/spi/Makefile | 1 + drivers/spi/atmel_qspi.c | 404 +++ drivers/spi/atmel_qspi.h | 169 4

[U-Boot] [PATCH 3/8] sf: select the relevant SPI flash protocol for read and write commands

2017-05-19 Thread Cyrille Pitchen
or Fast Read operations and flash->write_proto for Page Program operations. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/spi_flash.c | 24 include/spi_flash.h | 4 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/spi/spi

[U-Boot] [PATCH 4/8] sf: differentiate Page Program 1-1-4 and 1-4-4

2017-05-19 Thread Cyrille Pitchen
This patch simply renames the ambiguous CMD_QUAD_PAGE_PROGRAM macro into the more explicit CMD_PAGE_PROGRAM_1_1_4. Also it defines the CMD_PAGE_PROGRAM_1_4_4 macro to the standard 38h op code. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 3 ++- drivers/mtd/spi/spi_flash.c

[U-Boot] [PATCH 7/8] sf: add support to Microchip SST26 QSPI memories

2017-05-19 Thread Cyrille Pitchen
code cannot be used as currently done by the SPI FLASH sub-system. The 4K Sector Erase (20h) op code should be chosen instead even if CONFIG_SPI_FLASH_USE_4K_SECTORS is not set. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 3 +++ drivers/mtd/spi/spi_flash.c | 33

[U-Boot] [PATCH 5/8] sf: add 'addr_len' member to 'struct spi_flash'

2017-05-19 Thread Cyrille Pitchen
This is a transitional patch to prepare the SPI FLASH sub-system to support the 4-byte address instruction set later. For now, flash->addr_len is always set to SPI_FLASH_3B_ADDR_LEN. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/spi_flash.c | 13 - include/spi_flas

[U-Boot] [PATCH 6/8] sf: add new option to support SPI flash above 16MiB

2017-05-19 Thread Cyrille Pitchen
a spirious reboot occurs, early boot loaders can still access data from offset 0. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/Kconfig | 15 ++- drivers/mtd/spi/sf_internal.h | 18 + drivers/mtd/spi/spi_flash.c | 92 --- 3 files

[U-Boot] [PATCH 2/8] sf: describe all SPI flash commands with 'struct spi_flash_command'

2017-05-19 Thread Cyrille Pitchen
Now that the SPI sub-system API has been extended with 'struct spi_flash_command' and spi_is_flash_command_supported() / spi_exec_flash_command() functions, we update the SPI FLASH sub-system to use this new API. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf.c

[U-Boot] [PATCH 1/8] spi: add support of SPI flash commands

2017-05-19 Thread Cyrille Pitchen
hardware controller uses its "memory like" area mapped ino the system to perform not only (Fast) Read operations but actually all other types of flash commands. Hence the regular SPI API based on the spi_xfer() function is not suited to support the Atmel QSPI controller. Signed-off-by:

[U-Boot] [PATCH 0/8] sf: improve support of (Q)SPI flash memories

2017-05-19 Thread Cyrille Pitchen
rite at offset 0: OK <- I didn't try offset other than 0. During my tests, I used: - setenv/saveenv, reboot, printenv or - sf probe, sf read, sf write Best regards, Cyrille Cyrille Pitchen (8): spi: add support of SPI flash commands sf: describe all SPI flash commands with &#x

Re: [U-Boot] [PATCH 00/18] sf: fix support of QSPI memories and controllers

2016-03-21 Thread Cyrille Pitchen
Hi Jagan, Le 21/03/2016 10:07, Jagan Teki a écrit : > Hi Cyrille, > > On 18 March 2016 at 20:48, Cyrille Pitchen wrote: >> Hi Stefan, >> >> Le 18/03/2016 14:48, Stefan Roese a écrit : >>> Hi All, >>> >>> please excuse the late reply to this

[U-Boot] [PATCH 14/18 v2] sf: add 4byte address opcodes

2016-03-21 Thread Cyrille Pitchen
those boot loader will fail to read the right data. Using 4byte address opcodes doesn't change the internal state of the SPI flash memory but sill allows to access data above 16MiB. Signed-off-by: Cyrille Pitchen --- ChangeLog: v1 -> v2: - add missing entry for PAGE PROGRAM op code d

[U-Boot] [PATCH 14/18 v2] sf: add 4byte address opcodes

2016-03-21 Thread Cyrille Pitchen
those boot loader will fail to read the right data. Using 4byte address opcodes doesn't change the internal state of the SPI flash memory but sill allows to access data above 16MiB. Signed-off-by: Cyrille Pitchen --- ChangeLog: v1 -> v2: - add missing entry for PAGE PROGRAM op code d

Re: [U-Boot] [PATCH 00/18] sf: fix support of QSPI memories and controllers

2016-03-19 Thread Cyrille Pitchen
Le 16/03/2016 15:14, Jagan Teki a écrit : > On Wednesday 16 March 2016 07:00 PM, Cyrille Pitchen wrote: >> Le 15/03/2016 19:21, Jagan Teki a écrit : >>> On Tuesday 15 March 2016 11:42 PM, Cyrille Pitchen wrote: >>>> Hi all, >>>> >>>> This

[U-Boot] [PATCH 1/4] rework board config files

2016-03-19 Thread Cyrille Pitchen
--- board/atmel/sama5d2_xplained/Kconfig| 14 ++ board/atmel/sama5d2_xplained/sama5d2_xplained.c | 14 +- drivers/mmc/Kconfig | 6 ++ include/configs/at91-sama5_common.h | 10 ++ include/configs/sama5d2_xplain

[U-Boot] [PATCH 4/4] sf: fix sf probe

2016-03-19 Thread Cyrille Pitchen
odes. Signed-off-by: Cyrille Pitchen --- cmd/sf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/sf.c b/cmd/sf.c index 42862d9d921a..5a666bbe9491 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -123,7 +123,6 @@ static int do_spi_flash_probe(int argc, char * const argv[]) ret = spi_fin

[U-Boot] [PATCH 2/4] sama5d2_xplained: add support of QSPI controllers

2016-03-19 Thread Cyrille Pitchen
Signed-off-by: Cyrille Pitchen --- board/atmel/sama5d2_xplained/Kconfig| 6 ++ board/atmel/sama5d2_xplained/sama5d2_xplained.c | 18 ++ 2 files changed, 24 insertions(+) diff --git a/board/atmel/sama5d2_xplained/Kconfig b/board/atmel/sama5d2_xplained/Kconfig

Re: [U-Boot] [PATCH 00/18] sf: fix support of QSPI memories and controllers

2016-03-18 Thread Cyrille Pitchen
Le 15/03/2016 19:21, Jagan Teki a écrit : > On Tuesday 15 March 2016 11:42 PM, Cyrille Pitchen wrote: >> Hi all, >> >> This series of patches fixes and extend the support of QSPI memories >> in the SPI flash framework. The updates are split into many parts to >>

[U-Boot] [PATCH 3/4] dts: add dts file for Atmel sama5d2 xplained board

2016-03-18 Thread Cyrille Pitchen
Signed-off-by: Cyrille Pitchen --- arch/arm/dts/Makefile | 3 +++ arch/arm/dts/at91-sama5d2_xplained.dts | 33 + arch/arm/dts/sama5d2.dtsi | 19 +++ 3 files changed, 55 insertions(+) create mode 100644 arch/arm/dts

Re: [U-Boot] [PATCH 00/18] sf: fix support of QSPI memories and controllers

2016-03-18 Thread Cyrille Pitchen
p the > overall boot process. This is on SoCFPGA btw. > > Please allow me a few comments below. > > On 16.03.2016 15:14, Jagan Teki wrote: >> On Wednesday 16 March 2016 07:00 PM, Cyrille Pitchen wrote: >>> Le 15/03/2016 19:21, Jagan Teki a écrit : >>>> On T

[U-Boot] [PATCH 02/18] sf: call spi_claim_bus() and spi_release_bus() only once per read, write or erase

2016-03-15 Thread Cyrille Pitchen
There is no need to claim/release the SPI bus for each command sent to the memory when performing read, write or erase operations. Now we claim the SPI bus once for all at the very beginning of these operations then we release it just before exiting. Signed-off-by: Cyrille Pitchen --- drivers

[U-Boot] [PATCH 10/18] sf: move support of SST flash into generic spi_flash_write_alg()

2016-03-15 Thread Cyrille Pitchen
This patch makes the support of SST flashes available to all UCLASS_SPI_FLASH drivers, not only the sf_probe.c one. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 8 ++--- drivers/mtd/spi/sf_probe.c| 9 - drivers/mtd/spi/spi_flash.c | 76

[U-Boot] [PATCH 08/18] sf: share read generic algorithm

2016-03-15 Thread Cyrille Pitchen
apper. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 4 drivers/mtd/spi/spi_flash.c | 48 --- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h

[U-Boot] [PATCH 03/18] sf: replace spi_flash_read_common() calls by spi_flash_cmd_read()

2016-03-15 Thread Cyrille Pitchen
Since spi_claim_bus() and spi_release_bus() are now called outside spi_flash_read_common(), this latest function is just a useless alias for spi_flash_cmd_read(). So we remove it. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 6 -- drivers/mtd/spi/spi_flash.c | 30

[U-Boot] [PATCH 11/18] sf: fix selection of supported READ commands for QSPI memories

2016-03-15 Thread Cyrille Pitchen
slave since they are set according DT properties shared with Linux: spi-tx-bus-width and spi-rx-bus-width. These two DT properties don't allow us to make the difference between the SPI 1-4-4 and SPI 4-4-4 protocols. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_inter

[U-Boot] [PATCH 01/18] Revert "sf: Fix quad bit set for micron devices"

2016-03-15 Thread Cyrille Pitchen
d when the spi_flash_cmd_write() function completes, the later call of the spi_flash_cmd_wait_ready() function fails. Indeed the SPI controller driver is not aware of the SPI protocol switch. Further patches will fix the support of Micron QSPI memories. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_

[U-Boot] [PATCH 04/18] sf: remove spi_flash_write_common()

2016-03-15 Thread Cyrille Pitchen
This patch prepares the split of memory versus internal registers SPI commands. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 8 +++--- drivers/mtd/spi/spi_flash.c | 62 ++- 2 files changed, 42 insertions(+), 28 deletions(-) diff

[U-Boot] [PATCH 05/18] sf: export spi_flash_wait_ready() function

2016-03-15 Thread Cyrille Pitchen
This patch exports a new function so future drivers can use it. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 3 +++ drivers/mtd/spi/spi_flash.c | 7 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi

[U-Boot] [PATCH 07/18] sf: share write generic algorithm

2016-03-15 Thread Cyrille Pitchen
write() wrapper. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 5 + drivers/mtd/spi/spi_flash.c | 34 -- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index 3c6bac3

[U-Boot] [PATCH 00/18] sf: fix support of QSPI memories and controllers

2016-03-15 Thread Cyrille Pitchen
n25q128a memory. Best regards, Cyrille Cyrille Pitchen (18): Revert "sf: Fix quad bit set for micron devices" sf: call spi_claim_bus() and spi_release_bus() only once per read, write or erase sf: replace spi_flash_read_common() calls by spi_flash_cmd_read()

[U-Boot] [PATCH 06/18] sf: share erase generic algorithm

2016-03-15 Thread Cyrille Pitchen
ate a spi_flash_erase() wrapper. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 4 drivers/mtd/spi/spi_flash.c | 28 +++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h

[U-Boot] [PATCH 16/18] sf: fix support of Micron memories

2016-03-15 Thread Cyrille Pitchen
This patch provides support of Micron QSPI memories. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/Makefile | 1 + drivers/mtd/spi/sf_internal.h | 24 + drivers/mtd/spi/sf_micron.c | 222 ++ drivers/mtd/spi/spi_flash.c | 13 +-- 4

[U-Boot] [PATCH 15/18] sf: prepare next fixes to support of QSPI memories by manufacturer

2016-03-15 Thread Cyrille Pitchen
ation. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/spi_flash.c | 155 1 file changed, 99 insertions(+), 56 deletions(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index b4a44e25f190..50250491d228 100644 --- a/drivers/mt

[U-Boot] [PATCH 13/18] sf: add helper function to set the number of dummy bytes

2016-03-15 Thread Cyrille Pitchen
other drivers. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 6 ++ drivers/mtd/spi/spi_flash.c | 11 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index 26d359707d5b..86a0276f8518 100644 --- a

[U-Boot] [PATCH 14/18] sf: add 4byte address opcodes

2016-03-15 Thread Cyrille Pitchen
those boot loader will fail to read the right data. Using 4byte address opcodes doesn't change the internal state of the SPI flash memory but sill allows to access data above 16MiB. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/Kconfig | 18 - drivers/mtd/spi/sf_inte

[U-Boot] [PATCH 12/18] sf: fix detection of QSPI memories when they boot in Quad or Dual mode

2016-03-15 Thread Cyrille Pitchen
Read ID (0x9f) command but not the JEDEC Read ID Multiple I/O (0x9f) command. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/sf_internal.h | 1 + drivers/mtd/spi/spi_flash.c | 90 +-- include/spi_flash.h | 45 ++ 3 files

[U-Boot] [PATCH 09/18] sf: add hooks to handle register read and write operations

2016-03-15 Thread Cyrille Pitchen
used by the spi-nor.c driver in Linux: - read_reg: read out the register - write_reg: write data to the register - read: read data from the SPI flash - write: write data into the SPI flash - erase: erase sectors of the SPI flash Signed-off-by: Cyrille Pitchen --- drivers/mtd

[U-Boot] [PATCH 18/18] sf: add driver for Atmel QSPI controller

2016-03-15 Thread Cyrille Pitchen
This patch adds support of the Atmel QSPI controller. Signed-off-by: Cyrille Pitchen --- drivers/mtd/spi/Makefile | 1 + drivers/mtd/spi/atmel_qspi_flash.c | 432 + drivers/spi/Kconfig| 9 + drivers/spi/Makefile

[U-Boot] [PATCH 17/18] ARM: at91: clock: add function to get QSPI clocks

2016-03-15 Thread Cyrille Pitchen
Add the new get_qpsi_clk_rate() function which will be needed by the future Atmel QSPI controller driver. Signed-off-by: Cyrille Pitchen --- arch/arm/mach-at91/include/mach/clk.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-at91/include/mach/clk.h b/arch/arm/mach-at91