aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/fdt_support.c2
-rw-r--r--drivers/core/ofnode.c2
-rw-r--r--include/linux/libfdt_env.h1
-rw-r--r--lib/fdtdec.c2
4 files changed, 4 insertions, 3 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index baf7924..6834399 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1566,7 +1566,7 @@ static int fdt_read_prop(const fdt32_t *prop, int prop_len, int cell_off,
uint64_t *val, int cells)
{
const fdt32_t *prop32 = &prop[cell_off];
- const fdt64_t *prop64 = (const fdt64_t *)&prop[cell_off];
+ const unaligned_fdt64_t *prop64 = (const fdt64_t *)&prop[cell_off];
if ((cell_off + cells) > prop_len)
return -FDT_ERR_NOSPACE;
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 297f0a0..8f0eab2 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -57,7 +57,7 @@ int ofnode_read_s32_default(ofnode node, const char *propname, s32 def)
int ofnode_read_u64(ofnode node, const char *propname, u64 *outp)
{
- const fdt64_t *cell;
+ const unaligned_fdt64_t *cell;
int len;
assert(ofnode_valid(node));
diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h
index e2bf79c..e49fcd7 100644
--- a/include/linux/libfdt_env.h
+++ b/include/linux/libfdt_env.h
@@ -16,6 +16,7 @@
typedef __be16 fdt16_t;
typedef __be32 fdt32_t;
typedef __be64 fdt64_t;
+typedef __be64 unaligned_fdt64_t __aligned(4);
#define fdt32_to_cpu(x) be32_to_cpu(x)
#define cpu_to_fdt32(x) cpu_to_be32(x)
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 17736ce..125d9db 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -242,7 +242,7 @@ int fdtdec_get_pci_bar32(struct udevice *dev, struct fdt_pci_addr *addr,
uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name,
uint64_t default_val)
{
- const uint64_t *cell64;
+ const unaligned_fdt64_t *cell64;
int length;
cell64 = fdt_getprop(blob, node, prop_name, &length);