• David Gibson's avatar
    libfdt: Add helpers for accessing unaligned words · 6dcb8ba4
    David Gibson authored
    This adds some helpers to load (32 or 64 bit) words from an fdt blob, even
    if they're unaligned and we're on a platform that doesn't like plain
    unaligned loads and stores.  We then use the helpers in a number of places.
    There are two purposes for this:
    
    1) This makes libfdt more robust against a blob loaded at an unaligned
       address.  It's usually good practice to load a blob at a 64-bit
       alignment, but it's nice to work even then.
    
    2) Users can use these helpers to load integer values from within property
       values.  These can often be unaligned, even if the blob as a whole is
       aligned, since some property encodings have integers and strings mixed
       together without any alignment gaps.
    Signed-off-by: 's avatarDavid Gibson <david@gibson.dropbear.id.au>
    6dcb8ba4