Commit a84bf321 authored by Alistair Popple's avatar Alistair Popple Committed by Michael Ellerman

powerpc: Add __raw_rm_writeq() function

Move __raw_rm_writeq() from platforms/powernv/pci-ioda.c to
include/asm/io.h so that it can be used by other code.
Signed-off-by: default avatarAlistair Popple <alistair@popple.id.au>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 94973b24
...@@ -385,6 +385,17 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) ...@@ -385,6 +385,17 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
{ {
*(volatile unsigned long __force *)PCI_FIX_ADDR(addr) = v; *(volatile unsigned long __force *)PCI_FIX_ADDR(addr) = v;
} }
/*
* Real mode version of the above. stdcix is only supposed to be used
* in hypervisor real mode as per the architecture spec.
*/
static inline void __raw_rm_writeq(u64 val, volatile void __iomem *paddr)
{
__asm__ __volatile__("stdcix %0,0,%1"
: : "r" (val), "r" (paddr) : "memory");
}
#endif /* __powerpc64__ */ #endif /* __powerpc64__ */
/* /*
......
...@@ -116,16 +116,6 @@ static int __init iommu_setup(char *str) ...@@ -116,16 +116,6 @@ static int __init iommu_setup(char *str)
} }
early_param("iommu", iommu_setup); early_param("iommu", iommu_setup);
/*
* stdcix is only supposed to be used in hypervisor real mode as per
* the architecture spec
*/
static inline void __raw_rm_writeq(u64 val, volatile void __iomem *paddr)
{
__asm__ __volatile__("stdcix %0,0,%1"
: : "r" (val), "r" (paddr) : "memory");
}
static inline bool pnv_pci_is_mem_pref_64(unsigned long flags) static inline bool pnv_pci_is_mem_pref_64(unsigned long flags)
{ {
return ((flags & (IORESOURCE_MEM_64 | IORESOURCE_PREFETCH)) == return ((flags & (IORESOURCE_MEM_64 | IORESOURCE_PREFETCH)) ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment