summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-04-04 12:17:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-04-17 09:00:44 +0200
commit5f000f251ba269c395057528a2f100511d29ba04 (patch)
tree078968a44ffc2adb5fe2d295be2631c34e5c507d /include
parentef9bb93c2a66ecd29015aad5ba527cc986625939 (diff)
downloadbarebox-5f000f251ba269c395057528a2f100511d29ba04.tar.gz
scripts: gen-dtb-s: reference OF IMD entries automatically
We currently require IMD_OF_USED to get the DT compatible into the barebox image data meta section. As the PBL is already referencing the DT to pass it along to barebox proper, let's add a reference from the DT to the image data section to make IMD_OF_USED unnecessary. -- v1 -> v2: - use dword, to fix build for 64-bit (Sascha) - place IMD reference before STRUCT_ALIGNMENT Suggested-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230404101706.2237453-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/pointer.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/asm-generic/pointer.h b/include/asm-generic/pointer.h
new file mode 100644
index 0000000000..8b9600b029
--- /dev/null
+++ b/include/asm-generic/pointer.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __ASM_GENERIC_PTR_H___
+#define __ASM_GENERIC_PTR_H___
+
+#if __SIZEOF_POINTER__ == 8
+#ifdef __ASSEMBLY__
+#define ASM_PTR .quad
+#define ASM_SZPTR 8
+#define ASM_LGPTR 3
+#else
+#define ASM_PTR ".quad"
+#define ASM_SZPTR "8"
+#define ASM_LGPTR "3"
+#endif
+#elif __SIZEOF_POINTER__ == 4
+#ifdef __ASSEMBLY__
+#define ASM_PTR .word
+#define ASM_SZPTR 4
+#define ASM_LGPTR 2
+#else
+#define ASM_PTR ".word"
+#define ASM_SZPTR "4"
+#define ASM_LGPTR "2"
+#endif
+#else
+#error "Unexpected __SIZEOF_POINTER__"
+#endif
+
+#endif /* __ASM_GENERIC_PTR_H___ */