cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
m2lab
Visitor
Visitor
1,848 Views
Registered: ‎05-05-2017

QSPI Flash: Crossing 16M border during write to mtd fails (>= v2017.1)

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.

 

Kernel Configuration:

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?

 

 

0 Kudos
4 Replies
bkamen
Explorer
Explorer
1,832 Views
Registered: ‎07-17-2014

That's weird...

MTD0 0-0x1000000,  is a length of 16,777,217 (0x100_0001) and not 16,777,216  (0x100_0000)

 

 

0 Kudos
m2lab
Visitor
Visitor
1,825 Views
Registered: ‎05-05-2017

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.

0 Kudos
m2lab
Visitor
Visitor
1,817 Views
Registered: ‎05-05-2017

I was able to isolate two upstream merges (linux 4.7 and 4.8), the first one still working, the second one fails:

https://github.com/Xilinx/linux-xlnx/commit/ac26233dd7e1608c242809723917c11cedc58e50

https://github.com/Xilinx/linux-xlnx/commit/15add85f47f37fde03343fb06bb7240dc61155e6

 

Between them are some mtd-related commits in the linux-xlnx repo, but they should only concern NAND flash.

0 Kudos
m2lab
Visitor
Visitor
1,793 Views
Registered: ‎05-05-2017

...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.

0 Kudos