diff options
author | Antonio Niño Díaz <antonio.ninodiaz@arm.com> | 2018-11-01 12:45:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-01 12:45:32 +0100 |
commit | 3d7ae0b9d6d1403baa96bc8e8482f66c882f0b8b (patch) | |
tree | 9ff56eadbbf912a952f0ebfa6b3c619cfc0a198d /include | |
parent | 6f2ad3a9fc7333347da2526d9c1807a372228355 (diff) | |
parent | 00f588bf2cc5298db67f8dde561b046998756a3f (diff) | |
download | platform_external_arm-trusted-firmware-3d7ae0b9d6d1403baa96bc8e8482f66c882f0b8b.tar.gz platform_external_arm-trusted-firmware-3d7ae0b9d6d1403baa96bc8e8482f66c882f0b8b.tar.bz2 platform_external_arm-trusted-firmware-3d7ae0b9d6d1403baa96bc8e8482f66c882f0b8b.zip |
Merge pull request #1657 from antonio-nino-diaz-arm/an/libfdt
libfdt: Downgrade to version 1.4.6-9
Diffstat (limited to 'include')
-rw-r--r-- | include/lib/libfdt/libfdt.h | 76 | ||||
-rw-r--r-- | include/lib/libfdt/libfdt_env.h | 1 |
2 files changed, 9 insertions, 68 deletions
diff --git a/include/lib/libfdt/libfdt.h b/include/lib/libfdt/libfdt.h index 830b77e4b..c8c00fa86 100644 --- a/include/lib/libfdt/libfdt.h +++ b/include/lib/libfdt/libfdt.h @@ -90,9 +90,8 @@ /* Error codes: codes for bad device tree blobs */ #define FDT_ERR_TRUNCATED 8 - /* FDT_ERR_TRUNCATED: FDT or a sub-block is improperly - * terminated (overflows, goes outside allowed bounds, or - * isn't properly terminated). */ + /* FDT_ERR_TRUNCATED: Structure block of the given device tree + * ends without an FDT_END tag. */ #define FDT_ERR_BADMAGIC 9 /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a * device tree at all - it is missing the flattened device @@ -154,29 +153,6 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset); -/* - * Alignment helpers: - * These helpers access words from a device tree blob. They're - * built to work even with unaligned pointers on platforms (ike - * ARM) that don't like unaligned loads and stores - */ - -static inline uint32_t fdt32_ld(const fdt32_t *p) -{ - fdt32_t v; - - memcpy(&v, p, sizeof(v)); - return fdt32_to_cpu(v); -} - -static inline uint64_t fdt64_ld(const fdt64_t *p) -{ - fdt64_t v; - - memcpy(&v, p, sizeof(v)); - return fdt64_to_cpu(v); -} - /**********************************************************************/ /* Traversal functions */ /**********************************************************************/ @@ -237,7 +213,7 @@ int fdt_next_subnode(const void *fdt, int offset); /* General functions */ /**********************************************************************/ #define fdt_get_header(fdt, field) \ - (fdt32_ld(&((const struct fdt_header *)(fdt))->field)) + (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field)) #define fdt_magic(fdt) (fdt_get_header(fdt, magic)) #define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize)) #define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct)) @@ -268,31 +244,18 @@ fdt_set_hdr_(size_dt_struct); #undef fdt_set_hdr_ /** - * fdt_header_size - return the size of the tree's header - * @fdt: pointer to a flattened device tree - */ -size_t fdt_header_size_(uint32_t version); -static inline size_t fdt_header_size(const void *fdt) -{ - return fdt_header_size_(fdt_version(fdt)); -} - -/** - * fdt_check_header - sanity check a device tree header - + * fdt_check_header - sanity check a device tree or possible device tree * @fdt: pointer to data which might be a flattened device tree * * fdt_check_header() checks that the given buffer contains what - * appears to be a flattened device tree, and that the header contains - * valid information (to the extent that can be determined from the - * header alone). + * appears to be a flattened device tree with sane information in its + * header. * * returns: * 0, if the buffer appears to contain a valid device tree * -FDT_ERR_BADMAGIC, * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_TRUNCATED, standard meanings, as above + * -FDT_ERR_BADSTATE, standard meanings, as above */ int fdt_check_header(const void *fdt); @@ -321,24 +284,6 @@ int fdt_move(const void *fdt, void *buf, int bufsize); /* Read-only functions */ /**********************************************************************/ -int fdt_check_full(const void *fdt, size_t bufsize); - -/** - * fdt_get_string - retrieve a string from the strings block of a device tree - * @fdt: pointer to the device tree blob - * @stroffset: offset of the string within the strings block (native endian) - * @lenp: optional pointer to return the string's length - * - * fdt_get_string() retrieves a pointer to a single string from the - * strings block of the device tree blob at fdt, and optionally also - * returns the string's length in *lenp. - * - * returns: - * a pointer to the string, on success - * NULL, if stroffset is out of bounds, or doesn't point to a valid string - */ -const char *fdt_get_string(const void *fdt, int stroffset, int *lenp); - /** * fdt_string - retrieve a string from the strings block of a device tree * @fdt: pointer to the device tree blob @@ -349,7 +294,7 @@ const char *fdt_get_string(const void *fdt, int stroffset, int *lenp); * * returns: * a pointer to the string, on success - * NULL, if stroffset is out of bounds, or doesn't point to a valid string + * NULL, if stroffset is out of bounds */ const char *fdt_string(const void *fdt, int stroffset); @@ -1145,7 +1090,7 @@ int fdt_address_cells(const void *fdt, int nodeoffset); * * returns: * 0 <= n < FDT_MAX_NCELLS, on success - * 2, if the node has no #size-cells property + * 2, if the node has no #address-cells property * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid * #size-cells property * -FDT_ERR_BADMAGIC, @@ -1368,13 +1313,10 @@ static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val) fdt64_t tmp = cpu_to_fdt64(val); return fdt_property(fdt, name, &tmp, sizeof(tmp)); } - -#ifndef SWIG /* Not available in Python */ static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val) { return fdt_property_u32(fdt, name, val); } -#endif /** * fdt_property_placeholder - add a new property and return a ptr to its value diff --git a/include/lib/libfdt/libfdt_env.h b/include/lib/libfdt/libfdt_env.h index eb2053845..bd2474628 100644 --- a/include/lib/libfdt/libfdt_env.h +++ b/include/lib/libfdt/libfdt_env.h @@ -56,7 +56,6 @@ #include <stdint.h> #include <stdlib.h> #include <string.h> -#include <limits.h> #ifdef __CHECKER__ #define FDT_FORCE __attribute__((force)) |