diff options
author | Tom Rini <trini@konsulko.com> | 2020-01-30 20:38:47 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-01-30 20:38:47 -0500 |
commit | 514d00e527320a96c682029f4982955700f1664b (patch) | |
tree | 760a6e20566467356db07f68862f0088be0815b7 /scripts/dtc/libfdt/libfdt.h | |
parent | e7ab1cb3f0421ad8e8435a8258790e238c623ea2 (diff) | |
parent | 018921ee79d3f30893614b3b2b63b588d8544f73 (diff) |
Merge branch '2020-01-30-master-imports'
- Assorted minor fixes
- Revert 6dcb8ba4 from upstream libfdt to restore boot-time speed on
many platforms.
Diffstat (limited to 'scripts/dtc/libfdt/libfdt.h')
-rw-r--r-- | scripts/dtc/libfdt/libfdt.h | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h index 36fadcdea5..fa63fffe28 100644 --- a/scripts/dtc/libfdt/libfdt.h +++ b/scripts/dtc/libfdt/libfdt.h @@ -117,23 +117,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) -{ - const uint8_t *bp = (const uint8_t *)p; - - return ((uint32_t)bp[0] << 24) - | ((uint32_t)bp[1] << 16) - | ((uint32_t)bp[2] << 8) - | bp[3]; -} - static inline void fdt32_st(void *property, uint32_t value) { uint8_t *bp = (uint8_t *)property; @@ -144,20 +127,6 @@ static inline void fdt32_st(void *property, uint32_t value) bp[3] = value & 0xff; } -static inline uint64_t fdt64_ld(const fdt64_t *p) -{ - const uint8_t *bp = (const uint8_t *)p; - - return ((uint64_t)bp[0] << 56) - | ((uint64_t)bp[1] << 48) - | ((uint64_t)bp[2] << 40) - | ((uint64_t)bp[3] << 32) - | ((uint64_t)bp[4] << 24) - | ((uint64_t)bp[5] << 16) - | ((uint64_t)bp[6] << 8) - | bp[7]; -} - static inline void fdt64_st(void *property, uint64_t value) { uint8_t *bp = (uint8_t *)property; @@ -232,7 +201,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)) |