mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
linux/io.h: add generic ioremap()/iounmap() defines
For most of architectures in U-Boot, virtual address is straight mapped to physical address. So, it makes sense to have generic defines of ioremap and friends in <linux/io.h>. All of them are just empty and will disappear at compile time, but they will be helpful to implement drivers which are counterparts of Linux ones. I notice MIPS already has its own implementation, so I added a Kconfig symbol CONFIG_HAVE_ARCH_IOREMAP which MIPS (and maybe Sandbox as well) can select. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
This commit is contained in:
parent
c74b8fcdd7
commit
9a387128e3
2 changed files with 20 additions and 0 deletions
|
@ -1,6 +1,9 @@
|
||||||
config CREATE_ARCH_SYMLINK
|
config CREATE_ARCH_SYMLINK
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config HAVE_ARCH_IOREMAP
|
||||||
|
bool
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Architecture select"
|
prompt "Architecture select"
|
||||||
default SANDBOX
|
default SANDBOX
|
||||||
|
@ -33,6 +36,7 @@ config MICROBLAZE
|
||||||
|
|
||||||
config MIPS
|
config MIPS
|
||||||
bool "MIPS architecture"
|
bool "MIPS architecture"
|
||||||
|
select HAVE_ARCH_IOREMAP
|
||||||
select HAVE_PRIVATE_LIBGCC
|
select HAVE_PRIVATE_LIBGCC
|
||||||
select SUPPORT_OF_CONTROL
|
select SUPPORT_OF_CONTROL
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,22 @@
|
||||||
#ifndef _LINUX_IO_H
|
#ifndef _LINUX_IO_H
|
||||||
#define _LINUX_IO_H
|
#define _LINUX_IO_H
|
||||||
|
|
||||||
|
#include <linux/compiler.h>
|
||||||
|
#include <linux/types.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
|
#ifndef CONFIG_HAVE_ARCH_IOREMAP
|
||||||
|
static inline void __iomem *ioremap(resource_size_t offset,
|
||||||
|
resource_size_t size)
|
||||||
|
{
|
||||||
|
return (void __iomem *)(unsigned long)offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void iounmap(void __iomem *addr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#define devm_ioremap(dev, offset, size) ioremap(offset, size)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _LINUX_IO_H */
|
#endif /* _LINUX_IO_H */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue