• Po-Yu Chuang's avatar
    issue write command to base for JEDEC flash · b4db4a76
    Po-Yu Chuang authored
    
    
    For JEDEC flash, we should issue word programming command relative to
    base address rather than sector base address. Original source makes
    SST Flash fails to program sectors which are not on the 0x10000 boundaries.
    
    e.g.
    SST39LF040 uses addr1=0x5555 and addr2=0x2AAA, however, each sector
    is 0x1000 bytes.
    
    Thus, if we issue command to "sector base (0x41000) + offset(0x5555)",
    it sends to 0x46555 and the chip fails to recognize that address.
    
    This patch is tested with SST39LF040.
    Signed-off-by: default avatarPo-Yu Chuang <ratbert@faraday-tech.com>
    Signed-off-by: default avatarStefan Roese <sr@denx.de>
    b4db4a76
cfi_flash.c 55.2 KB