OSDN Git Service

lib: add iomem emulation (logic_iomem)
authorJohannes Berg <johannes.berg@intel.com>
Fri, 5 Mar 2021 12:19:52 +0000 (13:19 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 17 Jun 2021 19:44:51 +0000 (21:44 +0200)
commitca2e334232b6cd4ae5af9da2df83c009d042aefb
tree1827fb3faf57865ec599ee74e574a2bfd6a45edd
parent0bbadafdc49d11a1836e5946f517d18cceaea6c8
lib: add iomem emulation (logic_iomem)

Add IO memory emulation that uses callbacks for read/write to
the allocated regions. The callbacks can be registered by the
users using logic_iomem_alloc().

To use, an architecture must 'select LOGIC_IOMEM' in Kconfig
and then include <asm-generic/logic_io.h> into asm/io.h to get
the __raw_read*/__raw_write* functions.

Optionally, an architecture may 'select LOGIC_IOMEM_FALLBACK'
in which case non-emulated regions will 'fall back' to the
various real_* functions that must then be provided.

Cc: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
include/asm-generic/logic_io.h [new file with mode: 0644]
include/linux/logic_iomem.h [new file with mode: 0644]
lib/Kconfig
lib/Makefile
lib/logic_iomem.c [new file with mode: 0644]