[U-Boot] [EXT] Re: [PATCH 0/8] Transition of fsl qspi driver to spi-mem framework

Kuldeep Singh kuldeep.singh at nxp.com
Tue Dec 3 07:30:17 CET 2019


Hi Frieder,

> -----Original Message-----
> From: Schrempf Frieder <frieder.schrempf at kontron.de>
> Sent: Monday, December 2, 2019 5:35 PM
> To: Kuldeep Singh <kuldeep.singh at nxp.com>; u-boot at lists.denx.de
> Cc: Priyanka Jain <priyanka.jain at nxp.com>; jagan at amarulasolutions.com;
> sr at denx.de; Ashish Kumar <ashish.kumar at nxp.com>
> Subject: [EXT] Re: [PATCH 0/8] Transition of fsl qspi driver to spi-mem
> framework
> 
> Caution: EXT Email
> 
> + Ashish
> 
> Hi Kuldeep,
> 
> On 29.11.19 06:54, Kuldeep Singh wrote:
> > This entire patch series migrate freescale qspi driver to spi-mem framework.
> 
> First, thanks for working on this. I have this on my list for quite a long time, but
> struggled to find enough time to actually get it done.
> 
> >
> > Patch 1 removes the old fsl qspi driver
> 
> You shouldn't remove the old driver before the new one is in place, as this
> breaks the build in between the two patches.

I first merged the patch1 and patch2 and found that the diff output was very much less readable.
That's why I split them into 2 patches so as to make new driver changes legible.
Please let me know how shall I proceed. Shall I merge the two patches?

> 
> >
> > Patch 2 adds new qspi driver incorporating spi-mem framework which is
> > ported version of linux qspi driver. Initial port was done by Frieder.
> > Now, no more direct access to spi-nor memory is possible. Few changes
> > were introduced to prevent uboot crash such as to add complete flash
> > size to SFA1AD, SFA2AD, SFB1AD, SFB2AD based on chip select number
> > instead of 1k. Immediate effect was observed on pfe while using 1k
> > size as it access spi-nor memory directly. Using complete flash size resolves
> the crash but data read will not be valid.
> 
> Can you provide more information about the problem/crash you experience
> and the platform you are working on?

I observed crash on LS1012. Also, any access to flash direct memory above 1k will crash without this change.
By adding this, crash will be resolved but data is invalid as mentioned in patch-set.
 
> Are you referring to the same issue as Ashish in this discussion here [1]?

Yes, I had a discussion with him.
 
> There are two reasons why I'd like to avoid using the whole memory mapped
> area for AHB access.
> First, I'd like to keep the U-Boot driver as close as possible to the Linux driver.
> Second, the intention of the spi-mem layer is to abstract the flash layer and
> therefore this driver should work independently of flash type or size. 

Boot from QSPI-NAND will still not be possible. Code in bootROM is only to access QSPI-NOR.

>With your version this wouldn't be the case if you connect a flash that is bigger than the
> memory map for example.

I agree such use case can be valid for Linux but in case of Uboot, I believe access to flash size greater than 256M will not be required.
If in case there is a requirement, there is another region in CCSR space to map flash memories up to 4G.
Random crashes can be avoided by adding these changes. Please let us know your views as well.

Thanks
Kuldeep

> Thanks,
> Frieder
> 
> [1]:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.denx
> .de%2Fpipermail%2Fu-boot%2F2019-
> October%2F387788.html&data=02%7C01%7Ckuldeep.singh%40nxp.com%
> 7C5f25f29d1a2d4971c62a08d7771feb4c%7C686ea1d3bc2b4c6fa92cd99c5c30
> 1635%7C0%7C0%7C637108851370551242&sdata=OKjdpsL4BbALL3TIGh7
> EuJaVV0xC5%2FH8%2BIXoTnIowGQ%3D&reserved=0
> 
> >
> > Patch 3 removes unused config options.
> >
> > Patch 4 moves FSL_QSPI config to defconfigs instead of defining in header
> files.
> > SPI_FLASH_SPANSION is enabled while disabling SPI_FLASH_BAR.
> >
> > Patch 5 removes unused num-cs property for imx platforms
> >
> > Patch 6 enables SPI_FLASH_SPANSION for ls1012 boards. SPI_FLASH_BAR is
> > no longer required and can be removed.
> >
> > Patch 7 move SPI_FLASH_SPANSION to defconfigs instead of header files.
> > While enabling SPI_FLASH_SPANSION config, also disable SPI_FLASH_BAR at
> the same time.
> >
> > Patch 8 updates the device-tree properties treewide for layerscape
> > boards by aligning it with linux device-tree properties.
> >
> > Frieder Schrempf (1):
> >    imx: imx6sx: Remove unused 'num-cs' property
> >
> > Kuldeep Singh (7):
> >    spi: Remove old freescale qspi driver
> >    spi: Transform the FSL QuadSPI driver to use the SPI MEM API
> >    treewide: Remove unused FSL QSPI config options
> >    configs: ls1043a: Move CONFIG_FSL_QSPI to defconfig
> >    configs: ls1012a: Enable SPI_FLASH_SPANSION in defconfig
> >    configs: ls1046a: Move SPI_FLASH_SPANSION to defconfig
> >    treewide: Update fsl qspi node dt properties as per spi-mem driver
> >
> >   arch/arm/dts/fsl-ls1012a-frdm.dtsi            |    5 +-
> >   arch/arm/dts/fsl-ls1012a-qds.dtsi             |    5 +-
> >   arch/arm/dts/fsl-ls1012a-rdb.dtsi             |    5 +-
> >   arch/arm/dts/fsl-ls1012a.dtsi                 |    4 +-
> >   arch/arm/dts/fsl-ls1043a-qds.dtsi             |    5 +-
> >   arch/arm/dts/fsl-ls1043a.dtsi                 |    6 +-
> >   arch/arm/dts/fsl-ls1046a-frwy.dts             |    5 +-
> >   arch/arm/dts/fsl-ls1046a-qds.dtsi             |    5 +-
> >   arch/arm/dts/fsl-ls1046a-rdb.dts              |    5 +-
> >   arch/arm/dts/fsl-ls1046a.dtsi                 |    4 +-
> >   arch/arm/dts/fsl-ls1088a-qds.dts              |    5 +-
> >   arch/arm/dts/fsl-ls1088a-rdb.dts              |    5 +-
> >   arch/arm/dts/fsl-ls1088a.dtsi                 |    2 +-
> >   arch/arm/dts/fsl-ls2080a-qds.dts              |    5 +-
> >   arch/arm/dts/fsl-ls2080a.dtsi                 |    4 +-
> >   arch/arm/dts/fsl-ls2088a-rdb-qspi.dts         |    5 +-
> >   arch/arm/dts/imx6sx-sabreauto-u-boot.dtsi     |    2 -
> >   arch/arm/dts/imx6sx-sdb-u-boot.dtsi           |    2 -
> >   arch/arm/dts/ls1021a-twr.dtsi                 |    5 +-
> >   arch/arm/dts/ls1021a.dtsi                     |    6 +-
> >   .../include/asm/arch-fsl-layerscape/config.h  |    1 -
> >   arch/arm/include/asm/arch-ls102xa/config.h    |    1 -
> >   configs/ls1012aqds_qspi_defconfig             |    2 +-
> >   configs/ls1012aqds_tfa_defconfig              |    2 +-
> >   configs/ls1012ardb_qspi_SECURE_BOOT_defconfig |    2 +-
> >   configs/ls1012ardb_qspi_defconfig             |    2 +-
> >   configs/ls1012ardb_tfa_defconfig              |    2 +-
> >   configs/ls1043aqds_qspi_defconfig             |    2 +-
> >   configs/ls1043aqds_sdcard_qspi_defconfig      |    2 +-
> >   configs/ls1043aqds_tfa_SECURE_BOOT_defconfig  |    2 +
> >   configs/ls1043aqds_tfa_defconfig              |    2 +-
> >   configs/ls1046aqds_qspi_defconfig             |    2 +-
> >   configs/ls1046aqds_sdcard_qspi_defconfig      |    2 +-
> >   configs/ls1046aqds_tfa_SECURE_BOOT_defconfig  |    1 +
> >   configs/ls1046aqds_tfa_defconfig              |    2 +-
> >   configs/ls1046ardb_qspi_SECURE_BOOT_defconfig |    2 +-
> >   configs/ls1046ardb_qspi_defconfig             |    2 +-
> >   configs/ls1046ardb_tfa_SECURE_BOOT_defconfig  |    2 +-
> >   configs/ls1046ardb_tfa_defconfig              |    2 +-
> >   drivers/spi/fsl_qspi.c                        | 1549 ++++++-----------
> >   drivers/spi/fsl_qspi.h                        |  145 --
> >   include/configs/ls1012a_common.h              |   17 +-
> >   include/configs/ls1012afrwy.h                 |    3 -
> >   include/configs/ls1012ardb.h                  |    3 -
> >   include/configs/ls1021aiot.h                  |    6 -
> >   include/configs/ls1021aqds.h                  |   11 -
> >   include/configs/ls1021atwr.h                  |   10 -
> >   include/configs/ls1043aqds.h                  |   10 -
> >   include/configs/ls1046afrwy.h                 |    9 -
> >   include/configs/ls1046aqds.h                  |   19 -
> >   include/configs/ls1046ardb.h                  |   20 -
> >   include/configs/ls1088a_common.h              |    6 -
> >   include/configs/ls1088aqds.h                  |    8 -
> >   include/configs/ls1088ardb.h                  |   18 -
> >   include/configs/ls2080aqds.h                  |    2 -
> >   include/configs/ls2080ardb.h                  |    8 +-
> >   include/configs/mx6sxsabreauto.h              |    6 -
> >   include/configs/mx6sxsabresd.h                |   11 -
> >   include/configs/mx6ul_14x14_evk.h             |    6 -
> >   include/configs/mx6ullevk.h                   |    6 -
> >   include/configs/mx7dsabresd.h                 |    8 -
> >   include/configs/pcm052.h                      |    7 -
> >   include/configs/vf610twr.h                    |    8 -
> >   scripts/config_whitelist.txt                  |    5 -
> >   64 files changed, 632 insertions(+), 1394 deletions(-)
> >   delete mode 100644 drivers/spi/fsl_qspi.h
> >


More information about the U-Boot mailing list