Path: blob/master/arch/arm/mach-realview/include/mach/memory.h
10820 views
/*1* arch/arm/mach-realview/include/mach/memory.h2*3* Copyright (C) 2003 ARM Limited4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA18*/19#ifndef __ASM_ARCH_MEMORY_H20#define __ASM_ARCH_MEMORY_H2122/*23* Physical DRAM offset.24*/25#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET26#define PLAT_PHYS_OFFSET UL(0x70000000)27#else28#define PLAT_PHYS_OFFSET UL(0x00000000)29#endif3031#ifdef CONFIG_ZONE_DMA32#define ARM_DMA_ZONE_SIZE SZ_256M33#endif3435#ifdef CONFIG_SPARSEMEM3637/*38* Sparsemem definitions for RealView PBX.39*40* The RealView PBX board has another block of 512MB of RAM at 0x20000000,41* however only the block at 0x70000000 (or the 256MB mirror at 0x00000000)42* may be used for DMA.43*44* The macros below define a section size of 256MB and a non-linear virtual to45* physical mapping:46*47* 256MB @ 0x00000000 -> PAGE_OFFSET48* 512MB @ 0x20000000 -> PAGE_OFFSET + 0x1000000049* 256MB @ 0x80000000 -> PAGE_OFFSET + 0x3000000050*/51#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET52#error "SPARSEMEM not available with REALVIEW_HIGH_PHYS_OFFSET"53#endif5455#define MAX_PHYSMEM_BITS 3256#define SECTION_SIZE_BITS 285758/* bank page offsets */59#define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000)60#define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000)6162#define __phys_to_virt(phys) \63((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \64(phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \65(phys) + PAGE_OFFSET)6667#define __virt_to_phys(virt) \68((virt) >= PAGE_OFFSET2 ? (virt) - PAGE_OFFSET2 + 0x80000000 : \69(virt) >= PAGE_OFFSET1 ? (virt) - PAGE_OFFSET1 + 0x20000000 : \70(virt) - PAGE_OFFSET)7172#endif /* CONFIG_SPARSEMEM */7374#endif757677