Skip to content

Commit cc22b4c

Browse files
author
Rob Herring
committed
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 <[email protected]> Acked-by: Nicolas Pitre <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
1 parent c9d95fb commit cc22b4c

File tree

15 files changed

+22
-18
lines changed

15 files changed

+22
-18
lines changed

arch/arm/include/asm/vga.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
#define ASMARM_VGA_H
33

44
#include <linux/io.h>
5-
#include <mach/hardware.h>
65

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))
89

910
#define vga_readb(x) (*((volatile unsigned char *)x))
1011
#define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x))

arch/arm/mach-dove/include/mach/hardware.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
#include "dove.h"
1313

14-
#define PCIMEM_BASE DOVE_PCIE0_MEM_PHYS_BASE
15-
16-
1714
/* Macros below are required for compatibility with PXA AC'97 driver. */
1815
#define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \
1916
DOVE_SB_REGS_VIRT_BASE)))

arch/arm/mach-dove/pcie.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/kernel.h>
1212
#include <linux/pci.h>
1313
#include <linux/mbus.h>
14+
#include <video/vga.h>
1415
#include <asm/mach/pci.h>
1516
#include <asm/mach/arch.h>
1617
#include <asm/setup.h>
@@ -228,6 +229,8 @@ static void __init add_pcie_port(int index, unsigned long base)
228229

229230
void __init dove_pcie_init(int init_port0, int init_port1)
230231
{
232+
vga_base = DOVE_PCIE0_MEM_PHYS_BASE;
233+
231234
if (init_port0)
232235
add_pcie_port(0, DOVE_PCIE0_VIRT_BASE);
233236

arch/arm/mach-footbridge/dc21285.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ void __init dc21285_preinit(void)
296296
int cfn_mode;
297297

298298
pcibios_min_mem = 0x81000000;
299+
vga_base = PCIMEM_BASE;
299300

300301
mem_size = (unsigned int)high_memory - PAGE_OFFSET;
301302
for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)

arch/arm/mach-integrator/include/mach/hardware.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#define IO_SIZE 0x0B000000 // How much?
3333
#define IO_START INTEGRATOR_HDR_BASE // PA of IO
3434

35-
#define PCIMEM_BASE PCI_MEMORY_VADDR
36-
3735
/* macro to get at IO space when running virtually */
3836
#ifdef CONFIG_MMU
3937
#define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)

arch/arm/mach-integrator/pci_v3.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/spinlock.h>
2828
#include <linux/init.h>
2929
#include <linux/io.h>
30+
#include <video/vga.h>
3031

3132
#include <mach/hardware.h>
3233
#include <mach/platform.h>
@@ -504,6 +505,7 @@ void __init pci_v3_preinit(void)
504505

505506
pcibios_min_io = 0x6000;
506507
pcibios_min_mem = 0x00100000;
508+
vga_base = PCI_MEMORY_VADDR;
507509

508510
/*
509511
* Hook in our fault handler for PCI errors

arch/arm/mach-kirkwood/include/mach/hardware.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@
1111

1212
#include "kirkwood.h"
1313

14-
#define PCIMEM_BASE KIRKWOOD_PCIE_MEM_PHYS_BASE /* mem base for VGA */
15-
16-
1714
#endif

arch/arm/mach-kirkwood/pcie.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/pci.h>
1313
#include <linux/slab.h>
1414
#include <linux/mbus.h>
15+
#include <video/vga.h>
1516
#include <asm/irq.h>
1617
#include <asm/mach/pci.h>
1718
#include <plat/pcie.h>
@@ -271,6 +272,8 @@ static void __init add_pcie_port(int index, unsigned long base)
271272

272273
void __init kirkwood_pcie_init(unsigned int portmask)
273274
{
275+
vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
276+
274277
if (portmask & KW_PCIE0)
275278
add_pcie_port(0, PCIE_VIRT_BASE);
276279

arch/arm/mach-mv78xx0/include/mach/hardware.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@
1111

1212
#include "mv78xx0.h"
1313

14-
#define PCIMEM_BASE MV78XX0_PCIE_MEM_PHYS_BASE /* mem base for VGA */
15-
16-
1714
#endif

arch/arm/mach-mv78xx0/pcie.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/kernel.h>
1212
#include <linux/pci.h>
1313
#include <linux/mbus.h>
14+
#include <video/vga.h>
1415
#include <asm/irq.h>
1516
#include <asm/mach/pci.h>
1617
#include <plat/pcie.h>
@@ -297,6 +298,8 @@ static void __init add_pcie_port(int maj, int min, unsigned long base)
297298

298299
void __init mv78xx0_pcie_init(int init_port0, int init_port1)
299300
{
301+
vga_base = MV78XX0_PCIE_MEM_PHYS_BASE;
302+
300303
if (init_port0) {
301304
add_pcie_port(0, 0, PCIE00_VIRT_BASE);
302305
if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) {

arch/arm/mach-orion5x/include/mach/hardware.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@
1111

1212
#include "orion5x.h"
1313

14-
#define PCIMEM_BASE ORION5X_PCIE_MEM_PHYS_BASE
15-
16-
1714
#endif

arch/arm/mach-orion5x/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
560560
{
561561
int ret = 0;
562562

563+
vga_base = ORION5X_PCIE_MEM_PHYS_BASE;
564+
563565
if (nr == 0) {
564566
orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
565567
ret = pcie_setup(sys);

arch/arm/mach-shark/include/mach/hardware.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@
1212

1313
#define UNCACHEABLE_ADDR 0xdf010000
1414

15-
#define PCIMEM_BASE 0xe8000000
16-
1715
#endif
1816

arch/arm/mach-shark/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/kernel.h>
99
#include <linux/pci.h>
1010
#include <linux/init.h>
11+
#include <video/vga.h>
1112

1213
#include <asm/irq.h>
1314
#include <asm/mach/pci.h>
@@ -42,6 +43,7 @@ static int __init shark_pci_init(void)
4243

4344
pcibios_min_io = 0x6000;
4445
pcibios_min_mem = 0x50000000;
46+
vga_base = 0xe8000000;
4547

4648
pci_common_init(&shark_pci);
4749

arch/arm/mm/iomap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#include <linux/ioport.h>
1010
#include <linux/io.h>
1111

12+
unsigned long vga_base;
13+
EXPORT_SYMBOL(vga_base);
14+
1215
#ifdef __io
1316
void __iomem *ioport_map(unsigned long port, unsigned int nr)
1417
{

0 commit comments

Comments
 (0)