• David Woodhouse's avatar
    MTD: Fix RedBoot FIS table detection. · fc8cddf2
    David Woodhouse authored
    The redboot partitioning code currently searches for a FIS table entry
    named "RedBoot" (including the trailing \0) in one of the first three
    entries to try and verify that the sector it is looking at really is a
    FIS partition table.
    
    Firstly it fails when RedBoot is stored in some other Flash chip such as
    a boot PROM, in this case there is no "RedBoot" entry in the partition
    table. However there will always be a "FIS directory" entry in any valid
    FIS directory.
            
    Secondly it can fail since the RedBoot entry is not always in the first
    3 slots -- this can happen for example on an x86 based platform where
    the processor expects the boot device to be at the top of memory rather
    than the bottom and so RedBoot is at the end of the flash device.
    Equally when using "FIS directory" as the entry to search for it very
    likely is not in the first three since the directory is typically at the
    end of the flash.
    Signed-off-by: default avatarIan Campbell <icampbell@arcom.com>
    Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
    fc8cddf2
redboot.c 5.68 KB