diff options
author | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-01-15 18:23:09 +0800 |
---|---|---|
committer | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-03-17 09:19:13 +0800 |
commit | 96cf5185a95e0b304596fe19edcf8dfcd5c10699 (patch) | |
tree | aebdf44fdfa8841577171df18cb1b0745b54d64e /arch/unicore32/include/asm/io.h | |
parent | 77c93b2f2388b974253af4149aa025b4751f92ad (diff) | |
download | op-kernel-dev-96cf5185a95e0b304596fe19edcf8dfcd5c10699.zip op-kernel-dev-96cf5185a95e0b304596fe19edcf8dfcd5c10699.tar.gz |
unicore32 additional architecture files: low-level lib: misc
This patch implements the rest low-level libraries.
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/unicore32/include/asm/io.h')
-rw-r--r-- | arch/unicore32/include/asm/io.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/unicore32/include/asm/io.h b/arch/unicore32/include/asm/io.h new file mode 100644 index 0000000..d73457c --- /dev/null +++ b/arch/unicore32/include/asm/io.h @@ -0,0 +1,52 @@ +/* + * linux/arch/unicore32/include/asm/io.h + * + * Code specific to PKUnity SoC and UniCore ISA + * + * Copyright (C) 2001-2010 GUAN Xue-tao + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __UNICORE_IO_H__ +#define __UNICORE_IO_H__ + +#ifdef __KERNEL__ + +#include <asm/byteorder.h> +#include <asm/memory.h> +#include <asm/system.h> + +#include <asm-generic/io.h> + +/* + * __uc32_ioremap and __uc32_ioremap_cached takes CPU physical address. + */ +extern void __iomem *__uc32_ioremap(unsigned long, size_t); +extern void __iomem *__uc32_ioremap_cached(unsigned long, size_t); +extern void __uc32_iounmap(volatile void __iomem *addr); + +/* + * ioremap and friends. + * + * ioremap takes a PCI memory address, as specified in + * Documentation/IO-mapping.txt. + * + */ +#define ioremap(cookie, size) __uc32_ioremap(cookie, size) +#define ioremap_cached(cookie, size) __uc32_ioremap_cached(cookie, size) +#define iounmap(cookie) __uc32_iounmap(cookie) + +extern void __iomem *ioport_map(unsigned long port, unsigned int nr); +extern void ioport_unmap(void __iomem *addr); + +/* + * Convert a physical pointer to a virtual kernel pointer for /dev/mem + * access + */ +#undef xlate_dev_mem_ptr +#define xlate_dev_mem_ptr(p) __va(p) + +#endif /* __KERNEL__ */ +#endif /* __UNICORE_IO_H__ */ |