2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2008-08-05 15:14:15 +00:00
|
|
|
* arch/arm/mach-footbridge/include/mach/memory.h
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 1996-1999 Russell King.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* Changelog:
|
|
|
|
* 20-Oct-1996 RMK Created
|
|
|
|
* 31-Dec-1997 RMK Fixed definitions to reduce warnings.
|
|
|
|
* 17-May-1998 DAG Added __virt_to_bus and __bus_to_virt functions.
|
|
|
|
* 21-Nov-1998 RMK Changed __virt_to_bus and __bus_to_virt to macros.
|
|
|
|
* 21-Mar-1999 RMK Added PAGE_OFFSET for co285 architecture.
|
|
|
|
* Renamed to memory.h
|
|
|
|
* Moved PAGE_OFFSET and TASK_SIZE here
|
|
|
|
*/
|
|
|
|
#ifndef __ASM_ARCH_MEMORY_H
|
|
|
|
#define __ASM_ARCH_MEMORY_H
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(CONFIG_FOOTBRIDGE_ADDIN)
|
|
|
|
/*
|
|
|
|
* If we may be using add-in footbridge mode, then we must
|
|
|
|
* use the out-of-line translation that makes use of the
|
|
|
|
* PCI BAR
|
|
|
|
*/
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
extern unsigned long __virt_to_bus(unsigned long);
|
|
|
|
extern unsigned long __bus_to_virt(unsigned long);
|
2009-12-12 14:53:08 +00:00
|
|
|
extern unsigned long __pfn_to_bus(unsigned long);
|
|
|
|
extern unsigned long __bus_to_pfn(unsigned long);
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
2008-09-06 01:53:30 +00:00
|
|
|
#define __virt_to_bus __virt_to_bus
|
|
|
|
#define __bus_to_virt __bus_to_virt
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#elif defined(CONFIG_FOOTBRIDGE_HOST)
|
|
|
|
|
2008-09-06 01:53:30 +00:00
|
|
|
/*
|
2009-12-12 14:53:08 +00:00
|
|
|
* The footbridge is programmed to expose the system RAM at 0xe0000000.
|
|
|
|
* The requirement is that the RAM isn't placed at bus address 0, which
|
2008-09-06 01:53:30 +00:00
|
|
|
* would clash with VGA cards.
|
|
|
|
*/
|
2009-12-12 14:53:08 +00:00
|
|
|
#define BUS_OFFSET 0xe0000000
|
|
|
|
#define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET))
|
|
|
|
#define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET))
|
|
|
|
#define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - PHYS_OFFSET))
|
|
|
|
#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - PHYS_OFFSET))
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#error "Undefined footbridge mode"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2006-04-04 20:47:43 +00:00
|
|
|
/*
|
|
|
|
* Cache flushing area.
|
|
|
|
*/
|
|
|
|
#define FLUSH_BASE 0xf9000000
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* Physical DRAM offset.
|
|
|
|
*/
|
2005-10-29 20:44:55 +00:00
|
|
|
#define PHYS_OFFSET UL(0x00000000)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-04-04 20:47:43 +00:00
|
|
|
#define FLUSH_BASE_PHYS 0x50000000
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|