diff options
author | Rob Herring <rob.herring@calxeda.com> | 2011-06-28 22:22:40 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2011-07-12 12:19:29 -0400 |
commit | cc22b4c18540e5e8bf55c7d124044f9317527d3c (patch) | |
tree | 77b9980c1824fd389105efe7e7f9693c9c258ad9 | |
parent | c9d95fbe59e426eed7f16e7cac812e46ac4772d0 (diff) |
ARM: set vga memory base at run-time
Convert the incorrectly named PCIMEM_BASE to a variable called vga_base.
This removes the dependency on mach/hardware.h.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/include/asm/vga.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-dove/include/mach/hardware.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-dove/pcie.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-footbridge/dc21285.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-integrator/include/mach/hardware.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-integrator/pci_v3.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/hardware.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/pcie.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/include/mach/hardware.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/pcie.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/include/mach/hardware.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/pci.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-shark/include/mach/hardware.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-shark/pci.c | 2 | ||||
-rw-r--r-- | arch/arm/mm/iomap.c | 3 |
15 files changed, 22 insertions, 18 deletions
diff --git a/arch/arm/include/asm/vga.h b/arch/arm/include/asm/vga.h index 250a4dd00630..91f40217bfa5 100644 --- a/arch/arm/include/asm/vga.h +++ b/arch/arm/include/asm/vga.h | |||
@@ -2,9 +2,10 @@ | |||
2 | #define ASMARM_VGA_H | 2 | #define ASMARM_VGA_H |
3 | 3 | ||
4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
5 | #include <mach/hardware.h> | ||
6 | 5 | ||
7 | #define VGA_MAP_MEM(x,s) (PCIMEM_BASE + (x)) | 6 | extern unsigned long vga_base; |
7 | |||
8 | #define VGA_MAP_MEM(x,s) (vga_base + (x)) | ||
8 | 9 | ||
9 | #define vga_readb(x) (*((volatile unsigned char *)x)) | 10 | #define vga_readb(x) (*((volatile unsigned char *)x)) |
10 | #define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x)) | 11 | #define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x)) |
diff --git a/arch/arm/mach-dove/include/mach/hardware.h b/arch/arm/mach-dove/include/mach/hardware.h index 94c5a2cf5481..f1368b9a8ece 100644 --- a/arch/arm/mach-dove/include/mach/hardware.h +++ b/arch/arm/mach-dove/include/mach/hardware.h | |||
@@ -11,9 +11,6 @@ | |||
11 | 11 | ||
12 | #include "dove.h" | 12 | #include "dove.h" |
13 | 13 | ||
14 | #define PCIMEM_BASE DOVE_PCIE0_MEM_PHYS_BASE | ||
15 | |||
16 | |||
17 | /* Macros below are required for compatibility with PXA AC'97 driver. */ | 14 | /* Macros below are required for compatibility with PXA AC'97 driver. */ |
18 | #define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \ | 15 | #define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \ |
19 | DOVE_SB_REGS_VIRT_BASE))) | 16 | DOVE_SB_REGS_VIRT_BASE))) |
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c index 502d1ca2f4b7..c2f1c4767f21 100644 --- a/arch/arm/mach-dove/pcie.c +++ b/arch/arm/mach-dove/pcie.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/mbus.h> | 13 | #include <linux/mbus.h> |
14 | #include <video/vga.h> | ||
14 | #include <asm/mach/pci.h> | 15 | #include <asm/mach/pci.h> |
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
@@ -228,6 +229,8 @@ static void __init add_pcie_port(int index, unsigned long base) | |||
228 | 229 | ||
229 | void __init dove_pcie_init(int init_port0, int init_port1) | 230 | void __init dove_pcie_init(int init_port0, int init_port1) |
230 | { | 231 | { |
232 | vga_base = DOVE_PCIE0_MEM_PHYS_BASE; | ||
233 | |||
231 | if (init_port0) | 234 | if (init_port0) |
232 | add_pcie_port(0, DOVE_PCIE0_VIRT_BASE); | 235 | add_pcie_port(0, DOVE_PCIE0_VIRT_BASE); |
233 | 236 | ||
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index a8dfa00e4596..1331fff51ae2 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c | |||
@@ -296,6 +296,7 @@ void __init dc21285_preinit(void) | |||
296 | int cfn_mode; | 296 | int cfn_mode; |
297 | 297 | ||
298 | pcibios_min_mem = 0x81000000; | 298 | pcibios_min_mem = 0x81000000; |
299 | vga_base = PCIMEM_BASE; | ||
299 | 300 | ||
300 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; | 301 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; |
301 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) | 302 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) |
diff --git a/arch/arm/mach-integrator/include/mach/hardware.h b/arch/arm/mach-integrator/include/mach/hardware.h index 0ce52121dabe..65fed7c0eb84 100644 --- a/arch/arm/mach-integrator/include/mach/hardware.h +++ b/arch/arm/mach-integrator/include/mach/hardware.h | |||
@@ -32,8 +32,6 @@ | |||
32 | #define IO_SIZE 0x0B000000 // How much? | 32 | #define IO_SIZE 0x0B000000 // How much? |
33 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO | 33 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO |
34 | 34 | ||
35 | #define PCIMEM_BASE PCI_MEMORY_VADDR | ||
36 | |||
37 | /* macro to get at IO space when running virtually */ | 35 | /* macro to get at IO space when running virtually */ |
38 | #ifdef CONFIG_MMU | 36 | #ifdef CONFIG_MMU |
39 | #define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE) | 37 | #define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE) |
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index 11b86e5b71c2..dd56bfb351e3 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <video/vga.h> | ||
30 | 31 | ||
31 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
32 | #include <mach/platform.h> | 33 | #include <mach/platform.h> |
@@ -504,6 +505,7 @@ void __init pci_v3_preinit(void) | |||
504 | 505 | ||
505 | pcibios_min_io = 0x6000; | 506 | pcibios_min_io = 0x6000; |
506 | pcibios_min_mem = 0x00100000; | 507 | pcibios_min_mem = 0x00100000; |
508 | vga_base = PCI_MEMORY_VADDR; | ||
507 | 509 | ||
508 | /* | 510 | /* |
509 | * Hook in our fault handler for PCI errors | 511 | * Hook in our fault handler for PCI errors |
diff --git a/arch/arm/mach-kirkwood/include/mach/hardware.h b/arch/arm/mach-kirkwood/include/mach/hardware.h index 470899b6a3f5..742b74f43e41 100644 --- a/arch/arm/mach-kirkwood/include/mach/hardware.h +++ b/arch/arm/mach-kirkwood/include/mach/hardware.h | |||
@@ -11,7 +11,4 @@ | |||
11 | 11 | ||
12 | #include "kirkwood.h" | 12 | #include "kirkwood.h" |
13 | 13 | ||
14 | #define PCIMEM_BASE KIRKWOOD_PCIE_MEM_PHYS_BASE /* mem base for VGA */ | ||
15 | |||
16 | |||
17 | #endif | 14 | #endif |
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index ca294ff6d5be..bfeb9c900cec 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/mbus.h> | 14 | #include <linux/mbus.h> |
15 | #include <video/vga.h> | ||
15 | #include <asm/irq.h> | 16 | #include <asm/irq.h> |
16 | #include <asm/mach/pci.h> | 17 | #include <asm/mach/pci.h> |
17 | #include <plat/pcie.h> | 18 | #include <plat/pcie.h> |
@@ -271,6 +272,8 @@ static void __init add_pcie_port(int index, unsigned long base) | |||
271 | 272 | ||
272 | void __init kirkwood_pcie_init(unsigned int portmask) | 273 | void __init kirkwood_pcie_init(unsigned int portmask) |
273 | { | 274 | { |
275 | vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE; | ||
276 | |||
274 | if (portmask & KW_PCIE0) | 277 | if (portmask & KW_PCIE0) |
275 | add_pcie_port(0, PCIE_VIRT_BASE); | 278 | add_pcie_port(0, PCIE_VIRT_BASE); |
276 | 279 | ||
diff --git a/arch/arm/mach-mv78xx0/include/mach/hardware.h b/arch/arm/mach-mv78xx0/include/mach/hardware.h index 29e37ed5f7f5..67cab0a08e07 100644 --- a/arch/arm/mach-mv78xx0/include/mach/hardware.h +++ b/arch/arm/mach-mv78xx0/include/mach/hardware.h | |||
@@ -11,7 +11,4 @@ | |||
11 | 11 | ||
12 | #include "mv78xx0.h" | 12 | #include "mv78xx0.h" |
13 | 13 | ||
14 | #define PCIMEM_BASE MV78XX0_PCIE_MEM_PHYS_BASE /* mem base for VGA */ | ||
15 | |||
16 | |||
17 | #endif | 14 | #endif |
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index a560439dcc3c..445a332325d5 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/mbus.h> | 13 | #include <linux/mbus.h> |
14 | #include <video/vga.h> | ||
14 | #include <asm/irq.h> | 15 | #include <asm/irq.h> |
15 | #include <asm/mach/pci.h> | 16 | #include <asm/mach/pci.h> |
16 | #include <plat/pcie.h> | 17 | #include <plat/pcie.h> |
@@ -297,6 +298,8 @@ static void __init add_pcie_port(int maj, int min, unsigned long base) | |||
297 | 298 | ||
298 | void __init mv78xx0_pcie_init(int init_port0, int init_port1) | 299 | void __init mv78xx0_pcie_init(int init_port0, int init_port1) |
299 | { | 300 | { |
301 | vga_base = MV78XX0_PCIE_MEM_PHYS_BASE; | ||
302 | |||
300 | if (init_port0) { | 303 | if (init_port0) { |
301 | add_pcie_port(0, 0, PCIE00_VIRT_BASE); | 304 | add_pcie_port(0, 0, PCIE00_VIRT_BASE); |
302 | if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) { | 305 | if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) { |
diff --git a/arch/arm/mach-orion5x/include/mach/hardware.h b/arch/arm/mach-orion5x/include/mach/hardware.h index b6d55bc3b2f8..395735482473 100644 --- a/arch/arm/mach-orion5x/include/mach/hardware.h +++ b/arch/arm/mach-orion5x/include/mach/hardware.h | |||
@@ -11,7 +11,4 @@ | |||
11 | 11 | ||
12 | #include "orion5x.h" | 12 | #include "orion5x.h" |
13 | 13 | ||
14 | #define PCIMEM_BASE ORION5X_PCIE_MEM_PHYS_BASE | ||
15 | |||
16 | |||
17 | #endif | 14 | #endif |
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index e8706f15a670..f64965d4f8e8 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c | |||
@@ -560,6 +560,8 @@ int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys) | |||
560 | { | 560 | { |
561 | int ret = 0; | 561 | int ret = 0; |
562 | 562 | ||
563 | vga_base = ORION5X_PCIE_MEM_PHYS_BASE; | ||
564 | |||
563 | if (nr == 0) { | 565 | if (nr == 0) { |
564 | orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr); | 566 | orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr); |
565 | ret = pcie_setup(sys); | 567 | ret = pcie_setup(sys); |
diff --git a/arch/arm/mach-shark/include/mach/hardware.h b/arch/arm/mach-shark/include/mach/hardware.h index 4342931a1502..663f952a8ab3 100644 --- a/arch/arm/mach-shark/include/mach/hardware.h +++ b/arch/arm/mach-shark/include/mach/hardware.h | |||
@@ -12,7 +12,5 @@ | |||
12 | 12 | ||
13 | #define UNCACHEABLE_ADDR 0xdf010000 | 13 | #define UNCACHEABLE_ADDR 0xdf010000 |
14 | 14 | ||
15 | #define PCIMEM_BASE 0xe8000000 | ||
16 | |||
17 | #endif | 15 | #endif |
18 | 16 | ||
diff --git a/arch/arm/mach-shark/pci.c b/arch/arm/mach-shark/pci.c index 4aea637a2ddb..92d7227de0ac 100644 --- a/arch/arm/mach-shark/pci.c +++ b/arch/arm/mach-shark/pci.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/pci.h> | 9 | #include <linux/pci.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <video/vga.h> | ||
11 | 12 | ||
12 | #include <asm/irq.h> | 13 | #include <asm/irq.h> |
13 | #include <asm/mach/pci.h> | 14 | #include <asm/mach/pci.h> |
@@ -42,6 +43,7 @@ static int __init shark_pci_init(void) | |||
42 | 43 | ||
43 | pcibios_min_io = 0x6000; | 44 | pcibios_min_io = 0x6000; |
44 | pcibios_min_mem = 0x50000000; | 45 | pcibios_min_mem = 0x50000000; |
46 | vga_base = 0xe8000000; | ||
45 | 47 | ||
46 | pci_common_init(&shark_pci); | 48 | pci_common_init(&shark_pci); |
47 | 49 | ||
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c index 3d46cf466c4c..430df1a5978d 100644 --- a/arch/arm/mm/iomap.c +++ b/arch/arm/mm/iomap.c | |||
@@ -9,6 +9,9 @@ | |||
9 | #include <linux/ioport.h> | 9 | #include <linux/ioport.h> |
10 | #include <linux/io.h> | 10 | #include <linux/io.h> |
11 | 11 | ||
12 | unsigned long vga_base; | ||
13 | EXPORT_SYMBOL(vga_base); | ||
14 | |||
12 | #ifdef __io | 15 | #ifdef __io |
13 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | 16 | void __iomem *ioport_map(unsigned long port, unsigned int nr) |
14 | { | 17 | { |