Release 4.7 arch/cris/include/asm/io.h
#ifndef _ASM_CRIS_IO_H
#define _ASM_CRIS_IO_H
#include <asm/page.h> /* for __va, __pa */
#ifdef CONFIG_ETRAX_ARCH_V10
#include <arch/io.h>
#endif
#include <asm-generic/iomap.h>
#include <linux/kernel.h>
struct cris_io_operations
{
u32 (*read_mem)(void *addr, int size);
void (*write_mem)(u32 val, int size, void *addr);
u32 (*read_io)(u32 port, void *addr, int size, int count);
void (*write_io)(u32 port, void *addr, int size, int count);
};
#ifdef CONFIG_PCI
extern struct cris_io_operations *cris_iops;
#else
#define cris_iops ((struct cris_io_operations*)NULL)
#endif
/*
* Change virtual addresses to physical addresses and vv.
*/
static inline unsigned long virt_to_phys(volatile void * address)
{
return __pa(address);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
linus torvalds | linus torvalds | 18 | 94.74% | 1 | 50.00% |
adrian bunk | adrian bunk | 1 | 5.26% | 1 | 50.00% |
| Total | 19 | 100.00% | 2 | 100.00% |
static inline void * phys_to_virt(unsigned long address)
{
return __va(address);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
linus torvalds | linus torvalds | 17 | 94.44% | 1 | 50.00% |
adrian bunk | adrian bunk | 1 | 5.56% | 1 | 50.00% |
| Total | 18 | 100.00% | 2 | 100.00% |
extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
extern void __iomem * __ioremap_prot(unsigned long phys_addr, unsigned long size, pgprot_t prot);
static inline void __iomem * ioremap (unsigned long offset, unsigned long size)
{
return __ioremap(offset, size, 0);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
linus torvalds | linus torvalds | 25 | 92.59% | 1 | 33.33% |
adrian bunk | adrian bunk | 1 | 3.70% | 1 | 33.33% |
mikael starvik | mikael starvik | 1 | 3.70% | 1 | 33.33% |
| Total | 27 | 100.00% | 3 | 100.00% |
extern void iounmap(volatile void * __iomem addr);
extern void __iomem * ioremap_nocache(unsigned long offset, unsigned long size);
/*
* IO bus memory addresses are also 1:1 with the physical address
*/
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
/*
* readX/writeX() are used to access memory mapped devices. On some
* architectures the memory mapped IO stuff needs to be accessed
* differently. On the CRIS architecture, we just read/write the
* memory location directly.
*/
#ifdef CONFIG_PCI
#define PCI_SPACE(x) ((((unsigned)(x)) & 0x10000000) == 0x10000000)
#else
#define PCI_SPACE(x) 0
#endif
static inline unsigned char readb(const volatile void __iomem *addr)
{
if (PCI_SPACE(addr) && cris_iops)
return cris_iops->read_mem((void*)addr, 1);
else
return *(volatile unsigned char __force *) addr;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mikael starvik | mikael starvik | 50 | 100.00% | 1 | 100.00% |
| Total | 50 | 100.00% | 1 | 100.00% |
static inline unsigned short readw(const volatile void __iomem *addr)
{
if (PCI_SPACE(addr) && cris_iops)
return cris_iops->read_mem((void*)addr, 2);
else
return *(volatile unsigned short __force *) addr;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mikael starvik | mikael starvik | 46 | 92.00% | 1 | 50.00% |
linus torvalds | linus torvalds | 4 | 8.00% | 1 | 50.00% |
| Total | 50 | 100.00% | 2 | 100.00% |
static inline unsigned int readl(const volatile void __iomem *addr)
{
if (PCI_SPACE(addr) && cris_iops)
return cris_iops->read_mem((void*)addr, 4);
else
return *(volatile unsigned int __force *) addr;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mikael starvik | mikael starvik | 46 | 92.00% | 1 | 50.00% |
linus torvalds | linus torvalds | 4 | 8.00% | 1 | 50.00% |
| Total | 50 | 100.00% | 2 | 100.00% |
#define readb_relaxed(addr) readb(addr)
#define readw_relaxed(addr) readw(addr)
#define readl_relaxed(addr) readl(addr)
#define __raw_readb readb
#define __raw_readw readw
#define __raw_readl readl
static inline void writeb(unsigned char b, volatile void __iomem *addr)
{
if (PCI_SPACE(addr) && cris_iops)
cris_iops->write_mem(b, 1, (void*)addr);
else
*(volatile unsigned char __force *) addr = b;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mikael starvik | mikael starvik | 48 | 88.89% | 1 | 50.00% |
linus torvalds | linus torvalds | 6 | 11.11% | 1 | 50.00% |
| Total | 54 | 100.00% | 2 | 100.00% |
static inline void writew(unsigned short b, volatile void __iomem *addr)
{
if (PCI_SPACE(addr) && cris_iops)
cris_iops->write_mem(b, 2, (void*)addr);
else
*(volatile unsigned short __force *) addr = b;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mikael starvik | mikael starvik | 48 | 88.89% | 1 | 50.00% |
linus torvalds | linus torvalds | 6 | 11.11% | 1 | 50.00% |
| Total | 54 | 100.00% | 2 | 100.00% |
static inline void writel(unsigned int b, volatile void __iomem *addr)
{
if (PCI_SPACE(addr) && cris_iops)
cris_iops->write_mem(b, 4, (void*)addr);
else
*(volatile unsigned int __force *) addr = b;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mikael starvik | mikael starvik | 48 | 88.89% | 1 | 50.00% |
linus torvalds | linus torvalds | 6 | 11.11% | 1 | 50.00% |
| Total | 54 | 100.00% | 2 | 100.00% |
#define writeb_relaxed(b, addr) writeb(b, addr)
#define writew_relaxed(b, addr) writew(b, addr)
#define writel_relaxed(b, addr) writel(b, addr)
#define __raw_writeb writeb
#define __raw_writew writew
#define __raw_writel writel
#define mmiowb()
#define memset_io(a,b,c) memset((void *)(a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
/* I/O port access. Normally there is no I/O space on CRIS but when
* Cardbus/PCI is enabled the request is passed through the bridge.
*/
#define IO_SPACE_LIMIT 0xffff
#define inb(port) (cris_iops ? cris_iops->read_io(port,NULL,1,1) : 0)
#define inw(port) (cris_iops ? cris_iops->read_io(port,NULL,2,1) : 0)
#define inl(port) (cris_iops ? cris_iops->read_io(port,NULL,4,1) : 0)
#define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)
#define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)
#define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0)
static inline void outb(unsigned char data, unsigned int port)
{
if (cris_iops)
cris_iops->write_io(port, (void *) &data, 1, 1);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
corey minyard | corey minyard | 31 | 83.78% | 1 | 33.33% |
mikael starvik | mikael starvik | 3 | 8.11% | 1 | 33.33% |
linus torvalds | linus torvalds | 3 | 8.11% | 1 | 33.33% |
| Total | 37 | 100.00% | 3 | 100.00% |
static inline void outw(unsigned short data, unsigned int port)
{
if (cris_iops)
cris_iops->write_io(port, (void *) &data, 2, 1);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
corey minyard | corey minyard | 31 | 83.78% | 1 | 33.33% |
linus torvalds | linus torvalds | 3 | 8.11% | 1 | 33.33% |
mikael starvik | mikael starvik | 3 | 8.11% | 1 | 33.33% |
| Total | 37 | 100.00% | 3 | 100.00% |
static inline void outl(unsigned int data, unsigned int port)
{
if (cris_iops)
cris_iops->write_io(port, (void *) &data, 4, 1);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
corey minyard | corey minyard | 31 | 83.78% | 1 | 33.33% |
linus torvalds | linus torvalds | 3 | 8.11% | 1 | 33.33% |
mikael starvik | mikael starvik | 3 | 8.11% | 1 | 33.33% |
| Total | 37 | 100.00% | 3 | 100.00% |
static inline void outsb(unsigned int port, const void *addr,
unsigned long count)
{
if (cris_iops)
cris_iops->write_io(port, (void *)addr, 1, count);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
corey minyard | corey minyard | 33 | 80.49% | 1 | 33.33% |
linus torvalds | linus torvalds | 5 | 12.20% | 1 | 33.33% |
mikael starvik | mikael starvik | 3 | 7.32% | 1 | 33.33% |
| Total | 41 | 100.00% | 3 | 100.00% |
static inline void outsw(unsigned int port, const void *addr,
unsigned long count)
{
if (cris_iops)
cris_iops->write_io(port, (void *)addr, 2, count);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
corey minyard | corey minyard | 33 | 80.49% | 1 | 33.33% |
linus torvalds | linus torvalds | 5 | 12.20% | 1 | 33.33% |
mikael starvik | mikael starvik | 3 | 7.32% | 1 | 33.33% |
| Total | 41 | 100.00% | 3 | 100.00% |
static inline void outsl(unsigned int port, const void *addr,
unsigned long count)
{
if (cris_iops)
cris_iops->write_io(port, (void *)addr, 4, count);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
corey minyard | corey minyard | 33 | 80.49% | 1 | 33.33% |
linus torvalds | linus torvalds | 5 | 12.20% | 1 | 33.33% |
mikael starvik | mikael starvik | 3 | 7.32% | 1 | 33.33% |
| Total | 41 | 100.00% | 3 | 100.00% |
#define inb_p(port) inb(port)
#define inw_p(port) inw(port)
#define inl_p(port) inl(port)
#define outb_p(val, port) outb((val), (port))
#define outw_p(val, port) outw((val), (port))
#define outl_p(val, port) outl((val), (port))
/*
* 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
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
mikael starvik | mikael starvik | 509 | 48.20% | 2 | 11.76% |
linus torvalds | linus torvalds | 216 | 20.45% | 2 | 11.76% |
corey minyard | corey minyard | 192 | 18.18% | 1 | 5.88% |
geert uytterhoeven | geert uytterhoeven | 48 | 4.55% | 2 | 11.76% |
andrew morton | andrew morton | 31 | 2.94% | 2 | 11.76% |
will deacon | will deacon | 27 | 2.56% | 1 | 5.88% |
jes sorensen | jes sorensen | 16 | 1.52% | 1 | 5.88% |
rabin vincent | rabin vincent | 5 | 0.47% | 1 | 5.88% |
jesse barnes | jesse barnes | 4 | 0.38% | 1 | 5.88% |
mauro carvalho chehab | mauro carvalho chehab | 3 | 0.28% | 1 | 5.88% |
adrian bunk | adrian bunk | 3 | 0.28% | 1 | 5.88% |
jesper nilsson | jesper nilsson | 2 | 0.19% | 2 | 11.76% |
| Total | 1056 | 100.00% | 17 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.