blob: 944a1517ba5ffebfd4b7e3e09db185b60cbb9172 [file] [log] [blame]
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +03001/*
2 * Copyright (C) 2018 Marvell International Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 * https://spdx.org/licenses
6 */
7
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00008#ifndef PLATFORM_DEF_H
9#define PLATFORM_DEF_H
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030010
Julius Werner53456fc2019-07-09 13:49:11 -070011#ifndef __ASSEMBLER__
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030012#include <stdio.h>
Julius Werner53456fc2019-07-09 13:49:11 -070013#endif /* __ASSEMBLER__ */
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030014
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000015#include <common/interrupt_props.h>
16#include <drivers/arm/gic_common.h>
17
18#include <board_marvell_def.h>
19#include <mvebu_def.h>
20
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030021/*
22 * Most platform porting definitions provided by included headers
23 */
24
25/*
26 * DRAM Memory layout:
27 * +-----------------------+
28 * : :
29 * : Linux :
30 * 0x04X00000-->+-----------------------+
31 * | BL3-3(u-boot) |>>}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
32 * |-----------------------| } |
33 * | BL3-[0,1, 2] | }---------------------------------> |
34 * |-----------------------| } || |
35 * | BL2 | }->FIP (loaded by || |
36 * |-----------------------| } BootROM to DRAM) || |
37 * | FIP_TOC | } || |
38 * 0x04120000-->|-----------------------| || |
39 * | BL1 (RO) | || |
40 * 0x04100000-->+-----------------------+ || |
41 * : : || |
42 * : Trusted SRAM section : \/ |
43 * 0x04040000-->+-----------------------+ Replaced by BL2 +----------------+ |
44 * | BL1 (RW) | <<<<<<<<<<<<<<<< | BL3-1 NOBITS | |
45 * 0x04037000-->|-----------------------| <<<<<<<<<<<<<<<< |----------------| |
46 * | | <<<<<<<<<<<<<<<< | BL3-1 PROGBITS | |
47 * 0x04023000-->|-----------------------| +----------------+ |
48 * | BL2 | |
49 * |-----------------------| |
50 * | | |
51 * 0x04001000-->|-----------------------| |
52 * | Shared | |
53 * 0x04000000-->+-----------------------+ |
54 * : : |
55 * : Linux : |
56 * : : |
57 * |-----------------------| |
58 * | | U-Boot(BL3-3) Loaded by BL2 |
59 * | U-Boot | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
60 * 0x00000000-->+-----------------------+
61 *
62 * Trusted SRAM section 0x4000000..0x4200000:
63 * ----------------------------------------
64 * SRAM_BASE = 0x4001000
65 * BL2_BASE = 0x4006000
66 * BL2_LIMIT = BL31_BASE
67 * BL31_BASE = 0x4023000 = (64MB + 256KB - 0x1D000)
68 * BL31_PROGBITS_LIMIT = BL1_RW_BASE
69 * BL1_RW_BASE = 0x4037000 = (64MB + 256KB - 0x9000)
70 * BL1_RW_LIMIT = BL31_LIMIT = 0x4040000
71 *
72 *
73 * PLAT_MARVELL_FIP_BASE = 0x4120000
74 */
75
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030076#define PLAT_MARVELL_SRAM_BASE 0xFFE1C048
77#define PLAT_MARVELL_SRAM_END 0xFFE78000
78
79#define PLAT_MARVELL_ATF_BASE 0x4000000
80#define PLAT_MARVELL_ATF_LOAD_ADDR (PLAT_MARVELL_ATF_BASE + \
81 0x100000)
82
83#define PLAT_MARVELL_FIP_BASE (PLAT_MARVELL_ATF_LOAD_ADDR + \
84 0x20000)
85#define PLAT_MARVELL_FIP_MAX_SIZE 0x4000000
86
87#define PLAT_MARVELL_NORTHB_COUNT 1
88
Deepika Bhavnanibd01be62019-12-13 10:50:07 -060089#define PLAT_MARVELL_CLUSTER_COUNT U(2)
90#define PLAT_MARVELL_CLUSTER_CORE_COUNT U(2)
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030091
92#define PLAT_MARVELL_CORE_COUNT (PLAT_MARVELL_CLUSTER_COUNT * \
93 PLAT_MARVELL_CLUSTER_CORE_COUNT)
94
Konstantin Porotchkin5f8630b2020-06-19 17:48:48 +020095/* Part of DRAM that is used as Trusted ROM */
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +030096#define PLAT_MARVELL_TRUSTED_ROM_BASE PLAT_MARVELL_ATF_LOAD_ADDR
Marcin Wojtasd2a19cc2020-06-19 17:51:08 +020097/* 4 MB for FIP image */
98#define PLAT_MARVELL_TRUSTED_ROM_SIZE 0x00400000
Konstantin Porotchkin28503262019-04-15 16:32:59 +030099/* Reserve 12MB for SCP (Secure PayLoad) Trusted RAM
100 * OP-TEE 4MB SHMEM follows this region
Konstantin Porotchkinb5fa64a2019-04-15 16:25:59 +0300101 */
Konstantin Porotchkin5f8630b2020-06-19 17:48:48 +0200102#define PLAT_MARVELL_TRUSTED_RAM_BASE 0x04400000
Konstantin Porotchkinb5fa64a2019-04-15 16:25:59 +0300103#define PLAT_MARVELL_TRUSTED_RAM_SIZE 0x00C00000 /* 12 MB DRAM */
Konstantin Porotchkin5f8630b2020-06-19 17:48:48 +0200104
Konstantin Porotchkin28503262019-04-15 16:32:59 +0300105#define PLAT_MARVELL_LLC_SRAM_BASE 0x05400000
Konstantin Porotchkin5f8630b2020-06-19 17:48:48 +0200106#define PLAT_MARVELL_LLC_SRAM_SIZE 0x00100000 /* 1 MB SRAM */
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300107
108/*
109 * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size
110 * plus a little space for growth.
111 */
112#define PLAT_MARVELL_MAX_BL1_RW_SIZE 0xA000
113
114/*
115 * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a
116 * little space for growth.
117 */
118#define PLAT_MARVELL_MAX_BL2_SIZE 0xF000
119
120/*
121 * PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a
122 * little space for growth.
123 */
124#define PLAT_MARVEL_MAX_BL31_SIZE 0x5D000
125
126#define PLAT_MARVELL_CPU_ENTRY_ADDR BL1_RO_BASE
127
128/* GIC related definitions */
129#define PLAT_MARVELL_GICD_BASE (MVEBU_REGS_BASE + MVEBU_GICD_BASE)
130#define PLAT_MARVELL_GICC_BASE (MVEBU_REGS_BASE + MVEBU_GICC_BASE)
131
132#define PLAT_MARVELL_G0_IRQ_PROPS(grp) \
133 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_0, GIC_HIGHEST_SEC_PRIORITY, grp, \
134 GIC_INTR_CFG_LEVEL), \
135 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, grp, \
Marcin Wojtas0c60c2f2018-03-21 09:59:59 +0100136 GIC_INTR_CFG_LEVEL), \
137 INTR_PROP_DESC(MARVELL_IRQ_PIC0, GIC_HIGHEST_SEC_PRIORITY, grp, \
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300138 GIC_INTR_CFG_LEVEL)
139
140#define PLAT_MARVELL_G1S_IRQ_PROPS(grp) \
141 INTR_PROP_DESC(MARVELL_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, \
142 grp, GIC_INTR_CFG_LEVEL), \
143 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_1, GIC_HIGHEST_SEC_PRIORITY, grp, \
144 GIC_INTR_CFG_LEVEL), \
145 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_2, GIC_HIGHEST_SEC_PRIORITY, grp, \
146 GIC_INTR_CFG_LEVEL), \
147 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_3, GIC_HIGHEST_SEC_PRIORITY, grp, \
148 GIC_INTR_CFG_LEVEL), \
149 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_4, GIC_HIGHEST_SEC_PRIORITY, grp, \
150 GIC_INTR_CFG_LEVEL), \
151 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_5, GIC_HIGHEST_SEC_PRIORITY, grp, \
152 GIC_INTR_CFG_LEVEL), \
153 INTR_PROP_DESC(MARVELL_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
154 GIC_INTR_CFG_LEVEL)
155
156#define PLAT_MARVELL_SHARED_RAM_CACHED 1
157
158/*
159 * Load address of BL3-3 for this platform port
160 */
161#define PLAT_MARVELL_NS_IMAGE_OFFSET 0x0
162
163/* System Reference Clock*/
164#define PLAT_REF_CLK_IN_HZ COUNTER_FREQUENCY
165
166/*
167 * PL011 related constants
168 */
169#define PLAT_MARVELL_BOOT_UART_BASE (MVEBU_REGS_BASE + 0x512000)
170#define PLAT_MARVELL_BOOT_UART_CLK_IN_HZ 200000000
171
172#define PLAT_MARVELL_CRASH_UART_BASE PLAT_MARVELL_BOOT_UART_BASE
173#define PLAT_MARVELL_CRASH_UART_CLK_IN_HZ PLAT_MARVELL_BOOT_UART_CLK_IN_HZ
174
175#define PLAT_MARVELL_BL31_RUN_UART_BASE PLAT_MARVELL_BOOT_UART_BASE
176#define PLAT_MARVELL_BL31_RUN_UART_CLK_IN_HZ PLAT_MARVELL_BOOT_UART_CLK_IN_HZ
177
178/* Recovery image enable */
179#define PLAT_RECOVERY_IMAGE_ENABLE 0
180
181/* Required platform porting definitions */
182#define PLAT_MAX_PWR_LVL MPIDR_AFFLVL1
183
184/* System timer related constants */
185#define PLAT_MARVELL_NSTIMER_FRAME_ID 1
186
187/* Mailbox base address (note the lower memory space
188 * is reserved for BLE data)
189 */
Konstantin Porotchkin5f8630b2020-06-19 17:48:48 +0200190#define PLAT_MARVELL_MAILBOX_BASE (MARVELL_SHARED_RAM_BASE \
191 + 0x400)
Konstantin Porotchkinf69ec582018-06-07 18:31:14 +0300192#define PLAT_MARVELL_MAILBOX_SIZE 0x100
193#define PLAT_MARVELL_MAILBOX_MAGIC_NUM 0x6D72766C /* mrvl */
194
195/* Securities */
196#define IRQ_SEC_OS_TICK_INT MARVELL_IRQ_SEC_PHY_TIMER
197
Marcin Wojtas0c60c2f2018-03-21 09:59:59 +0100198#define MVEBU_PMU_IRQ_WA
199
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +0000200#endif /* PLATFORM_DEF_H */