• Fabio Estevam's avatar
    dfu: dfu_sf: Use the erase sector size for erase operations · f4c92582
    Fabio Estevam authored
    SPI NOR flashes need to erase the entire sector size and we cannot pass
    any arbitrary length for the erase operation.
    
    To illustrate the problem:
    
    Copying data from PC to DFU device
    Download    [=========================] 100%       478208 bytes
    Download done.
    state(7) = dfuMANIFEST, status(0) = No error condition is present
    state(10) = dfuERROR, status(14) = Something went wrong, but the
    device does not know what it was
    Done!
    
    In this case, the binary has 478208 bytes and the M25P32 SPI NOR
    has an erase sector of 64kB.
    
    478208  = 7 entire sectors of 64kiB + 19456 bytes.
    
    Erasing the first seven 64 kB sectors works fine, but when trying
    to erase the remainding 19456 causes problem and the board hangs.
    
    Fix the issue by always erasing with the erase sector size.
    Signed-off-by: 's avatarFabio Estevam <fabio.estevam@freescale.com>
    Acked-by: 's avatarLukasz Majewski <l.majewski@samsung.com>
    f4c92582
Name
Last commit
Last update
Licenses Loading commit data...
api Loading commit data...
arch Loading commit data...
board Loading commit data...
common Loading commit data...
configs Loading commit data...
disk Loading commit data...
doc Loading commit data...
drivers Loading commit data...
dts Loading commit data...
examples Loading commit data...
fs Loading commit data...
include Loading commit data...
lib Loading commit data...
net Loading commit data...
post Loading commit data...
scripts Loading commit data...
test Loading commit data...
tools Loading commit data...
.checkpatch.conf Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
MAKEALL Loading commit data...
Makefile Loading commit data...
README Loading commit data...
config.mk Loading commit data...
snapshot.commit Loading commit data...