Skip to content

Commit

Permalink
unicore32: replace unicore32-specific iomap functions with generic li…
Browse files Browse the repository at this point in the history
…b implementation

1. define and enable CONFIG_GENERIC_IOMAP
2. define unicore32-specific PCI_IOBASE for asm-generic/io.h
3. define HAVE_ARCH_PIO_SIZE and unicore32-specific PIO_* macros
4. remove all unicore32-specific iomap functions

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Reviewed-and-Acked-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
GuanXuetao committed Mar 17, 2011
1 parent ce443ab commit 4fde87c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 60 deletions.
3 changes: 3 additions & 0 deletions arch/unicore32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ config GENERIC_CLOCKEVENTS
config GENERIC_CSUM
def_bool y

config GENERIC_IOMAP
def_bool y

config NO_IOPORT
bool

Expand Down
9 changes: 6 additions & 3 deletions arch/unicore32/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <asm/memory.h>
#include <asm/system.h>

#define PCI_IOBASE io_p2v(PKUNITY_PCILIO_BASE)
#include <asm-generic/io.h>

/*
Expand All @@ -38,15 +39,17 @@ extern void __uc32_iounmap(volatile void __iomem *addr);
#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)

#define HAVE_ARCH_PIO_SIZE
#define PIO_OFFSET (unsigned int)(PCI_IOBASE)
#define PIO_MASK (unsigned int)(IO_SPACE_LIMIT)
#define PIO_RESERVED (PIO_OFFSET + PIO_MASK + 1)

#endif /* __KERNEL__ */
#endif /* __UNICORE_IO_H__ */
2 changes: 1 addition & 1 deletion arch/unicore32/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

obj-y := extable.o fault.o init.o pgd.o mmu.o
obj-y += iomap.o flush.o ioremap.o
obj-y += flush.o ioremap.o

obj-$(CONFIG_SWIOTLB) += dma-swiotlb.o

Expand Down
56 changes: 0 additions & 56 deletions arch/unicore32/mm/iomap.c

This file was deleted.

0 comments on commit 4fde87c

Please sign in to comment.