summaryrefslogtreecommitdiffstats
path: root/include/fdt.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-26 12:14:36 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-06 11:41:29 +0100
commita51d06d67900547b68cc133c0d185937cea04fee (patch)
tree91e3c4a7a4c1dd5a69fdd60d500c736b03b4ee51 /include/fdt.h
parent973e58e3abdc70f3d28c61961a4fc7b0acac0719 (diff)
downloadbarebox-a51d06d67900547b68cc133c0d185937cea04fee.tar.gz
barebox-a51d06d67900547b68cc133c0d185937cea04fee.tar.xz
of: remove unused libfdt
Now that we are completely independent of libfdt remove the unused code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/fdt.h')
-rw-r--r--include/fdt.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/fdt.h b/include/fdt.h
index 48ccfd9100..35278e3030 100644
--- a/include/fdt.h
+++ b/include/fdt.h
@@ -3,6 +3,19 @@
#ifndef __ASSEMBLY__
+#define _B(n) ((unsigned long long)((uint8_t *)&x)[n])
+
+#define fdt32_to_cpu(x) be32_to_cpu(x)
+#define cpu_to_fdt32(x) cpu_to_be32(x)
+
+static inline uint64_t fdt64_to_cpu(uint64_t x)
+{
+ return (_B(0) << 56) | (_B(1) << 48) | (_B(2) << 40) | (_B(3) << 32)
+ | (_B(4) << 24) | (_B(5) << 16) | (_B(6) << 8) | _B(7);
+}
+#define cpu_to_fdt64(x) fdt64_to_cpu(x)
+#undef _B
+
struct fdt_header {
uint32_t magic; /* magic word FDT_MAGIC */
uint32_t totalsize; /* total size of DT block */