Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+22 -18
+3 -2
arch/arm/include/asm/vga.h
··· 2 2 #define ASMARM_VGA_H 3 3 4 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 10 #define vga_readb(x) (*((volatile unsigned char *)x)) 10 11 #define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x))
-3
arch/arm/mach-dove/include/mach/hardware.h
··· 11 11 12 12 #include "dove.h" 13 13 14 - #define PCIMEM_BASE DOVE_PCIE0_MEM_PHYS_BASE 15 - 16 - 17 14 /* Macros below are required for compatibility with PXA AC'97 driver. */ 18 15 #define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \ 19 16 DOVE_SB_REGS_VIRT_BASE)))
+3
arch/arm/mach-dove/pcie.c
··· 11 11 #include <linux/kernel.h> 12 12 #include <linux/pci.h> 13 13 #include <linux/mbus.h> 14 + #include <video/vga.h> 14 15 #include <asm/mach/pci.h> 15 16 #include <asm/mach/arch.h> 16 17 #include <asm/setup.h> ··· 229 228 230 229 void __init dove_pcie_init(int init_port0, int init_port1) 231 230 { 231 + vga_base = DOVE_PCIE0_MEM_PHYS_BASE; 232 + 232 233 if (init_port0) 233 234 add_pcie_port(0, DOVE_PCIE0_VIRT_BASE); 234 235
+1
arch/arm/mach-footbridge/dc21285.c
··· 296 296 int cfn_mode; 297 297 298 298 pcibios_min_mem = 0x81000000; 299 + vga_base = PCIMEM_BASE; 299 300 300 301 mem_size = (unsigned int)high_memory - PAGE_OFFSET; 301 302 for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
-2
arch/arm/mach-integrator/include/mach/hardware.h
··· 32 32 #define IO_SIZE 0x0B000000 // How much? 33 33 #define IO_START INTEGRATOR_HDR_BASE // PA of IO 34 34 35 - #define PCIMEM_BASE PCI_MEMORY_VADDR 36 - 37 35 /* macro to get at IO space when running virtually */ 38 36 #ifdef CONFIG_MMU 39 37 #define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
+2
arch/arm/mach-integrator/pci_v3.c
··· 27 27 #include <linux/spinlock.h> 28 28 #include <linux/init.h> 29 29 #include <linux/io.h> 30 + #include <video/vga.h> 30 31 31 32 #include <mach/hardware.h> 32 33 #include <mach/platform.h> ··· 505 504 506 505 pcibios_min_io = 0x6000; 507 506 pcibios_min_mem = 0x00100000; 507 + vga_base = PCI_MEMORY_VADDR; 508 508 509 509 /* 510 510 * Hook in our fault handler for PCI errors
-3
arch/arm/mach-kirkwood/include/mach/hardware.h
··· 11 11 12 12 #include "kirkwood.h" 13 13 14 - #define PCIMEM_BASE KIRKWOOD_PCIE_MEM_PHYS_BASE /* mem base for VGA */ 15 - 16 - 17 14 #endif
+3
arch/arm/mach-kirkwood/pcie.c
··· 12 12 #include <linux/pci.h> 13 13 #include <linux/slab.h> 14 14 #include <linux/mbus.h> 15 + #include <video/vga.h> 15 16 #include <asm/irq.h> 16 17 #include <asm/mach/pci.h> 17 18 #include <plat/pcie.h> ··· 272 271 273 272 void __init kirkwood_pcie_init(unsigned int portmask) 274 273 { 274 + vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE; 275 + 275 276 if (portmask & KW_PCIE0) 276 277 add_pcie_port(0, PCIE_VIRT_BASE); 277 278
-3
arch/arm/mach-mv78xx0/include/mach/hardware.h
··· 11 11 12 12 #include "mv78xx0.h" 13 13 14 - #define PCIMEM_BASE MV78XX0_PCIE_MEM_PHYS_BASE /* mem base for VGA */ 15 - 16 - 17 14 #endif
+3
arch/arm/mach-mv78xx0/pcie.c
··· 11 11 #include <linux/kernel.h> 12 12 #include <linux/pci.h> 13 13 #include <linux/mbus.h> 14 + #include <video/vga.h> 14 15 #include <asm/irq.h> 15 16 #include <asm/mach/pci.h> 16 17 #include <plat/pcie.h> ··· 298 297 299 298 void __init mv78xx0_pcie_init(int init_port0, int init_port1) 300 299 { 300 + vga_base = MV78XX0_PCIE_MEM_PHYS_BASE; 301 + 301 302 if (init_port0) { 302 303 add_pcie_port(0, 0, PCIE00_VIRT_BASE); 303 304 if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) {
-3
arch/arm/mach-orion5x/include/mach/hardware.h
··· 11 11 12 12 #include "orion5x.h" 13 13 14 - #define PCIMEM_BASE ORION5X_PCIE_MEM_PHYS_BASE 15 - 16 - 17 14 #endif
+2
arch/arm/mach-orion5x/pci.c
··· 560 560 { 561 561 int ret = 0; 562 562 563 + vga_base = ORION5X_PCIE_MEM_PHYS_BASE; 564 + 563 565 if (nr == 0) { 564 566 orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr); 565 567 ret = pcie_setup(sys);
-2
arch/arm/mach-shark/include/mach/hardware.h
··· 12 12 13 13 #define UNCACHEABLE_ADDR 0xdf010000 14 14 15 - #define PCIMEM_BASE 0xe8000000 16 - 17 15 #endif 18 16
+2
arch/arm/mach-shark/pci.c
··· 8 8 #include <linux/kernel.h> 9 9 #include <linux/pci.h> 10 10 #include <linux/init.h> 11 + #include <video/vga.h> 11 12 12 13 #include <asm/irq.h> 13 14 #include <asm/mach/pci.h> ··· 43 42 44 43 pcibios_min_io = 0x6000; 45 44 pcibios_min_mem = 0x50000000; 45 + vga_base = 0xe8000000; 46 46 47 47 pci_common_init(&shark_pci); 48 48
+3
arch/arm/mm/iomap.c
··· 9 9 #include <linux/ioport.h> 10 10 #include <linux/io.h> 11 11 12 + unsigned long vga_base; 13 + EXPORT_SYMBOL(vga_base); 14 + 12 15 #ifdef __io 13 16 void __iomem *ioport_map(unsigned long port, unsigned int nr) 14 17 {