diff options
author | Thomas Chou <thomas@wytron.com.tw> | 2015-10-03 13:02:30 (GMT) |
---|---|---|
committer | Thomas Chou <thomas@wytron.com.tw> | 2015-10-22 23:29:11 (GMT) |
commit | 37e24499b9a65e88568c8e5fed38c5d71f306305 (patch) | |
tree | d56fb86c7176128eba4b8452d5addda067ad753a /arch/nios2/include | |
parent | ac45c9cba1e32c25e1d75f894e7707def8adfd23 (diff) | |
download | u-boot-37e24499b9a65e88568c8e5fed38c5d71f306305.tar.xz |
nios2: map physical address to uncached virtual address
Add ioremap() to map physical address to uncached virtual
address. We need this to convert the reg address from the
device tree.
The order of headers inclusion in interrupts.c is changed
because common.h will include board header that contains
IO_REGION_BASE.
In the future, the IO_REGION_BASE should be decided from
the device tree.
tree
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/nios2/include')
-rw-r--r-- | arch/nios2/include/asm/io.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index 69ab23e..b4bd20f 100644 --- a/arch/nios2/include/asm/io.h +++ b/arch/nios2/include/asm/io.h @@ -42,6 +42,11 @@ static inline phys_addr_t virt_to_phys(void * vaddr) return (phys_addr_t)(vaddr); } +static inline void *ioremap(unsigned long physaddr, unsigned long size) +{ + return (void *)(IO_REGION_BASE | physaddr); +} + extern unsigned char inb (unsigned char *port); extern unsigned short inw (unsigned short *port); extern unsigned inl (unsigned port); |