diff options
author | Mario Six | 2018-10-15 02:24:09 -0500 |
---|---|---|
committer | Simon Glass | 2018-11-14 11:16:27 -0600 |
commit | 4d9ada54a269c4ded01d60f7c231fd1a3a436a25 (patch) | |
tree | 3641cd2bd6e632e97412225e40c081c14a151a56 | |
parent | 2448f607dc904a385148ea506df6bd037f8a248b (diff) | |
download | u-boot-4d9ada54a269c4ded01d60f7c231fd1a3a436a25.tar.gz u-boot-4d9ada54a269c4ded01d60f7c231fd1a3a436a25.tar.xz u-boot-4d9ada54a269c4ded01d60f7c231fd1a3a436a25.zip |
mips: Implement {in, out}_{le, be}_{16, 32, 64} and {in, out}_8
MIPS is the only architecture currently supported by U-Boot that does
not implement any of the in/out register access functions.
To have a interface that is useable across architectures, add the
functions to the MIPS architecture (implemented using the __raw_write
and __raw_read functions).
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
-rw-r--r-- | arch/mips/include/asm/io.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 957442effd..7c40e415c7 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h | |||
@@ -547,6 +547,28 @@ __BUILD_CLRSETBITS(bwlq, sfx, end, type) | |||
547 | #define __to_cpu(v) (v) | 547 | #define __to_cpu(v) (v) |
548 | #define cpu_to__(v) (v) | 548 | #define cpu_to__(v) (v) |
549 | 549 | ||
550 | #define out_arch(type, endian, a, v) __raw_write##type(cpu_to_##endian(v),a) | ||
551 | #define in_arch(type, endian, a) endian##_to_cpu(__raw_read##type(a)) | ||
552 | |||
553 | #define out_le64(a, v) out_arch(q, le64, a, v) | ||
554 | #define out_le32(a, v) out_arch(l, le32, a, v) | ||
555 | #define out_le16(a, v) out_arch(w, le16, a, v) | ||
556 | |||
557 | #define in_le64(a) in_arch(q, le64, a) | ||
558 | #define in_le32(a) in_arch(l, le32, a) | ||
559 | #define in_le16(a) in_arch(w, le16, a) | ||
560 | |||
561 | #define out_be64(a, v) out_arch(q, be64, a, v) | ||
562 | #define out_be32(a, v) out_arch(l, be32, a, v) | ||
563 | #define out_be16(a, v) out_arch(w, be16, a, v) | ||
564 | |||
565 | #define in_be64(a) in_arch(q, be64, a) | ||
566 | #define in_be32(a) in_arch(l, be32, a) | ||
567 | #define in_be16(a) in_arch(w, be16, a) | ||
568 | |||
569 | #define out_8(a, v) __raw_writeb(v, a) | ||
570 | #define in_8(a) __raw_readb(a) | ||
571 | |||
550 | BUILD_CLRSETBITS(b, 8, _, u8) | 572 | BUILD_CLRSETBITS(b, 8, _, u8) |
551 | BUILD_CLRSETBITS(w, le16, le16, u16) | 573 | BUILD_CLRSETBITS(w, le16, le16, u16) |
552 | BUILD_CLRSETBITS(w, be16, be16, u16) | 574 | BUILD_CLRSETBITS(w, be16, be16, u16) |