]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
cmd_sf: Fix problem with "sf update" and unaligned length
authorStefan Roese <sr@denx.de>
Fri, 9 Jan 2015 13:39:22 +0000 (14:39 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:29:29 +0000 (22:29 +0200)
commit92d871c3a03dc34d112b6c041c3b350a7d819c0c
tree6608efaa9af5d27f0f31d387a5ea8609b6cace13
parent54fc3e32582c7e1dbdb38b7294d491f8c6f3557e
cmd_sf: Fix problem with "sf update" and unaligned length

On SoCFPGA, using "sf update" with an non-4byte aligned length leads
to a hangup (and reboot via watchdog). This is because of the unaligned
access in the cadence QSPI driver which is hard to prevent since the
data is written into a 4-byte wide FIFO. This patch fixes this problem
by changing the behavior of the last sector write (not sector aligned).

The new code is even simpler and copies the source data into the temp
buffer and now uses the temp buffer to write the complete sector. So
only one SPI sector write is used now instead of 2 in the old version.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Gerlando Falauto <gerlando.falauto@keymile.com>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Cc: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
common/cmd_sf.c