2005-06-24 05:01:26 +00:00
|
|
|
/*
|
2006-12-10 10:18:48 +00:00
|
|
|
* include/asm-xtensa/io.h
|
2005-06-24 05:01:26 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _XTENSA_IO_H
|
|
|
|
#define _XTENSA_IO_H
|
|
|
|
|
|
|
|
#include <asm/byteorder.h>
|
2007-07-24 01:43:54 +00:00
|
|
|
#include <asm/page.h>
|
2013-11-17 06:14:54 +00:00
|
|
|
#include <asm/vectors.h>
|
2012-04-18 20:20:38 +00:00
|
|
|
#include <linux/bug.h>
|
2007-08-22 17:14:51 +00:00
|
|
|
#include <linux/kernel.h>
|
2023-07-06 15:45:14 +00:00
|
|
|
#include <linux/pgtable.h>
|
2005-06-24 05:01:26 +00:00
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2008-10-21 16:08:31 +00:00
|
|
|
#define IOADDR(x) (XCHAL_KIO_BYPASS_VADDR + (x))
|
2012-09-17 01:44:40 +00:00
|
|
|
#define IO_SPACE_LIMIT ~0
|
2019-09-02 06:55:49 +00:00
|
|
|
#define PCI_IOBASE ((void __iomem *)XCHAL_KIO_BYPASS_VADDR)
|
2005-06-24 05:01:26 +00:00
|
|
|
|
2012-09-17 01:44:40 +00:00
|
|
|
#ifdef CONFIG_MMU
|
2005-06-24 05:01:26 +00:00
|
|
|
/*
|
2023-07-06 15:45:14 +00:00
|
|
|
* I/O memory mapping functions.
|
2005-06-24 05:01:26 +00:00
|
|
|
*/
|
2023-07-06 15:45:14 +00:00
|
|
|
void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
|
|
|
|
unsigned long prot);
|
|
|
|
#define ioremap_prot ioremap_prot
|
|
|
|
#define iounmap iounmap
|
|
|
|
|
2019-08-12 21:39:23 +00:00
|
|
|
static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
|
2005-06-24 05:01:26 +00:00
|
|
|
{
|
2006-12-10 10:18:48 +00:00
|
|
|
if (offset >= XCHAL_KIO_PADDR
|
2012-09-17 01:44:39 +00:00
|
|
|
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
2006-12-10 10:18:48 +00:00
|
|
|
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
|
|
|
|
else
|
2023-07-06 15:45:14 +00:00
|
|
|
return ioremap_prot(offset, size,
|
|
|
|
pgprot_val(pgprot_noncached(PAGE_KERNEL)));
|
2005-06-24 05:01:26 +00:00
|
|
|
}
|
2023-07-06 15:45:14 +00:00
|
|
|
#define ioremap ioremap
|
2005-06-24 05:01:26 +00:00
|
|
|
|
2012-09-17 01:44:39 +00:00
|
|
|
static inline void __iomem *ioremap_cache(unsigned long offset,
|
|
|
|
unsigned long size)
|
2005-06-24 05:01:26 +00:00
|
|
|
{
|
2006-12-10 10:18:48 +00:00
|
|
|
if (offset >= XCHAL_KIO_PADDR
|
2012-09-17 01:44:39 +00:00
|
|
|
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
2006-12-10 10:18:48 +00:00
|
|
|
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
|
|
|
|
else
|
2023-07-06 15:45:14 +00:00
|
|
|
return ioremap_prot(offset, size, pgprot_val(PAGE_KERNEL));
|
2012-09-17 01:44:39 +00:00
|
|
|
|
2005-06-24 05:01:26 +00:00
|
|
|
}
|
2023-07-06 15:45:14 +00:00
|
|
|
#define ioremap_cache ioremap_cache
|
2012-09-17 01:44:40 +00:00
|
|
|
#endif /* CONFIG_MMU */
|
2005-06-24 05:01:26 +00:00
|
|
|
|
2012-09-17 01:44:40 +00:00
|
|
|
#include <asm-generic/io.h>
|
|
|
|
|
2005-06-24 05:01:26 +00:00
|
|
|
#endif /* _XTENSA_IO_H */
|