riscv: separate MMIO functions into their own header file
authorPaul Walmsley <paul.walmsley@sifive.com>
Mon, 28 Oct 2019 20:53:50 +0000 (13:53 -0700)
committerPaul Walmsley <paul.walmsley@sifive.com>
Tue, 5 Nov 2019 17:11:18 +0000 (09:11 -0800)
commit0c3ac28931d578324e93afab6ee7b740dfdaff6f
tree39a42979a74776968705dba4eb44444e7bc9af18
parent86fe639a1c1678d81fc4c82a39a5299df6deb944
riscv: separate MMIO functions into their own header file

Separate the low-level MMIO static inline functions and macros, such
as {read,write}{b,w,l,q}(), into their own header file under
arch/riscv/include: asm/mmio.h.  This is done to break a header
dependency chain that arises when both asm/pgtable.h and asm/io.h are
included by asm/timex.h.  Since the problem is related to the legacy
I/O port support in asm/io.h, this allows files under arch/riscv that
encounter those issues to simply include asm/mmio.h instead, and
bypass the legacy I/O port functions.  Existing users of asm/io.h
don't need to change anything, since asm/mmio.h is included by
asm/io.h.

While here, clean up some checkpatch.pl-related issues with the
original code.

Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/include/asm/io.h
arch/riscv/include/asm/mmio.h [new file with mode: 0644]