Path: blob/master/arch/arm/mach-ixp23xx/include/mach/io.h
15157 views
/*1* arch/arm/mach-ixp23xx/include/mach/io.h2*3* Original Author: Naeem M Afzal <[email protected]>4* Maintainer: Deepak Saxena <[email protected]>5*6* Copyright (C) 2003-2005 Intel Corp.7* Copyright (C) 2005 MontaVista Software, Inc8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License version 2 as11* published by the Free Software Foundation.12*/1314#ifndef __ASM_ARCH_IO_H15#define __ASM_ARCH_IO_H1617#define IO_SPACE_LIMIT 0xffffffff1819#define __io(p) ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))20#define __mem_pci(a) (a)2122static inline void __iomem *23ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)24{25if (addr >= IXP23XX_PCI_MEM_START &&26addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) {27if (addr + size > IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE)28return NULL;2930return (void __iomem *)31((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT);32}3334return __arm_ioremap(addr, size, mtype);35}3637static inline void38ixp23xx_iounmap(void __iomem *addr)39{40if ((((u32)addr) >= IXP23XX_PCI_MEM_VIRT) &&41(((u32)addr) < IXP23XX_PCI_MEM_VIRT + IXP23XX_PCI_MEM_SIZE))42return;4344__iounmap(addr);45}4647#define __arch_ioremap ixp23xx_ioremap48#define __arch_iounmap ixp23xx_iounmap495051#endif525354