Commit a800d7b1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: remove IO_DEBUG

From: Anton Blanchard <anton@samba.org>

Remove the old __IO_DEBUG stuff and add some nice comments courtesy of x86.
parent 590b0a82
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#define SIO_CONFIG_RD 0x399 #define SIO_CONFIG_RD 0x399
#define SLOW_DOWN_IO #define SLOW_DOWN_IO
/* Define this if you want to see virt_to_* messages */
#undef __IO_DEBUG
extern unsigned long isa_io_base; extern unsigned long isa_io_base;
extern unsigned long pci_io_base; extern unsigned long pci_io_base;
...@@ -149,40 +147,61 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); ...@@ -149,40 +147,61 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl);
#ifdef __KERNEL__ #ifdef __KERNEL__
/*
* Map in an area of physical address space, for accessing
* I/O devices etc.
*/
extern int __ioremap_explicit(unsigned long p_addr, unsigned long v_addr, extern int __ioremap_explicit(unsigned long p_addr, unsigned long v_addr,
unsigned long size, unsigned long flags); unsigned long size, unsigned long flags);
extern void *__ioremap(unsigned long address, unsigned long size, extern void *__ioremap(unsigned long address, unsigned long size,
unsigned long flags); unsigned long flags);
/**
* ioremap - map bus memory into CPU space
* @address: 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.
*/
extern void *ioremap(unsigned long address, unsigned long size); extern void *ioremap(unsigned long address, unsigned long size);
#define ioremap_nocache(addr, size) ioremap((addr), (size)) #define ioremap_nocache(addr, size) ioremap((addr), (size))
extern int iounmap_explicit(void *addr, unsigned long size); extern int iounmap_explicit(void *addr, unsigned long size);
extern void iounmap(void *addr); extern void iounmap(void *addr);
extern void * reserve_phb_iospace(unsigned long size); extern void * reserve_phb_iospace(unsigned long size);
/* /**
* Change virtual addresses to physical addresses and vv, for * virt_to_phys - map virtual addresses to physical
* addresses in the area where the kernel has the RAM mapped. * @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) static inline unsigned long virt_to_phys(volatile void * address)
{ {
#ifdef __IO_DEBUG
printk("virt_to_phys: 0x%08lx -> 0x%08lx\n",
(unsigned long) address,
__pa((unsigned long)address));
#endif
return __pa((unsigned long)address); return __pa((unsigned long)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) static inline void * phys_to_virt(unsigned long address)
{ {
#ifdef __IO_DEBUG return (void *)__va(address);
printk("phys_to_virt: 0x%08lx -> 0x%08lx\n", address, __va(address));
#endif
return (void *) __va(address);
} }
/* /*
...@@ -344,6 +363,17 @@ static inline void out_be64(volatile unsigned long *addr, int val) ...@@ -344,6 +363,17 @@ static inline void out_be64(volatile unsigned long *addr, int val)
#endif #endif
#ifdef __KERNEL__ #ifdef __KERNEL__
/**
* check_signature - find BIOS signatures
* @io_addr: mmio address to check
* @signature: signature block
* @length: length of signature
*
* Perform a signature comparison with the mmio address io_addr. This
* address should have been obtained by ioremap.
* Returns 1 on a match.
*/
static inline int check_signature(unsigned long io_addr, static inline int check_signature(unsigned long io_addr,
const unsigned char *signature, int length) const unsigned char *signature, int length)
{ {
......
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