mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-17 00:26:58 +07:00
c141611fb1
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. The one instance where we add an include for init.h covers off a case where that file was implicitly getting it from another header which itself didn't need it. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
132 lines
2.8 KiB
C
132 lines
2.8 KiB
C
/*
|
|
* ppc64 "iomap" interface implementation.
|
|
*
|
|
* (C) Copyright 2004 Linus Torvalds
|
|
*/
|
|
#include <linux/pci.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/export.h>
|
|
#include <asm/io.h>
|
|
#include <asm/pci-bridge.h>
|
|
|
|
/*
|
|
* Here comes the ppc64 implementation of the IOMAP
|
|
* interfaces.
|
|
*/
|
|
unsigned int ioread8(void __iomem *addr)
|
|
{
|
|
return readb(addr);
|
|
}
|
|
unsigned int ioread16(void __iomem *addr)
|
|
{
|
|
return readw(addr);
|
|
}
|
|
unsigned int ioread16be(void __iomem *addr)
|
|
{
|
|
return in_be16(addr);
|
|
}
|
|
unsigned int ioread32(void __iomem *addr)
|
|
{
|
|
return readl(addr);
|
|
}
|
|
unsigned int ioread32be(void __iomem *addr)
|
|
{
|
|
return in_be32(addr);
|
|
}
|
|
EXPORT_SYMBOL(ioread8);
|
|
EXPORT_SYMBOL(ioread16);
|
|
EXPORT_SYMBOL(ioread16be);
|
|
EXPORT_SYMBOL(ioread32);
|
|
EXPORT_SYMBOL(ioread32be);
|
|
|
|
void iowrite8(u8 val, void __iomem *addr)
|
|
{
|
|
writeb(val, addr);
|
|
}
|
|
void iowrite16(u16 val, void __iomem *addr)
|
|
{
|
|
writew(val, addr);
|
|
}
|
|
void iowrite16be(u16 val, void __iomem *addr)
|
|
{
|
|
out_be16(addr, val);
|
|
}
|
|
void iowrite32(u32 val, void __iomem *addr)
|
|
{
|
|
writel(val, addr);
|
|
}
|
|
void iowrite32be(u32 val, void __iomem *addr)
|
|
{
|
|
out_be32(addr, val);
|
|
}
|
|
EXPORT_SYMBOL(iowrite8);
|
|
EXPORT_SYMBOL(iowrite16);
|
|
EXPORT_SYMBOL(iowrite16be);
|
|
EXPORT_SYMBOL(iowrite32);
|
|
EXPORT_SYMBOL(iowrite32be);
|
|
|
|
/*
|
|
* These are the "repeat read/write" functions. Note the
|
|
* non-CPU byte order. We do things in "IO byteorder"
|
|
* here.
|
|
*
|
|
* FIXME! We could make these do EEH handling if we really
|
|
* wanted. Not clear if we do.
|
|
*/
|
|
void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
|
|
{
|
|
_insb((u8 __iomem *) addr, dst, count);
|
|
}
|
|
void ioread16_rep(void __iomem *addr, void *dst, unsigned long count)
|
|
{
|
|
_insw_ns((u16 __iomem *) addr, dst, count);
|
|
}
|
|
void ioread32_rep(void __iomem *addr, void *dst, unsigned long count)
|
|
{
|
|
_insl_ns((u32 __iomem *) addr, dst, count);
|
|
}
|
|
EXPORT_SYMBOL(ioread8_rep);
|
|
EXPORT_SYMBOL(ioread16_rep);
|
|
EXPORT_SYMBOL(ioread32_rep);
|
|
|
|
void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
|
|
{
|
|
_outsb((u8 __iomem *) addr, src, count);
|
|
}
|
|
void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
|
|
{
|
|
_outsw_ns((u16 __iomem *) addr, src, count);
|
|
}
|
|
void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
|
|
{
|
|
_outsl_ns((u32 __iomem *) addr, src, count);
|
|
}
|
|
EXPORT_SYMBOL(iowrite8_rep);
|
|
EXPORT_SYMBOL(iowrite16_rep);
|
|
EXPORT_SYMBOL(iowrite32_rep);
|
|
|
|
void __iomem *ioport_map(unsigned long port, unsigned int len)
|
|
{
|
|
return (void __iomem *) (port + _IO_BASE);
|
|
}
|
|
|
|
void ioport_unmap(void __iomem *addr)
|
|
{
|
|
/* Nothing to do */
|
|
}
|
|
EXPORT_SYMBOL(ioport_map);
|
|
EXPORT_SYMBOL(ioport_unmap);
|
|
|
|
#ifdef CONFIG_PCI
|
|
void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
|
|
{
|
|
if (isa_vaddr_is_ioport(addr))
|
|
return;
|
|
if (pcibios_vaddr_is_ioport(addr))
|
|
return;
|
|
iounmap(addr);
|
|
}
|
|
|
|
EXPORT_SYMBOL(pci_iounmap);
|
|
#endif /* CONFIG_PCI */
|