/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_M32R_IO_H #define _ASM_M32R_IO_H #include <linux/string.h> #include <linux/compiler.h> #include <asm/page.h> /* __va */ #ifdef __KERNEL__ #define IO_SPACE_LIMIT 0xFFFFFFFF /** * virt_to_phys - map virtual addresses to physical * @address: address to remap * * The returned physical address is the physical (CPU) mapping for * the memory address given. It is only valid to use this function on * addresses directly mapped or allocated via kmalloc. * * This function does not give bus mappings for DMA transfers. In * almost all conceivable cases a device driver should not be using * this function */ static inline unsigned long virt_to_phys(volatile void * address) { return __pa(address); } /** * phys_to_virt - map physical address to virtual * @address: address to remap * * The returned virtual address is a current CPU mapping for * the memory address given. It is only valid to use this function on * addresses that have a kernel mapping * * This function does not handle bus mappings for DMA transfers. In * almost all conceivable cases a device driver should not be using * this function */ static inline void *phys_to_virt(unsigned long address) { return __va(address); } extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); /** * ioremap - map bus memory into CPU space * @offset: bus address of the memory * @size: size of the resource to map * * ioremap performs a platform specific sequence of operations to * make bus memory CPU accessible via the readb/readw/readl/writeb/ * writew/writel functions and the other mmio helpers. The returned * address is not guaranteed to be usable directly as a virtual * address. */ static inline void __iomem *ioremap(unsigned long offset, unsigned long size) { return __ioremap(offset, size, 0); } extern void iounmap(volatile void __iomem *addr); #define ioremap_nocache(off,size) ioremap(off,size) #define ioremap_wc ioremap_nocache #define ioremap_wt ioremap_nocache #define ioremap_uc ioremap_nocache /* * IO bus memory addresses are also 1:1 with the physical address */ #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) #define page_to_bus page_to_phys #define virt_to_bus virt_to_phys extern unsigned char _inb(unsigned long); extern unsigned short _inw(unsigned long); extern unsigned long _inl(unsigned long); extern unsigned char _inb_p(unsigned long); extern unsigned short _inw_p(unsigned long); extern unsigned long _inl_p(unsigned long); extern void _outb(unsigned char, unsigned long); extern void _outw(unsigned short, unsigned long); extern void _outl(unsigned long, unsigned long); extern void _outb_p(unsigned char, unsigned long); extern void _outw_p(unsigned short, unsigned long); extern void _outl_p(unsigned long, unsigned long); extern void _insb(unsigned int, void *, unsigned long); extern void _insw(unsigned int, void *, unsigned long); extern void _insl(unsigned int, void *, unsigned long); extern void _outsb(unsigned int, const void *, unsigned long); extern void _outsw(unsigned int, const void *, unsigned long); extern void _outsl(unsigned int, const void *, unsigned long); static inline unsigned char _readb(unsigned long addr) { return *(volatile unsigned char __force *)addr; } static inline unsigned short _readw(unsigned long addr) { return *(volatile unsigned short __force *)addr; } static inline unsigned long _readl(unsigned long addr) { return *(volatile unsigned long __force *)addr; } static inline void _writeb(unsigned char b, unsigned long addr) { *(volatile unsigned char __force *)addr = b; } static inline void _writew(unsigned short w, unsigned long addr) { *(volatile unsigned short __force *)addr = w; } static inline void _writel(unsigned long l, unsigned long addr) { *(volatile unsigned long __force *)addr = l; } #define inb _inb #define inw _inw #define inl _inl #define outb _outb #define outw _outw #define outl _outl #define inb_p _inb_p #define inw_p _inw_p #define inl_p _inl_p #define outb_p _outb_p #define outw_p _outw_p #define outl_p _outl_p #define insb _insb #define insw _insw #define insl _insl #define outsb _outsb #define outsw _outsw #define outsl _outsl #define readb(addr) _readb((unsigned long)(addr)) #define readw(addr) _readw((unsigned long)(addr)) #define readl(addr) _readl((unsigned long)(addr)) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl #define readb_relaxed readb #define readw_relaxed readw #define readl_relaxed readl #define writeb(val, addr) _writeb((val), (unsigned long)(addr)) #define writew(val, addr) _writew((val), (unsigned long)(addr)) #define writel(val, addr) _writel((val), (unsigned long)(addr)) #define __raw_writeb writeb #define __raw_writew writew #define __raw_writel writel #define writeb_relaxed writeb #define writew_relaxed writew #define writel_relaxed writel #define ioread8 readb #define ioread16 readw #define ioread32 readl #define iowrite8 writeb #define iowrite16 writew #define iowrite32 writel #define ioread8_rep(p, dst, count) insb((unsigned long)(p), (dst), (count)) #define ioread16_rep(p, dst, count) insw((unsigned long)(p), (dst), (count)) #define ioread32_rep(p, dst, count) insl((unsigned long)(p), (dst), (count)) #define iowrite8_rep(p, src, count) outsb((unsigned long)(p), (src), (count)) #define iowrite16_rep(p, src, count) outsw((unsigned long)(p), (src), (count)) #define iowrite32_rep(p, src, count) outsl((unsigned long)(p), (src), (count)) #define ioread16be(addr) be16_to_cpu(readw(addr)) #define ioread32be(addr) be32_to_cpu(readl(addr)) #define iowrite16be(v, addr) writew(cpu_to_be16(v), (addr)) #define iowrite32be(v, addr) writel(cpu_to_be32(v), (addr)) #define mmiowb() #define flush_write_buffers() do { } while (0) /* M32R_FIXME */ static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) { memset((void __force *) addr, val, count); } static inline void memcpy_fromio(void *dst, volatile void __iomem *src, int count) { memcpy(dst, (void __force *) src, count); } static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) { memcpy((void __force *) dst, src, count); } /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * access */ #define xlate_dev_mem_ptr(p) __va(p) /* * Convert a virtual cached pointer to an uncached pointer */ #define xlate_dev_kmem_ptr(p) p #endif /* __KERNEL__ */ #endif /* _ASM_M32R_IO_H */
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
m32104ut | Folder | 0755 |
|
|
m32700ut | Folder | 0755 |
|
|
mappi2 | Folder | 0755 |
|
|
mappi3 | Folder | 0755 |
|
|
opsput | Folder | 0755 |
|
|
Kbuild | File | 318 B | 0644 |
|
addrspace.h | File | 1.67 KB | 0644 |
|
asm-offsets.h | File | 35 B | 0644 |
|
assembler.h | File | 4.2 KB | 0644 |
|
atomic.h | File | 6.29 KB | 0644 |
|
barrier.h | File | 506 B | 0644 |
|
bitops.h | File | 6.23 KB | 0644 |
|
bug.h | File | 115 B | 0644 |
|
bugs.h | File | 410 B | 0644 |
|
cache.h | File | 222 B | 0644 |
|
cachectl.h | File | 739 B | 0644 |
|
cacheflush.h | File | 3.2 KB | 0644 |
|
checksum.h | File | 4.83 KB | 0644 |
|
cmpxchg.h | File | 4.86 KB | 0644 |
|
dcache_clear.h | File | 1.01 KB | 0644 |
|
delay.h | File | 31 B | 0644 |
|
device.h | File | 148 B | 0644 |
|
div64.h | File | 31 B | 0644 |
|
dma-mapping.h | File | 570 B | 0644 |
|
dma.h | File | 281 B | 0644 |
|
elf.h | File | 3.64 KB | 0644 |
|
emergency-restart.h | File | 188 B | 0644 |
|
fb.h | File | 414 B | 0644 |
|
flat.h | File | 4.2 KB | 0644 |
|
ftrace.h | File | 12 B | 0644 |
|
futex.h | File | 82 B | 0644 |
|
hardirq.h | File | 214 B | 0644 |
|
hw_irq.h | File | 87 B | 0644 |
|
io.h | File | 6.44 KB | 0644 |
|
irq.h | File | 2.94 KB | 0644 |
|
irq_regs.h | File | 34 B | 0644 |
|
irqflags.h | File | 2.24 KB | 0644 |
|
kdebug.h | File | 32 B | 0644 |
|
kmap_types.h | File | 251 B | 0644 |
|
linkage.h | File | 177 B | 0644 |
|
local.h | File | 7.8 KB | 0644 |
|
local64.h | File | 33 B | 0644 |
|
m32102.h | File | 14.71 KB | 0644 |
|
m32r.h | File | 5.7 KB | 0644 |
|
m32r_mp_fpga.h | File | 14.89 KB | 0644 |
|
mc146818rtc.h | File | 671 B | 0644 |
|
mmu.h | File | 403 B | 0644 |
|
mmu_context.h | File | 4.23 KB | 0644 |
|
mmzone.h | File | 1.29 KB | 0644 |
|
page.h | File | 2.62 KB | 0644 |
|
pci.h | File | 147 B | 0644 |
|
percpu.h | File | 165 B | 0644 |
|
pgalloc.h | File | 1.84 KB | 0644 |
|
pgtable-2level.h | File | 2.31 KB | 0644 |
|
pgtable.h | File | 9.7 KB | 0644 |
|
processor.h | File | 2.93 KB | 0644 |
|
ptrace.h | File | 1.3 KB | 0644 |
|
rtc.h | File | 1.99 KB | 0644 |
|
s1d13806.h | File | 9.84 KB | 0644 |
|
segment.h | File | 228 B | 0644 |
|
serial.h | File | 187 B | 0644 |
|
setup.h | File | 1022 B | 0644 |
|
shmparam.h | File | 197 B | 0644 |
|
signal.h | File | 561 B | 0644 |
|
smp.h | File | 3.5 KB | 0644 |
|
spinlock.h | File | 7.15 KB | 0644 |
|
spinlock_types.h | File | 520 B | 0644 |
|
string.h | File | 378 B | 0644 |
|
switch_to.h | File | 1.48 KB | 0644 |
|
syscall.h | File | 252 B | 0644 |
|
termios.h | File | 1.74 KB | 0644 |
|
thread_info.h | File | 3.71 KB | 0644 |
|
timex.h | File | 581 B | 0644 |
|
tlb.h | File | 483 B | 0644 |
|
tlbflush.h | File | 2.94 KB | 0644 |
|
topology.h | File | 167 B | 0644 |
|
types.h | File | 258 B | 0644 |
|
uaccess.h | File | 15.3 KB | 0644 |
|
ucontext.h | File | 321 B | 0644 |
|
unaligned.h | File | 592 B | 0644 |
|
unistd.h | File | 1.23 KB | 0644 |
|
user.h | File | 2.1 KB | 0644 |
|
vga.h | File | 436 B | 0644 |
|
xor.h | File | 148 B | 0644 |
|