1 |
2 |
drasko |
/*
|
2 |
|
|
* Mock-up memory layout definitions for test purposes.
|
3 |
|
|
*
|
4 |
|
|
* Copyright (C) 2007 Bahadir Balban
|
5 |
|
|
*
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
#ifndef __BASICLAYOUT_H__
|
9 |
|
|
#define __BASICLAYOUT_H__
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
#ifndef __ASSEMBLY__
|
13 |
|
|
#include INC_GLUE(memory.h)
|
14 |
|
|
#endif
|
15 |
|
|
#include INC_PLAT(offsets.h)
|
16 |
|
|
|
17 |
|
|
#define RESERVED_AREA_START 0x0
|
18 |
|
|
#define RESERVED_AREA_END 0x00400000
|
19 |
|
|
#define RESERVED_AREA_SIZE (RESERVED_AREA_END - RESERVED_AREA_START)
|
20 |
|
|
#define RESERVED_AREA_SECTIONS (RESERVED_AREA_SIZE / ARM_SECTION_SIZE)
|
21 |
|
|
|
22 |
|
|
/* 0x00400000 */
|
23 |
|
|
#define USER_AREA_START 0x00400000
|
24 |
|
|
#define USER_AREA_END 0xF0000000
|
25 |
|
|
#define USER_AREA_SIZE (USER_AREA_END - USER_AREA_START)
|
26 |
|
|
#define USER_AREA_SECTIONS (USER_AREA_SIZE / ARM_SECTION_SIZE)
|
27 |
|
|
|
28 |
|
|
/* 0xf0000000 */
|
29 |
|
|
#define KERNEL_AREA_START 0xF0000000
|
30 |
|
|
#define KERNEL_AREA_END 0xF4000000
|
31 |
|
|
#define KERNEL_AREA_SIZE (KERNEL_AREA_END - KERNEL_AREA_START)
|
32 |
|
|
#define KERNEL_AREA_SECTIONS (KERNEL_AREA_SIZE / ARM_SECTION_SIZE)
|
33 |
|
|
|
34 |
|
|
/* Kernel offset is taken as virtual memory base */
|
35 |
|
|
#define VIRT_ADDR_BASE KERNEL_AREA_START
|
36 |
|
|
|
37 |
|
|
/* 0xf4000000 */
|
38 |
|
|
#define UNCACHE_AREA_START 0xF4000000
|
39 |
|
|
#define UNCACHE_AREA_END 0xF8000000
|
40 |
|
|
#define UNCACHE_AREA_SIZE (UNCACHE_AREA_END - UNCACHE_AREA_START)
|
41 |
|
|
#define UNCACHE_AREA_SECTIONS (UNCACHE_AREA_SIZE / ARM_SECTION_SIZE)
|
42 |
|
|
|
43 |
|
|
/* The page tables are the main clients of uncached virtual memory */
|
44 |
|
|
#define PGTABLE_ADDR_BASE UNCACHE_AREA_START
|
45 |
|
|
|
46 |
|
|
/* 0xf8000000 */
|
47 |
|
|
#define VAR_AREA_START 0xF8000000
|
48 |
|
|
#define VAR_AREA_END 0xF9000000
|
49 |
|
|
#define VAR_AREA_SIZE (VAR_AREA_END - VAR_AREA_START)
|
50 |
|
|
#define VAR_AREA_SECTIONS (VAR_AREA_SIZE / ARM_SECTION_SIZE)
|
51 |
|
|
|
52 |
|
|
/* 0xf9000000 */
|
53 |
|
|
#define IO_AREA_START 0xF9000000
|
54 |
|
|
#define IO_AREA_END 0xFF000000
|
55 |
|
|
#define IO_AREA_SIZE (IO_AREA_END - IO_AREA_START)
|
56 |
|
|
#define IO_AREA_SECTIONS (IO_AREA_SIZE / ARM_SECTION_SIZE)
|
57 |
|
|
|
58 |
|
|
/* 0xff000000 */
|
59 |
|
|
#define MISC_AREA_START 0xFF000000
|
60 |
|
|
#define MISC_AREA_END 0xFFF00000
|
61 |
|
|
#define MISC_AREA_SIZE (MISC_AREA_END - MISC_AREA_START)
|
62 |
|
|
#define MISC_AREA_SECTIONS (MISC_AREA_SIZE / ARM_SECTION_SIZE)
|
63 |
|
|
|
64 |
|
|
/* First page in MISC area is used for KIP/UTCB reference page */
|
65 |
|
|
#define USER_KIP_PAGE MISC_AREA_START
|
66 |
|
|
|
67 |
|
|
/* 0xfff00000 */
|
68 |
|
|
#define EXCPT_AREA_START 0xFFF00000
|
69 |
|
|
#define EXCPT_AREA_END (EXCPT_AREA_START + ARM_SECTION_SIZE)
|
70 |
|
|
#define EXCPT_AREA_SIZE (EXCPT_AREA_END - EXCPT_AREA_START)
|
71 |
|
|
|
72 |
|
|
/* 1MB IO Areas in the Virtual Address space. Define more if needed */
|
73 |
|
|
#define IO_AREA0_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*0))
|
74 |
|
|
#define IO_AREA1_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*1))
|
75 |
|
|
#define IO_AREA2_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*2))
|
76 |
|
|
#define IO_AREA3_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*3))
|
77 |
|
|
#define IO_AREA4_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*4))
|
78 |
|
|
#define IO_AREA5_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*5))
|
79 |
|
|
#define IO_AREA6_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*6))
|
80 |
|
|
#define IO_AREA7_VADDR (IO_AREA_START + (ARM_SECTION_SIZE*7))
|
81 |
|
|
|
82 |
|
|
/*
|
83 |
|
|
* Address of start of arm_high_vector - exception handling code
|
84 |
|
|
*/
|
85 |
|
|
#define ARM_HIGH_VECTOR_VADDR (EXCPT_AREA_START | 0x000f0000 )
|
86 |
|
|
#define ARM_SYSCALL_VECTOR (0xffffff00)
|
87 |
|
|
|
88 |
|
|
/*
|
89 |
|
|
* These offsets depend on where the platform defines its physical memory
|
90 |
|
|
* and how the system defines the virtual memory regions in arm/basiclayout.h
|
91 |
|
|
*/
|
92 |
|
|
//#define KERNEL_OFFSET (VIRT_ADDR_BASE - PHYS_ADDR_BASE)
|
93 |
|
|
//#define PGTABLE_OFFSET (PGTABLE_ADDR_BASE - PGTABLE_PHYS_ADDR_BASE)
|
94 |
|
|
/* Use a more predictible offset by just changing the top nibble */
|
95 |
|
|
#define KERNEL_OFFSET VIRT_ADDR_BASE
|
96 |
|
|
#define PGTABLE_OFFSET PGTABLE_ADDR_BASE
|
97 |
|
|
|
98 |
|
|
/*
|
99 |
|
|
* Convenience macros for converting between address types.
|
100 |
|
|
*/
|
101 |
|
|
#if defined(__KERNEL__)
|
102 |
|
|
#define phys_to_virt(addr) ((unsigned int)addr)
|
103 |
|
|
#define phys_to_ptab(addr) ((unsigned int)addr)
|
104 |
|
|
#define virt_to_phys(addr) ((unsigned int)addr)
|
105 |
|
|
#define virt_to_ptab(addr) (phys_to_ptab(virt_to_phys(addr)))
|
106 |
|
|
#endif
|
107 |
|
|
#endif /* __BASICLAYOUT_H__ */
|