[U-Boot] [PATCH v6 00/76] mtd: Add SPI-NOR core support

york sun york.sun at nxp.com
Fri Feb 26 21:44:19 CET 2016


On 02/22/2016 10:18 AM, Jagan Teki wrote:
> Hi York,
> 
> On 15 February 2016 at 02:16, Jagan Teki <jteki at openedev.com> wrote:
>> Compared to previous patch series this series adds spi-nor
>> core with spi-nor controller drivers are of "mtd uclass"
>>
>> This is whole series for all spi-nor related changes, and while
>> series tested on spansion spi-nor chip.
>>
>> Know issue:
>> - arch/x86/lib/mrccache.c uses dm_spi_flash_ops, this need to fix.
>>
>> Why this framework:
>>
>> Some of the SPI device drivers at drivers/spi not a real
>> spi controllers, Unlike normal/generic SPI controllers they
>> operates only with SPI-NOR flash devices. these were technically
>> termed as SPI-NOR controllers, Ex: drivers/spi/fsl_qspi.c
>>
>> The problem with these were resides at drivers/spi is entire
>> SPI layer becomes SPI-NOR flash oriented which is absolutely
>> a wrong indication where SPI layer getting effected more with
>> flash operations - So this SPI-NOR core will resolve this issue
>> by separating all SPI-NOR flash operations from spi layer and
>> creats a generic layer called SPI-NOR core which can be used to
>> interact SPI-NOR to SPI driver interface layer and the SPI-NOR
>> controller driver. The idea is taken from Linux spi-nor framework.
>>
>> Before SPI-NOR:
>>
>> -----------------------
>>         cmd/sf.c
>> -----------------------
>>         spi_flash.c
>> -----------------------
>>         sf_probe.c
>> -----------------------
>>         spi-uclass
>> -----------------------
>>         spi drivers
>> -----------------------
>>         SPI NOR chip
>> -----------------------
>>
>> After SPI-NOR:
>>
>> ------------------------------
>>         cmd/sf.c
>> ------------------------------
>>         spi-nor.c
>> -------------------------------
>> m25p80.c        spi nor drivers
>> -------------------------------
>> spi-uclass      SPI NOR chip
>> -------------------------------
>> spi drivers
>> -------------------------------
>> SPI NOR chip
>> -------------------------------
>>
>> SPI-NOR with MTD:
>>
>> ------------------------------
>>         cmd/sf.c
>> ------------------------------
>>         MTD core
>> ------------------------------
>>         spi-nor.c
>> -------------------------------
>> m25p80.c        spi nor drivers
>> -------------------------------
>> spi-uclass      SPI NOR chip
>> -------------------------------
>> spi drivers
>> -------------------------------
>> SPI NOR chip
>> -------------------------------
>>
>> drivers/mtd/spi-nor/spi-nor.c: spi-nor core
>> drivers/mtd/spi-nor/m25p80.c: mtd uclass driver
>> which is an interface layer b/w spi-nor core drivers/spi
>> drivers/mtd/spi-nor/fsl_qspi.c: spi-nor controller driver(mtd uclass)
>>
>> Changes for v6:
>> - Fixed git bisectable issues, with buildman.
>> - Fixed spi-nor compilation issues
>> - newly designed changes.
>>
>> Changes for v5:
>> - newly designed changes
>>
>> Testing:
>> $ git clone git://git.denx.de/u-boot-spi.git
>> $ cd u-boot-spi
>> $ git checkout -b spi-nor origin/spi-nor
>>
>> Jagan Teki (76):
>>   mtd: Add m25p80 driver
>>   mtd: Add Kconfig entry for MTD_M25P80
>>   mtd: Add SPI-NOR core support
>>   doc: device-tree-bindings: jedec,spi-nor
>>   mtd: spi-nor: Add Kconfig entry for MTD_SPI_NOR
>>   mtd: spi-nor: Add kconfig for MTD_SPI_NOR_USE_4K_SECTORS
>>   mtd: spi-nor: Add MTD support
>>   mtd: spi-nor: Add spi_nor support in m25p80
>>   mtd: spi-nor: Add dm spi-nor probing
>>   mtd: spi-nor: Add spi_flash_probe for mtd-dm-spi-nor
>>   mtd: spi-nor: Add spi_flash_free for mtd-dm-spi-nor
>>   mtd: spi-nor: m25p80: Add spi_nor support for non-dm
>>   sf: Rename erase_size to erasesize
>>   sf: Use erasesize instead of sector_size
>>   sf: Use uint64_t for flash->size
>>   spi_flash: Use mtd_info operation for SPI-NOR
>>   spi_flash: Use spi_flash_t instead of struct spi_flash
>>   mtd: spi-nor: Move spi_read_then_write to spi layer
>>   spi: Rename spi_read_then_write to spi_write_then_read
>>   mtd: spi-nor: Rename SPI_FLASH_BAR to SPI_NOR_BAR
>>   mtd: spi-nor: Add Kconfig entry for SPI_NOR_BAR
>>   mtd: spi-nor: Copy spl files from drivers/mtd/spi
>>   mtd: spi-nor: spl: Follow ascending order of include headers
>>   mtd: spi-nor: fsl_espi_spl: Use mtd_info
>>   mtd: spi-nor: spi_spl_load: Use mtd_info
>>   mtd: spi-nor: Add flash vendor Kconfig entries
>>   arm: zynq: Kconfig: Select MTD uclass
>>   arm: zynq: Kconfig: Drop DM_SPI_FLASH
>>   defconfigs: zynq_microzed: Drop CONFIG_SPI_FLASH
>>   defconfig: zynq_microzed: Enable CONFIG_MTD_M25P80
>>   defconfig: zynq_microzed: Enable CONFIG_MTD_SPI_NOR
>>   spl: Add CONFIG_SPL_SPI_NOR_SUPPORT
>>   configs: zynq: Use CONFIG_SPL_SPI_NOR_SUPPORT
>>   configs: zynq: Use CONFIG_SPL_MTD_SUPPORT
>>   mtd: spi-nor: Copy sf_dataflash
>>   mtd: dataflash: Remove unneeded spi data
>>   mtd: dataflash: Move flash id detection into jedec_probe
>>   mtd: dataflash: Fix add_dataflash return logic
>>   mtd: dataflash: Add UCLASS_MTD support
>>   mtd: dataflash: Use spi_write_then_read
>>   mtd: dataflash: Drop sf_internal.h
>>   mtd: dataflash: Minor cleanups
>>   mtd: Rename sf_dataflash.c to mtd_dataflash.c
>>   mtd: spi-nor: Add Kconfig entry for mtd_dataflash
>>   mtd: dataflash: Add MTD_DATAFLASH_WRITE_VERIFY
>>   mtd: spi-nor: Add kconfig MTD_DATAFLASH_WRITE_VERIFY
>>   configs: ls1021aqds: Drop DM_SPI_FLASH and DATAFLASH
>>   defconfig: ls1021aqds_qspi: Enable SPI-NOR
>>   defconfig: ls1021aqds_qspi: Enable CONFIG_MTD_DATAFLASH
> 
> Can you pls- test the dataflash changes? use u-boot-spi/spi-nor
> 
Jagan,

I am getting there. Will test sf probe/read/write and probably boot on selected
platforms. Is there any specific platform/test in your mind?

York



More information about the U-Boot mailing list