summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/include/asm
diff options
context:
space:
mode:
authorMario Six <six@gdsys.cc>2018-02-12 08:05:57 +0100
committerSimon Glass <sjg@chromium.org>2018-02-18 15:53:48 -0700
commitc6b89f31806df06a5d7b688a65f9d2e6e6119a55 (patch)
treec672045c9190eba8774a37aa2e14b0e6102bb12e /arch/sandbox/include/asm
parent995b60b5937133639500d89a01da0d88af3cff15 (diff)
downloadu-boot-c6b89f31806df06a5d7b688a65f9d2e6e6119a55.tar.gz
u-boot-c6b89f31806df06a5d7b688a65f9d2e6e6119a55.tar.xz
u-boot-c6b89f31806df06a5d7b688a65f9d2e6e6119a55.zip
sandbox: Add 64-bit sandbox
To debug device tree issues involving 32- and 64-bit platforms, it is useful to have a generic 64-bit platform available. Add a version of the sandbox that uses 64-bit integers for its physical addresses as well as a modified device tree. Signed-off-by: Mario Six <mario.six@gdsys.cc> Added CONFIG_SYS_TEXT_BASE to configs/sandbox64_defconfig Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/include/asm')
-rw-r--r--arch/sandbox/include/asm/io.h6
-rw-r--r--arch/sandbox/include/asm/types.h17
2 files changed, 19 insertions, 4 deletions
diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
index d3e8b969d6..1a0a772adc 100644
--- a/arch/sandbox/include/asm/io.h
+++ b/arch/sandbox/include/asm/io.h
@@ -43,9 +43,15 @@ phys_addr_t map_to_sysmem(const void *ptr);
#define readb(addr) ((void)addr, 0)
#define readw(addr) ((void)addr, 0)
#define readl(addr) ((void)addr, 0)
+#ifdef CONFIG_SANDBOX64
+#define readq(addr) ((void)addr, 0)
+#endif
#define writeb(v, addr) ((void)addr)
#define writew(v, addr) ((void)addr)
#define writel(v, addr) ((void)addr)
+#ifdef CONFIG_SANDBOX64
+#define writeq(v, addr) ((void)addr)
+#endif
/*
* Clear and set bits in one shot. These macros can be used to clear and
diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h
index 623cdafefa..6657f3a7b9 100644
--- a/arch/sandbox/include/asm/types.h
+++ b/arch/sandbox/include/asm/types.h
@@ -51,14 +51,23 @@ typedef __UINT64_TYPE__ u64;
#endif
/*
- * Number of bits in a C 'long' on this architecture. Set this to 32 when
- * building on a 32-bit machine.
+ * Number of bits in a C 'long' on this architecture.
*/
-#define BITS_PER_LONG 32
-
+#ifdef CONFIG_PHYS64
+#define BITS_PER_LONG 64
+#else /* CONFIG_PHYS64 */
+#define BITS_PER_LONG 32
+#endif /* CONFIG_PHYS64 */
+
+#ifdef CONFIG_PHYS64
+typedef unsigned long long dma_addr_t;
+typedef u64 phys_addr_t;
+typedef u64 phys_size_t;
+#else /* CONFIG_PHYS64 */
typedef unsigned long dma_addr_t;
typedef u32 phys_addr_t;
typedef u32 phys_size_t;
+#endif /* CONFIG_PHYS64 */
#endif /* __KERNEL__ */