1 /*
2  *  linux/include/asm-arm/arch-mx1ads/memory.h
3  *
4  *  Copyright (C) 1999 ARM Limited
5  *  Copyright (C) 2002 Shane Nay (shane@minirl.com)
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21 #ifndef __ASM_ARCH_MMU_H
22 #define __ASM_ARCH_MMU_H
23 
24 /*
25  * Task size: 3GB
26  */
27 #define TASK_SIZE	(0xc0000000UL)
28 #define TASK_SIZE_26	(0x04000000UL)
29 
30 /*
31  * This decides where the kernel will search for a free chunk of vm
32  * space during mmap's.
33  */
34 #define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
35 
36 /*
37  * Page offset: 3GB
38  */
39 /* Note
40  * This should be hot-swapable with a CONFIG_MX1ADS_SDRAM
41  * or something similar, so we can swap between SRAM and
42  * SDRAM running kernel.
43  */
44 
45 #ifdef CONFIG_ARCH_MX1ADS_SRAM
46 #define PAGE_OFFSET	(0xc0000000UL)
47 #define PHYS_OFFSET	(0x12000000UL)
48 #else
49 #define PAGE_OFFSET	(0xc0000000UL)
50 #define PHYS_OFFSET	(0x08000000UL)
51 #endif
52 
53 /*
54  * On mx1, the sdram/sram is contiguous
55  */
56 #define __virt_to_phys__is_a_macro
57 #define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
58 #define __phys_to_virt__is_a_macro
59 #define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
60 
61 /*
62  * Virtual view <-> DMA view memory address translations
63  * virt_to_bus: Used to translate the virtual address to an
64  *              address suitable to be passed to set_dma_addr
65  * bus_to_virt: Used to convert an address for DMA operations
66  *              to an address that the kernel can use.
67  */
68 #define __virt_to_bus__is_a_macro
69 #define __virt_to_bus(x)	(x - PAGE_OFFSET +  PHYS_OFFSET)
70 #define __bus_to_virt__is_a_macro
71 #define __bus_to_virt(x)	(x -  PHYS_OFFSET + PAGE_OFFSET)
72 
73 #endif
74