mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-03 18:20:25 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									c9d95fbe59
								
							
						
					
					
						commit
						cc22b4c185
					
				
					 15 changed files with 22 additions and 18 deletions
				
			
		| 
						 | 
					@ -2,9 +2,10 @@
 | 
				
			||||||
#define ASMARM_VGA_H
 | 
					#define ASMARM_VGA_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <linux/io.h>
 | 
					#include <linux/io.h>
 | 
				
			||||||
#include <mach/hardware.h>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define VGA_MAP_MEM(x,s)	(PCIMEM_BASE + (x))
 | 
					extern unsigned long vga_base;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define VGA_MAP_MEM(x,s)	(vga_base + (x))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define vga_readb(x)	(*((volatile unsigned char *)x))
 | 
					#define vga_readb(x)	(*((volatile unsigned char *)x))
 | 
				
			||||||
#define vga_writeb(x,y)	(*((volatile unsigned char *)y) = (x))
 | 
					#define vga_writeb(x,y)	(*((volatile unsigned char *)y) = (x))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,9 +11,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "dove.h"
 | 
					#include "dove.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCIMEM_BASE			DOVE_PCIE0_MEM_PHYS_BASE
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Macros below are required for compatibility with PXA AC'97 driver.	*/
 | 
					/* Macros below are required for compatibility with PXA AC'97 driver.	*/
 | 
				
			||||||
#define __REG(x)	(*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \
 | 
					#define __REG(x)	(*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \
 | 
				
			||||||
				DOVE_SB_REGS_VIRT_BASE)))
 | 
									DOVE_SB_REGS_VIRT_BASE)))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,6 +11,7 @@
 | 
				
			||||||
#include <linux/kernel.h>
 | 
					#include <linux/kernel.h>
 | 
				
			||||||
#include <linux/pci.h>
 | 
					#include <linux/pci.h>
 | 
				
			||||||
#include <linux/mbus.h>
 | 
					#include <linux/mbus.h>
 | 
				
			||||||
 | 
					#include <video/vga.h>
 | 
				
			||||||
#include <asm/mach/pci.h>
 | 
					#include <asm/mach/pci.h>
 | 
				
			||||||
#include <asm/mach/arch.h>
 | 
					#include <asm/mach/arch.h>
 | 
				
			||||||
#include <asm/setup.h>
 | 
					#include <asm/setup.h>
 | 
				
			||||||
| 
						 | 
					@ -228,6 +229,8 @@ static void __init add_pcie_port(int index, unsigned long base)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init dove_pcie_init(int init_port0, int init_port1)
 | 
					void __init dove_pcie_init(int init_port0, int init_port1)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						vga_base = DOVE_PCIE0_MEM_PHYS_BASE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (init_port0)
 | 
						if (init_port0)
 | 
				
			||||||
		add_pcie_port(0, DOVE_PCIE0_VIRT_BASE);
 | 
							add_pcie_port(0, DOVE_PCIE0_VIRT_BASE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -296,6 +296,7 @@ void __init dc21285_preinit(void)
 | 
				
			||||||
	int cfn_mode;
 | 
						int cfn_mode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pcibios_min_mem = 0x81000000;
 | 
						pcibios_min_mem = 0x81000000;
 | 
				
			||||||
 | 
						vga_base = PCIMEM_BASE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	mem_size = (unsigned int)high_memory - PAGE_OFFSET;
 | 
						mem_size = (unsigned int)high_memory - PAGE_OFFSET;
 | 
				
			||||||
	for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
 | 
						for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,8 +32,6 @@
 | 
				
			||||||
#define IO_SIZE			0x0B000000                 // How much?
 | 
					#define IO_SIZE			0x0B000000                 // How much?
 | 
				
			||||||
#define IO_START		INTEGRATOR_HDR_BASE        // PA of IO
 | 
					#define IO_START		INTEGRATOR_HDR_BASE        // PA of IO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCIMEM_BASE		PCI_MEMORY_VADDR
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* macro to get at IO space when running virtually */
 | 
					/* macro to get at IO space when running virtually */
 | 
				
			||||||
#ifdef CONFIG_MMU
 | 
					#ifdef CONFIG_MMU
 | 
				
			||||||
#define IO_ADDRESS(x)	(((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
 | 
					#define IO_ADDRESS(x)	(((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,6 +27,7 @@
 | 
				
			||||||
#include <linux/spinlock.h>
 | 
					#include <linux/spinlock.h>
 | 
				
			||||||
#include <linux/init.h>
 | 
					#include <linux/init.h>
 | 
				
			||||||
#include <linux/io.h>
 | 
					#include <linux/io.h>
 | 
				
			||||||
 | 
					#include <video/vga.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <mach/hardware.h>
 | 
					#include <mach/hardware.h>
 | 
				
			||||||
#include <mach/platform.h>
 | 
					#include <mach/platform.h>
 | 
				
			||||||
| 
						 | 
					@ -504,6 +505,7 @@ void __init pci_v3_preinit(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pcibios_min_io = 0x6000;
 | 
						pcibios_min_io = 0x6000;
 | 
				
			||||||
	pcibios_min_mem = 0x00100000;
 | 
						pcibios_min_mem = 0x00100000;
 | 
				
			||||||
 | 
						vga_base = PCI_MEMORY_VADDR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Hook in our fault handler for PCI errors
 | 
						 * Hook in our fault handler for PCI errors
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,4 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "kirkwood.h"
 | 
					#include "kirkwood.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCIMEM_BASE			KIRKWOOD_PCIE_MEM_PHYS_BASE /* mem base for VGA */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,6 +12,7 @@
 | 
				
			||||||
#include <linux/pci.h>
 | 
					#include <linux/pci.h>
 | 
				
			||||||
#include <linux/slab.h>
 | 
					#include <linux/slab.h>
 | 
				
			||||||
#include <linux/mbus.h>
 | 
					#include <linux/mbus.h>
 | 
				
			||||||
 | 
					#include <video/vga.h>
 | 
				
			||||||
#include <asm/irq.h>
 | 
					#include <asm/irq.h>
 | 
				
			||||||
#include <asm/mach/pci.h>
 | 
					#include <asm/mach/pci.h>
 | 
				
			||||||
#include <plat/pcie.h>
 | 
					#include <plat/pcie.h>
 | 
				
			||||||
| 
						 | 
					@ -271,6 +272,8 @@ static void __init add_pcie_port(int index, unsigned long base)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init kirkwood_pcie_init(unsigned int portmask)
 | 
					void __init kirkwood_pcie_init(unsigned int portmask)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (portmask & KW_PCIE0)
 | 
						if (portmask & KW_PCIE0)
 | 
				
			||||||
		add_pcie_port(0, PCIE_VIRT_BASE);
 | 
							add_pcie_port(0, PCIE_VIRT_BASE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,4 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "mv78xx0.h"
 | 
					#include "mv78xx0.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCIMEM_BASE			MV78XX0_PCIE_MEM_PHYS_BASE /* mem base for VGA */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,6 +11,7 @@
 | 
				
			||||||
#include <linux/kernel.h>
 | 
					#include <linux/kernel.h>
 | 
				
			||||||
#include <linux/pci.h>
 | 
					#include <linux/pci.h>
 | 
				
			||||||
#include <linux/mbus.h>
 | 
					#include <linux/mbus.h>
 | 
				
			||||||
 | 
					#include <video/vga.h>
 | 
				
			||||||
#include <asm/irq.h>
 | 
					#include <asm/irq.h>
 | 
				
			||||||
#include <asm/mach/pci.h>
 | 
					#include <asm/mach/pci.h>
 | 
				
			||||||
#include <plat/pcie.h>
 | 
					#include <plat/pcie.h>
 | 
				
			||||||
| 
						 | 
					@ -297,6 +298,8 @@ static void __init add_pcie_port(int maj, int min, unsigned long base)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init mv78xx0_pcie_init(int init_port0, int init_port1)
 | 
					void __init mv78xx0_pcie_init(int init_port0, int init_port1)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						vga_base = MV78XX0_PCIE_MEM_PHYS_BASE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (init_port0) {
 | 
						if (init_port0) {
 | 
				
			||||||
		add_pcie_port(0, 0, PCIE00_VIRT_BASE);
 | 
							add_pcie_port(0, 0, PCIE00_VIRT_BASE);
 | 
				
			||||||
		if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) {
 | 
							if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,4 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "orion5x.h"
 | 
					#include "orion5x.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCIMEM_BASE		ORION5X_PCIE_MEM_PHYS_BASE
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -560,6 +560,8 @@ int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int ret = 0;
 | 
						int ret = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vga_base = ORION5X_PCIE_MEM_PHYS_BASE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (nr == 0) {
 | 
						if (nr == 0) {
 | 
				
			||||||
		orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
 | 
							orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
 | 
				
			||||||
		ret = pcie_setup(sys);
 | 
							ret = pcie_setup(sys);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,5 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define UNCACHEABLE_ADDR        0xdf010000
 | 
					#define UNCACHEABLE_ADDR        0xdf010000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCIMEM_BASE		0xe8000000
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,6 +8,7 @@
 | 
				
			||||||
#include <linux/kernel.h>
 | 
					#include <linux/kernel.h>
 | 
				
			||||||
#include <linux/pci.h>
 | 
					#include <linux/pci.h>
 | 
				
			||||||
#include <linux/init.h>
 | 
					#include <linux/init.h>
 | 
				
			||||||
 | 
					#include <video/vga.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <asm/irq.h>
 | 
					#include <asm/irq.h>
 | 
				
			||||||
#include <asm/mach/pci.h>
 | 
					#include <asm/mach/pci.h>
 | 
				
			||||||
| 
						 | 
					@ -42,6 +43,7 @@ static int __init shark_pci_init(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pcibios_min_io = 0x6000;
 | 
						pcibios_min_io = 0x6000;
 | 
				
			||||||
	pcibios_min_mem = 0x50000000;
 | 
						pcibios_min_mem = 0x50000000;
 | 
				
			||||||
 | 
						vga_base = 0xe8000000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pci_common_init(&shark_pci);
 | 
						pci_common_init(&shark_pci);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,9 @@
 | 
				
			||||||
#include <linux/ioport.h>
 | 
					#include <linux/ioport.h>
 | 
				
			||||||
#include <linux/io.h>
 | 
					#include <linux/io.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					unsigned long vga_base;
 | 
				
			||||||
 | 
					EXPORT_SYMBOL(vga_base);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __io
 | 
					#ifdef __io
 | 
				
			||||||
void __iomem *ioport_map(unsigned long port, unsigned int nr)
 | 
					void __iomem *ioport_map(unsigned long port, unsigned int nr)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue