Skip to content
  • Stefan Roese's avatar
    cmd_sf: Fix problem with "sf update" and unaligned length · ed62756d
    Stefan Roese authored
    
    
    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: default avatarStefan 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: default avatarGerlando Falauto <gerlando.falauto@keymile.com>
    Reviewed-by: default avatarJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
    ed62756d