1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - HW - include
3   File:     mmap_main.h
4 
5   Copyright 2003-2008 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-18#$
14   $Rev: 8573 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 #ifndef NITRO_HW_MMAP_MAIN_H_
18 #define NITRO_HW_MMAP_MAIN_H_
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 //---------------------------------------------------------------------------
25 // MEMORY MAP of MAIN MEMORY
26 //---------------------------------------------------------------------------
27 //
28 //
29 //      Retail NITRO            Development NITRO
30 //      +---------------+-------+---------------+--8.000M
31 //      | System Shared |       | System Shared |
32 //      +---------------+-------+---------------+
33 //      | User   Shared |       | User   Shared |
34 //      +---------------+-------+---------------+
35 //      | Sub Processor |       | Sub Processor |
36 //      | Reserved      |       | Reserved      |
37 //      +-+-------------+-------+---------------+--7.875M
38 //      |W|             |       |               |
39 //      |R|Main         |       | Debugger Work |
40 //      |A|Processor    |       |               |
41 //      |P|Reserved     |       +---------------+--7.000M
42 //      | |             |       |               |
43 //      |A|             |       | Main          |
44 //      |R|             |       | Processor     |
45 //      |O+-------------+--4M---+ Extra         +--4.000M
46 //      |U|System Shared|       | Reserved      |
47 //      |N+-------------+       |               |
48 //      |D|User   Shared|       |               |
49 //      | +-------------+       +               +
50 //      | |Sub Processor|       |               |
51 //      | |Reserved     |       |               |
52 //      +-+-------------+-------+---------------+--3.875M
53 //      |               |       |               |
54 //      | Main          |       | Main          |
55 //      | Processor     |       | Processor     |
56 //      | Reserved      |       | Reserved      |
57 //      |               |       |               |
58 //      |               |       |               |
59 //      |               |       |               |
60 //      +---------------+       +---------------+
61 //
62 //      Default setting for 4MB
63 //         MAIN  :3.875MB
64 //         SUB   :124KB
65 //         SHARED:  4KB
66 //         DTCM  :on top of SUB
67 //
68 
69 #define HW_MAIN_MEM_SHARED_SIZE         0x001000
70 
71 // HW_MAIN_MEM_MAIN_SIZE is able to be changed, but need to arrange ARM7 module.
72 // If you use the Mongoose as ARM7 module, maybe 0x3e0000 is almost maximum size.
73 #ifdef SDK_TS
74 #define HW_MAIN_MEM_MAIN_SIZE           0x3E0000
75 #else
76 #define HW_MAIN_MEM_MAIN_SIZE           0x380000
77 #endif
78 #define HW_MAIN_MEM_SUB_SIZE            (HW_MAIN_MEM_SIZE - HW_MAIN_MEM_MAIN_SIZE - HW_MAIN_MEM_SHARED_SIZE)
79 
80 #define HW_MAIN_MEM_MAIN                (HW_MAIN_MEM)
81 #define HW_MAIN_MEM_MAIN_END            (HW_MAIN_MEM + HW_MAIN_MEM_MAIN_SIZE)
82 #define HW_MAIN_MEM_SUB                 (HW_MAIN_MEM_MAIN_END + 0x400000)
83 #define HW_MAIN_MEM_SUB_END             (HW_MAIN_MEM_SUB + HW_MAIN_MEM_SUB_SIZE)
84 
85 #define HW_MAIN_MEM_DEBUGGER_OFFSET     0x700000
86 #define HW_MAIN_MEM_DEBUGGER_SIZE       0x080000
87 #define HW_MAIN_MEM_DEBUGGER            (HW_MAIN_MEM + HW_MAIN_MEM_DEBUGGER_OFFSET)
88 #define HW_MAIN_MEM_DEBUGGER_END        (HW_MAIN_MEM_DEBUGGER + HW_MAIN_MEM_DEBUGGER_SIZE)
89 
90 #define HW_MAIN_MEM_SHARED              (HW_MAIN_MEM_EX_END - HW_MAIN_MEM_SHARED_SIZE)
91 #define HW_MAIN_MEM_SHARED_END          (HW_MAIN_MEM_EX_END - HW_MAIN_MEM_SYSTEM_SIZE)
92 
93 #define HW_MAIN_MEM_IM_SHARED_SIZE      (HW_MAIN_MEM_SHARED_SIZE)
94 #define HW_MAIN_MEM_IM_SHARED           (HW_MAIN_MEM_IM_SHARED_END - HW_MAIN_MEM_IM_SHARED_SIZE)
95 #define HW_MAIN_MEM_IM_SHARED_END       (HW_MAIN_MEM + 0x00800000)
96 
97 #define HW_MAIN_MEM_SYSTEM_END          (HW_MAIN_MEM_EX_END)
98 
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102 /* NITRO_HW_MMAP_MAIN_H_ */
103 #endif
104