public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Problem with sf write on Arria 5.
@ 2016-03-30 11:14 Bakhvalov, Denis
  2016-03-30 12:46 ` Marek Vasut
  0 siblings, 1 reply; 12+ messages in thread
From: Bakhvalov, Denis @ 2016-03-30 11:14 UTC (permalink / raw)
  To: u-boot

Dear U-Boot support,

I'm migrating to new U-Boot version from 2013 and now have problem with writing to the flash.

I have custom board with Altera Arria 5 SocFpga.
U-Boot version: 2016.03-rc1
My flash:
SF: Detected S25FL512S_256K with page size 512 Bytes, erase size 256 KiB, total 64 MiB

I'm rewriting the flash with the image that I downloaded from tftp.
#> tftp 0x1B000000 flash.bin
Then I'm trying to write it to the flash:
#> sf erase ...
#> sf write ...
After that if I try to mount Ubi partition (this is read operation) I receive failures (usually checksum errors).
So, the problem is that when I'm writing some data to flash and reading it back the data is corrupted.
I'm almost sure that there is no issue with reading, because previously I was able to read big amount of data successfully (for example, reading OS image and booting it).

With previous version (2013) there is no such issue.
With the same sequence of commands I was able to update entire flash.

I was able to reduce this problem to a smaller one.
I'm checking consistency of write operation by writing zipped file (3 KB):
#> tftp 0x1B000000 file.zip
#> sf erase <flash_addr> <flash_offset>
#> sf write <mem_addr1> <flash_addr> <flash_offset>
#> sf read <mem_addr2> <flash_addr> <flash_offset>
#> unzip <mem_addr2> <mem_addr3>

And sometimes I can see:
Uncompressed size: 524288 = 0x80000 (success)
but more often:
Error: inflate() returned -3 (data was corrupted)

So, the problem appears to be occasional.

When I'm comparing the original data with the data that I've read from flash I can see the blocks of 256 bytes were not written (0xffffffff).
For example:
Original data:
1b000200: c62e214e 0e48a4c9 19038ec8 37531cfd    N!....H.......S7
1b000210: 8f1c7048 f60b861f e9482d5c 857404e8    Hp......\-H...t.
1b000220: ef3996c1 fd02b093 2ee8d1f6 679ab03d    ..9.........=..g
1b000230: e6c739f4 194eaec7 383ddca8 6f90a2ad    .9....N...=8...o
... and so on until (1b000300)
Stored data:
1f000200: ffffffff ffffffff ffffffff ffffffff    ................
1f000210: ffffffff ffffffff ffffffff ffffffff    ................
1f000220: ffffffff ffffffff ffffffff ffffffff    ................
1f000230: ffffffff ffffffff ffffffff ffffffff    ................
... and so on until (1f000300)

I already checked difference in QSPI registers (base address: 0xFF705000) between two versions of U-Boot, but haven't found any clue yet.
If needed I can provide this diff.

All hints are welcome.

Best regards,
Denis Bakhvalov

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-04-08 23:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30 11:14 [U-Boot] Problem with sf write on Arria 5 Bakhvalov, Denis
2016-03-30 12:46 ` Marek Vasut
2016-03-30 13:46   ` Bakhvalov, Denis
2016-03-30 13:57     ` Chin Liang See
2016-03-30 13:58     ` Marek Vasut
2016-04-05 22:04     ` Marek Vasut
2016-04-07  7:32       ` Bakhvalov, Denis
2016-04-07 10:57         ` Marek Vasut
2016-04-07 12:05           ` Bakhvalov, Denis
2016-04-07 12:21             ` Marek Vasut
2016-04-08 23:07               ` Bakhvalov, Denis
2016-04-08 23:13                 ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox