sandbox: Enable PHYS_64BIT for 64-bit builds

Sandbox is special in that we use the bitness of the host. This should
extend to PHYS_64BIT as well, so enable this option when building on a
64-bit host.

Update the conditions in io.h so that 64-bit access is available.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-05-01 05:12:32 -06:00
parent c1e17b10d7
commit ba34b61dcb
2 changed files with 3 additions and 2 deletions

View File

@@ -448,6 +448,7 @@ endif # EXPERT
config PHYS_64BIT
bool "64bit physical address support"
select FDT_64BIT
default y if HOST_64BIT
help
Say Y here to support 64bit physical memory address.
This can be used not only for 64bit SoCs, but also for

View File

@@ -39,13 +39,13 @@ void sandbox_write(void *addr, unsigned int val, enum sandboxio_size_t size);
#define readb(addr) sandbox_read((const void *)addr, SB_SIZE_8)
#define readw(addr) sandbox_read((const void *)addr, SB_SIZE_16)
#define readl(addr) sandbox_read((const void *)addr, SB_SIZE_32)
#ifdef CONFIG_SANDBOX64
#ifdef CONFIG_HOST_64BIT
#define readq(addr) sandbox_read((const void *)addr, SB_SIZE_64)
#endif
#define writeb(v, addr) sandbox_write((void *)addr, v, SB_SIZE_8)
#define writew(v, addr) sandbox_write((void *)addr, v, SB_SIZE_16)
#define writel(v, addr) sandbox_write((void *)addr, v, SB_SIZE_32)
#ifdef CONFIG_SANDBOX64
#ifdef CONFIG_HOST_64BIT
#define writeq(v, addr) sandbox_write((void *)addr, v, SB_SIZE_64)
#endif