c1aaee96ddf65ba8f1c4c2237e25c1ea74ed522f
[platform/core/security/tef-optee_os.git] / core / arch / arm / plat-ti / platform_config.h
1 /*
2  * Copyright (c) 2015, Linaro Limited
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  */
27
28 #ifndef PLATFORM_CONFIG_H
29 #define PLATFORM_CONFIG_H
30
31 #if defined(PLATFORM_FLAVOR_dra7xx)
32
33 #define DRAM0_BASE              0xbe000000
34 #define DRAM0_SIZE              0x02000000
35
36 #ifdef CFG_WITH_PAGER
37 #error Pager not supported on this platform
38 #endif /*CFG_WITH_PAGER*/
39
40 /* Location of protected DDR on the DRA7xx platform */
41 #define TZDRAM_BASE             0xbe000000
42 #define TZDRAM_SIZE             0x01c00000
43
44 #define CFG_TEE_CORE_NB_CORE    2
45
46 /* UART1 */
47 #define CONSOLE_UART_BASE               0x4806A000
48 #define CONSOLE_UART_CLK_IN_HZ  48000000
49 #define UART_BAUDRATE                   115200
50
51 #define GIC_BASE        0x48210000
52 #define GICC_OFFSET     0x2000
53 #define GICC_SIZE       0x1000
54 #define GICD_OFFSET     0x1000
55 #define GICD_SIZE       0x1000
56 #define GICC_BASE       (GIC_BASE + GICC_OFFSET)
57 #define GICD_BASE       (GIC_BASE + GICD_OFFSET)
58
59 #define SECRAM_BASE     0x40200000
60
61 /* RNG */
62 #define RNG_BASE        0x48090000
63
64 #else
65 #error "Unknown platform flavor"
66 #endif
67
68 /* Make stacks aligned to data cache line length */
69 #define STACK_ALIGNMENT         64
70
71 /* Full GlobalPlatform test suite requires CFG_SHMEM_SIZE to be at least 2MB */
72 #define CFG_SHMEM_START         (DRAM0_BASE + TZDRAM_SIZE)
73 #define CFG_SHMEM_SIZE          0x400000
74
75 #define CFG_TEE_RAM_VA_SIZE     (1024 * 1024)
76
77 #ifndef CFG_TEE_LOAD_ADDR
78 #define CFG_TEE_LOAD_ADDR       (CFG_TEE_RAM_START + 0x100)
79 #endif
80
81 /*
82  * Assumes that either TZSRAM isn't large enough or TZSRAM doesn't exist,
83  * everything is in TZDRAM.
84  * +------------------+
85  * |        | TEE_RAM |
86  * + TZDRAM +---------+
87  * |        | TA_RAM  |
88  * +--------+---------+
89  */
90 #define CFG_TEE_RAM_PH_SIZE     CFG_TEE_RAM_VA_SIZE
91 #define CFG_TEE_RAM_START       TZDRAM_BASE
92 #define CFG_TA_RAM_START        ROUNDUP((TZDRAM_BASE + CFG_TEE_RAM_VA_SIZE), \
93                                         CORE_MMU_DEVICE_SIZE)
94 #define CFG_TA_RAM_SIZE         ROUNDDOWN((TZDRAM_SIZE - CFG_TEE_RAM_VA_SIZE), \
95                                           CORE_MMU_DEVICE_SIZE)
96
97 #define DEVICE2_PA_BASE         ROUNDDOWN(SECRAM_BASE, CORE_MMU_DEVICE_SIZE)
98 #define DEVICE2_VA_BASE         DEVICE2_PA_BASE
99 #define DEVICE2_SIZE            CORE_MMU_DEVICE_SIZE
100 #define DEVICE2_TYPE            MEM_AREA_IO_SEC
101
102 #ifndef UART_BAUDRATE
103 #define UART_BAUDRATE           115200
104 #endif
105 #ifndef CONSOLE_BAUDRATE
106 #define CONSOLE_BAUDRATE        UART_BAUDRATE
107 #endif
108
109 #endif /*PLATFORM_CONFIG_H*/