u-boot-brain/include/linux/io.h
Tom Rini 83d290c56f SPDX: Convert all of our single license tags to Linux Kernel style
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07 09:34:12 -04:00

69 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0+ */
#ifndef _LINUX_IO_H
#define _LINUX_IO_H
#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/io.h>
static inline u8 ioread8(const volatile void __iomem *addr)
{
return readb(addr);
}
static inline u16 ioread16(const volatile void __iomem *addr)
{
return readw(addr);
}
static inline u32 ioread32(const volatile void __iomem *addr)
{
return readl(addr);
}
#ifdef CONFIG_64BIT
static inline u64 ioread64(const volatile void __iomem *addr)
{
return readq(addr);
}
#endif /* CONFIG_64BIT */
static inline void iowrite8(u8 value, volatile void __iomem *addr)
{
writeb(value, addr);
}
static inline void iowrite16(u16 value, volatile void __iomem *addr)
{
writew(value, addr);
}
static inline void iowrite32(u32 value, volatile void __iomem *addr)
{
writel(value, addr);
}
#ifdef CONFIG_64BIT
static inline void iowrite64(u64 value, volatile void __iomem *addr)
{
writeq(value, addr);
}
#endif /* CONFIG_64BIT */
#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 */