diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2011-12-01 05:41:36 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-12-04 09:00:17 -0500 |
commit | 34f1bdee1910f7efe3c32e1a891dba4fd21cb3b6 (patch) | |
tree | ff3b52d4ab12ae907117d8d1064fab94acbc11e3 /arch/mn10300 | |
parent | 2ebf5d0d79087005e1042df2cd0f7594782746d8 (diff) |
mn10300: switch to GENERIC_PCI_IOMAP
The pci_iomap variant that arch/mn10300/unit-asb2305/pci-iomap.c
uses differs from the generic one in that it does
not use ioremap_nocache for PCI addresses.
However, it turns out that PCI addresses are
automatically noncached, so switching to ioremap_nocache
and to the generic implementation is safe.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/Kconfig | 1 | ||||
-rw-r--r-- | arch/mn10300/include/asm/io.h | 1 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/Makefile | 2 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/pci-iomap.c | 31 |
4 files changed, 2 insertions, 33 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 438db84a1f7c..8f1c40d5817e 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
@@ -252,6 +252,7 @@ config PCI | |||
252 | bool "Use PCI" | 252 | bool "Use PCI" |
253 | depends on MN10300_UNIT_ASB2305 | 253 | depends on MN10300_UNIT_ASB2305 |
254 | default y | 254 | default y |
255 | select GENERIC_PCI_IOMAP | ||
255 | help | 256 | help |
256 | Some systems (such as the ASB2305) have PCI onboard. If you have one | 257 | Some systems (such as the ASB2305) have PCI onboard. If you have one |
257 | of these boards and you wish to use the PCI facilities, say Y here. | 258 | of these boards and you wish to use the PCI facilities, say Y here. |
diff --git a/arch/mn10300/include/asm/io.h b/arch/mn10300/include/asm/io.h index 0d6d54f09f17..139df8c53de8 100644 --- a/arch/mn10300/include/asm/io.h +++ b/arch/mn10300/include/asm/io.h | |||
@@ -229,7 +229,6 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
229 | 229 | ||
230 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 230 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
231 | struct pci_dev; | 231 | struct pci_dev; |
232 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
233 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) | 232 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) |
234 | { | 233 | { |
235 | } | 234 | } |
diff --git a/arch/mn10300/unit-asb2305/Makefile b/arch/mn10300/unit-asb2305/Makefile index 0551022225b3..cbc5abaa939a 100644 --- a/arch/mn10300/unit-asb2305/Makefile +++ b/arch/mn10300/unit-asb2305/Makefile | |||
@@ -5,4 +5,4 @@ | |||
5 | ############################################################################### | 5 | ############################################################################### |
6 | obj-y := unit-init.o leds.o | 6 | obj-y := unit-init.o leds.o |
7 | 7 | ||
8 | obj-$(CONFIG_PCI) += pci.o pci-asb2305.o pci-irq.o pci-iomap.o | 8 | obj-$(CONFIG_PCI) += pci.o pci-asb2305.o pci-irq.o |
diff --git a/arch/mn10300/unit-asb2305/pci-iomap.c b/arch/mn10300/unit-asb2305/pci-iomap.c deleted file mode 100644 index c1a8d8f941fd..000000000000 --- a/arch/mn10300/unit-asb2305/pci-iomap.c +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* ASB2305 PCI I/O mapping handler | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | #include <linux/pci.h> | ||
12 | #include <linux/module.h> | ||
13 | |||
14 | /* | ||
15 | * Create a virtual mapping cookie for a PCI BAR (memory or IO) | ||
16 | */ | ||
17 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
18 | { | ||
19 | resource_size_t start = pci_resource_start(dev, bar); | ||
20 | resource_size_t len = pci_resource_len(dev, bar); | ||
21 | unsigned long flags = pci_resource_flags(dev, bar); | ||
22 | |||
23 | if (!len || !start) | ||
24 | return NULL; | ||
25 | |||
26 | if ((flags & IORESOURCE_IO) || (flags & IORESOURCE_MEM)) | ||
27 | return (void __iomem *) start; | ||
28 | |||
29 | return NULL; | ||
30 | } | ||
31 | EXPORT_SYMBOL(pci_iomap); | ||