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>
diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
index d3e8b96..1a0a772 100644
--- a/arch/sandbox/include/asm/io.h
+++ b/arch/sandbox/include/asm/io.h
@@ -43,9 +43,15 @@
 #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 623cdaf..6657f3a 100644
--- a/arch/sandbox/include/asm/types.h
+++ b/arch/sandbox/include/asm/types.h
@@ -51,14 +51,23 @@
 #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__ */