2009-03-27 14:25:33 +01:00
/*
2009-05-26 16:30:16 +02:00
* Copyright ( C ) 2007 - 2009 Michal Simek < monstr @ monstr . eu >
* Copyright ( C ) 2007 - 2009 PetaLogix
2009-03-27 14:25:33 +01:00
* Copyright ( C ) 2006 Atmark Techno , Inc .
*
* This file is subject to the terms and conditions of the GNU General Public
* License . See the file " COPYING " in the main directory of this archive
* for more details .
*/
# ifndef _ASM_MICROBLAZE_IO_H
# define _ASM_MICROBLAZE_IO_H
# include <asm/byteorder.h>
# include <asm/page.h>
# include <linux/types.h>
2009-05-26 16:30:16 +02:00
# include <linux/mm.h> /* Get struct page {...} */
2010-01-18 15:27:10 +01:00
# ifndef CONFIG_PCI
# define _IO_BASE 0
# define _ISA_MEM_BASE 0
# else
# define _IO_BASE isa_io_base
# define _ISA_MEM_BASE isa_mem_base
2013-02-07 15:12:24 +01:00
struct pci_dev ;
extern void pci_iounmap ( struct pci_dev * dev , void __iomem * ) ;
# define pci_iounmap pci_iounmap
2010-01-18 15:27:10 +01:00
extern unsigned long isa_io_base ;
extern resource_size_t isa_mem_base ;
2013-02-07 15:12:24 +01:00
# endif
2009-03-27 14:25:33 +01:00
2013-02-07 15:12:24 +01:00
# define PCI_IOBASE ((void __iomem *)_IO_BASE)
2009-03-27 14:25:33 +01:00
# define IO_SPACE_LIMIT (0xFFFFFFFF)
2009-05-26 16:30:16 +02:00
# ifdef CONFIG_MMU
# define page_to_bus(page) (page_to_phys(page))
2012-12-27 10:40:38 +01:00
extern void iounmap ( void __iomem * addr ) ;
2009-03-27 14:25:33 +01:00
2013-02-07 15:12:24 +01:00
extern void __iomem * ioremap ( phys_addr_t address , unsigned long size ) ;
# define ioremap_writethrough(addr, size) ioremap((addr), (size))
# define ioremap_nocache(addr, size) ioremap((addr), (size))
# define ioremap_fullcache(addr, size) ioremap((addr), (size))
# define ioremap_wc(addr, size) ioremap((addr), (size))
2009-03-27 14:25:33 +01:00
2009-05-26 16:30:16 +02:00
# endif /* CONFIG_MMU */
2013-02-07 15:12:24 +01:00
/* Big Endian */
2009-03-27 14:25:33 +01:00
# define out_be32(a, v) __raw_writel((v), (void __iomem __force *)(a))
# define out_be16(a, v) __raw_writew((v), (a))
# define in_be32(a) __raw_readl((const void __iomem __force *)(a))
# define in_be16(a) __raw_readw(a)
2009-07-27 11:45:32 -06:00
# define writel_be(v, a) out_be32((__force unsigned *)a, v)
# define readl_be(a) in_be32((__force unsigned *)a)
2013-02-07 15:12:24 +01:00
/* Little endian */
2010-02-22 09:25:42 -06:00
# define out_le32(a, v) __raw_writel(__cpu_to_le32(v), (a))
2009-03-27 14:25:33 +01:00
# define out_le16(a, v) __raw_writew(__cpu_to_le16(v), (a))
# define in_le32(a) __le32_to_cpu(__raw_readl(a))
# define in_le16(a) __le16_to_cpu(__raw_readw(a))
/* Byte ops */
# define out_8(a, v) __raw_writeb((v), (a))
# define in_8(a) __raw_readb(a)
2013-02-07 15:12:24 +01:00
# include <asm-generic/io.h>
2011-05-03 10:33:07 +02:00
2009-03-27 14:25:33 +01:00
# endif /* _ASM_MICROBLAZE_IO_H */