diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-03-19 14:58:49 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-06-03 02:04:41 -0400 |
commit | ae9daf2d00ee103b257a1f3b4ea9c575b708fe7a (patch) | |
tree | 8ac127b66bb592e0016dedb3d0f4e6161c7b6972 /arch/arm/mach-integrator | |
parent | 01ef31053ddda5d5aee86dca61193d1395273d53 (diff) |
ARM: integrator: move static ioremapping into PCIv3 driver
Try to make this driver self-contained by moving the ioremapping
into the driver.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/include/mach/platform.h | 22 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-integrator/pci_v3.c | 48 | ||||
-rw-r--r-- | arch/arm/mach-integrator/pci_v3.h | 2 |
4 files changed, 51 insertions, 38 deletions
diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/include/mach/platform.h index 62fa119bc393..306d025d9730 100644 --- a/arch/arm/mach-integrator/include/mach/platform.h +++ b/arch/arm/mach-integrator/include/mach/platform.h | |||
@@ -305,28 +305,6 @@ | |||
305 | /* KMI definitions are now in include/asm-arm/hardware/amba_kmi.h -- rmk */ | 305 | /* KMI definitions are now in include/asm-arm/hardware/amba_kmi.h -- rmk */ |
306 | 306 | ||
307 | /* ------------------------------------------------------------------------ | 307 | /* ------------------------------------------------------------------------ |
308 | * Where in the memory map does PCI live? | ||
309 | * ------------------------------------------------------------------------ | ||
310 | * This represents a fairly liberal usage of address space. Even though | ||
311 | * the V3 only has two windows (therefore we need to map stuff on the fly), | ||
312 | * we maintain the same addresses, even if they're not mapped. | ||
313 | * | ||
314 | */ | ||
315 | #define PHYS_PCI_MEM_BASE 0x40000000 /* 512M to xxx */ | ||
316 | /* unused 256M from A0000000-AFFFFFFF might be used for I2O ??? | ||
317 | */ | ||
318 | #define PHYS_PCI_IO_BASE 0x60000000 /* 16M to xxx */ | ||
319 | /* unused (128-16)M from B1000000-B7FFFFFF | ||
320 | */ | ||
321 | #define PHYS_PCI_CONFIG_BASE 0x61000000 /* 16M to xxx */ | ||
322 | /* unused ((128-16)M - 64K) from XXX | ||
323 | */ | ||
324 | #define PHYS_PCI_V3_BASE 0x62000000 | ||
325 | |||
326 | #define PCI_MEMORY_VADDR IOMEM(0xe8000000) | ||
327 | #define PCI_CONFIG_VADDR IOMEM(0xec000000) | ||
328 | |||
329 | /* ------------------------------------------------------------------------ | ||
330 | * Integrator Interrupt Controllers | 308 | * Integrator Interrupt Controllers |
331 | * ------------------------------------------------------------------------ | 309 | * ------------------------------------------------------------------------ |
332 | * | 310 | * |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 6375657493d0..16f3196efdb4 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -56,10 +56,10 @@ | |||
56 | #include <asm/mach/arch.h> | 56 | #include <asm/mach/arch.h> |
57 | #include <asm/mach/irq.h> | 57 | #include <asm/mach/irq.h> |
58 | #include <asm/mach/map.h> | 58 | #include <asm/mach/map.h> |
59 | #include <asm/mach/pci.h> | ||
60 | #include <asm/mach/time.h> | 59 | #include <asm/mach/time.h> |
61 | 60 | ||
62 | #include "common.h" | 61 | #include "common.h" |
62 | #include "pci_v3.h" | ||
63 | 63 | ||
64 | /* Base address to the AP system controller */ | 64 | /* Base address to the AP system controller */ |
65 | void __iomem *ap_syscon_base; | 65 | void __iomem *ap_syscon_base; |
@@ -77,9 +77,6 @@ void __iomem *ap_syscon_base; | |||
77 | 77 | ||
78 | /* | 78 | /* |
79 | * Logical Physical | 79 | * Logical Physical |
80 | * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) | ||
81 | * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) | ||
82 | * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) | ||
83 | * ef000000 Cache flush | 80 | * ef000000 Cache flush |
84 | * f1000000 10000000 Core module registers | 81 | * f1000000 10000000 Core module registers |
85 | * f1100000 11000000 System controller registers | 82 | * f1100000 11000000 System controller registers |
@@ -128,23 +125,13 @@ static struct map_desc ap_io_desc[] __initdata __maybe_unused = { | |||
128 | .pfn = __phys_to_pfn(INTEGRATOR_AP_GPIO_BASE), | 125 | .pfn = __phys_to_pfn(INTEGRATOR_AP_GPIO_BASE), |
129 | .length = SZ_4K, | 126 | .length = SZ_4K, |
130 | .type = MT_DEVICE | 127 | .type = MT_DEVICE |
131 | }, { | ||
132 | .virtual = (unsigned long)PCI_MEMORY_VADDR, | ||
133 | .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE), | ||
134 | .length = SZ_16M, | ||
135 | .type = MT_DEVICE | ||
136 | }, { | ||
137 | .virtual = (unsigned long)PCI_CONFIG_VADDR, | ||
138 | .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE), | ||
139 | .length = SZ_16M, | ||
140 | .type = MT_DEVICE | ||
141 | } | 128 | } |
142 | }; | 129 | }; |
143 | 130 | ||
144 | static void __init ap_map_io(void) | 131 | static void __init ap_map_io(void) |
145 | { | 132 | { |
146 | iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); | 133 | iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); |
147 | pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE)); | 134 | pci_v3_early_init(); |
148 | } | 135 | } |
149 | 136 | ||
150 | #ifdef CONFIG_PM | 137 | #ifdef CONFIG_PM |
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index 059ac4e8a67e..a3cefdebd136 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -34,10 +34,28 @@ | |||
34 | #include <mach/platform.h> | 34 | #include <mach/platform.h> |
35 | #include <mach/irqs.h> | 35 | #include <mach/irqs.h> |
36 | 36 | ||
37 | #include <asm/mach/map.h> | ||
37 | #include <asm/signal.h> | 38 | #include <asm/signal.h> |
38 | #include <asm/mach/pci.h> | 39 | #include <asm/mach/pci.h> |
39 | #include <asm/irq_regs.h> | 40 | #include <asm/irq_regs.h> |
40 | 41 | ||
42 | #include "pci_v3.h" | ||
43 | |||
44 | /* | ||
45 | * Where in the memory map does PCI live? | ||
46 | * | ||
47 | * This represents a fairly liberal usage of address space. Even though | ||
48 | * the V3 only has two windows (therefore we need to map stuff on the fly), | ||
49 | * we maintain the same addresses, even if they're not mapped. | ||
50 | */ | ||
51 | #define PHYS_PCI_MEM_BASE 0x40000000 /* 512M */ | ||
52 | #define PHYS_PCI_IO_BASE 0x60000000 /* 16M */ | ||
53 | #define PHYS_PCI_CONFIG_BASE 0x61000000 /* 16M */ | ||
54 | #define PHYS_PCI_V3_BASE 0x62000000 /* 64K */ | ||
55 | |||
56 | #define PCI_MEMORY_VADDR IOMEM(0xe8000000) | ||
57 | #define PCI_CONFIG_VADDR IOMEM(0xec000000) | ||
58 | |||
41 | /* | 59 | /* |
42 | * V3 Local Bus to PCI Bridge definitions | 60 | * V3 Local Bus to PCI Bridge definitions |
43 | * | 61 | * |
@@ -851,7 +869,6 @@ static int __init pci_v3_probe(struct platform_device *pdev) | |||
851 | return -ENODEV; | 869 | return -ENODEV; |
852 | } | 870 | } |
853 | 871 | ||
854 | vga_base = (unsigned long)PCI_MEMORY_VADDR; | ||
855 | pci_common_init(&pci_v3); | 872 | pci_common_init(&pci_v3); |
856 | 873 | ||
857 | return 0; | 874 | return 0; |
@@ -869,3 +886,32 @@ static int __init pci_v3_init(void) | |||
869 | } | 886 | } |
870 | 887 | ||
871 | subsys_initcall(pci_v3_init); | 888 | subsys_initcall(pci_v3_init); |
889 | |||
890 | /* | ||
891 | * Static mappings for the PCIv3 bridge | ||
892 | * | ||
893 | * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) | ||
894 | * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) | ||
895 | * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) | ||
896 | */ | ||
897 | static struct map_desc pci_v3_io_desc[] __initdata __maybe_unused = { | ||
898 | { | ||
899 | .virtual = (unsigned long)PCI_MEMORY_VADDR, | ||
900 | .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE), | ||
901 | .length = SZ_16M, | ||
902 | .type = MT_DEVICE | ||
903 | }, { | ||
904 | .virtual = (unsigned long)PCI_CONFIG_VADDR, | ||
905 | .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE), | ||
906 | .length = SZ_16M, | ||
907 | .type = MT_DEVICE | ||
908 | } | ||
909 | }; | ||
910 | |||
911 | int __init pci_v3_early_init(void) | ||
912 | { | ||
913 | iotable_init(pci_v3_io_desc, ARRAY_SIZE(pci_v3_io_desc)); | ||
914 | vga_base = (unsigned long)PCI_MEMORY_VADDR; | ||
915 | pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE)); | ||
916 | return 0; | ||
917 | } | ||
diff --git a/arch/arm/mach-integrator/pci_v3.h b/arch/arm/mach-integrator/pci_v3.h new file mode 100644 index 000000000000..755fd29fed4a --- /dev/null +++ b/arch/arm/mach-integrator/pci_v3.h | |||
@@ -0,0 +1,2 @@ | |||
1 | /* Simple oneliner include to the PCIv3 early init */ | ||
2 | extern int pci_v3_early_init(void); | ||