09-25-2017 09:31 AM
There seems to be a regression between linux-xlnx v2016.4 and v2017.1 (v2017.2 has this as well).
When writing to a SPI-NOR flash connected to QSPI, both with mtdblock driver and flascp utility, the 16M border (
0x1000000) cannot be crossed. The flash is erased correctly, but after writing it is still empty (0xFF).
Interestingly, when aligning partitions to that border (i.e. MTD0 0-0x1000000, MTD1 0x1000000-...), everything work's as expected.
I'm using a custom Board with a Zynq 2010 Device and Spansion S25FL256SAG and build Linux from the xlnx-branch with buildroot. However, I use the same FSBL, same U-Boot, same Kernel configuration (regarding MTD and SPI), same FDT, even same rootfs. I only switch uImages back and forth. It works with 2016.4, it stops working with 2017.1.
CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y CONFIG_MTD_CFI=y CONFIG_MTD_GEN_PROBE=y CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y CONFIG_MTD_CFI_I1=y CONFIG_MTD_CFI_I2=y CONFIG_MTD_CFI_AMDSTD=y CONFIG_MTD_CFI_UTIL=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_PHYSMAP_OF=y CONFIG_MTD_M25P80=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
Does anyone is aware of a "breaking" change in MTD drivers between linux 4.6 and 4.9 or 2016.4 and 2017.1, respectively?
09-25-2017 10:29 AM
MTD0 0-0x1000000, is a length of 16,777,217 (0x100_0001) and not 16,777,216 (0x100_0000)
09-25-2017 10:38 AM
I've used the linux convention, that reads i.e.:
[ 2.121259] 0x000000030000-0x000000040000 : "part0" [ 2.137812] 0x000000040000-0x000000640000 : "part1" [ 2.154045] 0x000000640000-0x000000c40000 : "part2" ...
So of course the last address of that partition is 0xFF_FFFF.
09-25-2017 11:20 AM
I was able to isolate two upstream merges (linux 4.7 and 4.8), the first one still working, the second one fails:
Between them are some mtd-related commits in the linux-xlnx repo, but they should only concern NAND flash.
09-25-2017 12:00 PM
...ok, also checked with the latest commit before the merge of 4.8 - works fine.
So the issue is introduced by merging changes for 4.8 (commit 15add85f47f37fde03343fb06bb7240dc61155e6) - which unfortunately are a lot of code changes regarding mtd and spi-nor subsystem.