blob: d721778d3002f85faa7679f94521eb7e0d666923 [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
Antonio Nino Diaz6f3ccc52018-07-20 09:17:26 +01002 * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
Soren Brinkmann76fcae32016-03-06 20:16:27 -08003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soren Brinkmann76fcae32016-03-06 20:16:27 -08005 */
6
Antonio Nino Diaz6f3ccc52018-07-20 09:17:26 +01007#ifndef PLATFORM_DEF_H
8#define PLATFORM_DEF_H
Soren Brinkmann76fcae32016-03-06 20:16:27 -08009
10#include <arch.h>
Jeenu Viswambharan9bde1302017-09-29 11:15:18 +010011#include <gic_common.h>
12#include <interrupt_props.h>
Antonio Nino Diaz6f3ccc52018-07-20 09:17:26 +010013#include <utils_def.h>
Soren Brinkmann76fcae32016-03-06 20:16:27 -080014#include "../zynqmp_def.h"
15
16/*******************************************************************************
17 * Generic platform constants
18 ******************************************************************************/
19
20/* Size of cacheable stacks */
21#define PLATFORM_STACK_SIZE 0x440
22
23#define PLATFORM_CORE_COUNT 4
24#define PLAT_NUM_POWER_DOMAINS 5
Antonio Nino Diaz6f3ccc52018-07-20 09:17:26 +010025#define PLAT_MAX_PWR_LVL U(1)
26#define PLAT_MAX_RET_STATE U(1)
27#define PLAT_MAX_OFF_STATE U(2)
Soren Brinkmann76fcae32016-03-06 20:16:27 -080028
29/*******************************************************************************
30 * BL31 specific defines.
31 ******************************************************************************/
Soren Brinkmann76fcae32016-03-06 20:16:27 -080032/*
33 * Put BL31 at the top of the Trusted SRAM (just below the shared memory, if
34 * present). BL31_BASE is calculated using the current BL31 debug size plus a
35 * little space for growth.
36 */
Soren Brinkmann4a9ca042016-04-14 10:27:00 -070037#ifndef ZYNQMP_ATF_MEM_BASE
Siva Durga Prasad Paladuguee1a1142018-06-20 17:01:13 +053038#if !DEBUG && defined(SPD_none)
Soren Brinkmann802ba1d2016-07-15 06:23:37 -070039# define BL31_BASE 0xfffea000
Soren Brinkmann4a9ca042016-04-14 10:27:00 -070040# define BL31_LIMIT 0xffffffff
Soren Brinkmann76fcae32016-03-06 20:16:27 -080041#else
Jolly Shah8f5ddb32018-01-30 11:31:53 -080042# define BL31_BASE 0x1000
43# define BL31_LIMIT 0x7ffff
44#endif
45#else
Soren Brinkmann4a9ca042016-04-14 10:27:00 -070046# define BL31_BASE (ZYNQMP_ATF_MEM_BASE)
47# define BL31_LIMIT (ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_SIZE - 1)
48# ifdef ZYNQMP_ATF_MEM_PROGBITS_SIZE
49# define BL31_PROGBITS_LIMIT (ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_PROGBITS_SIZE - 1)
50# endif
Soren Brinkmann76fcae32016-03-06 20:16:27 -080051#endif
52
53/*******************************************************************************
54 * BL32 specific defines.
55 ******************************************************************************/
Soren Brinkmann4a9ca042016-04-14 10:27:00 -070056#ifndef ZYNQMP_BL32_MEM_BASE
57# define BL32_BASE 0x60000000
58# define BL32_LIMIT 0x7fffffff
Soren Brinkmann76fcae32016-03-06 20:16:27 -080059#else
Soren Brinkmann4a9ca042016-04-14 10:27:00 -070060# define BL32_BASE (ZYNQMP_BL32_MEM_BASE)
61# define BL32_LIMIT (ZYNQMP_BL32_MEM_BASE + ZYNQMP_BL32_MEM_SIZE - 1)
Soren Brinkmann76fcae32016-03-06 20:16:27 -080062#endif
63
Soren Brinkmann4a9ca042016-04-14 10:27:00 -070064/*******************************************************************************
65 * BL33 specific defines.
66 ******************************************************************************/
67#ifndef PRELOADED_BL33_BASE
68# define PLAT_ARM_NS_IMAGE_OFFSET 0x8000000
69#else
70# define PLAT_ARM_NS_IMAGE_OFFSET PRELOADED_BL33_BASE
71#endif
72
73/*******************************************************************************
74 * TSP specific defines.
75 ******************************************************************************/
76#define TSP_SEC_MEM_BASE BL32_BASE
77#define TSP_SEC_MEM_SIZE (BL32_LIMIT - BL32_BASE + 1)
78
79/* ID of the secure physical generic timer interrupt used by the TSP */
Soren Brinkmann76fcae32016-03-06 20:16:27 -080080#define TSP_IRQ_SEC_PHY_TIMER ARM_IRQ_SEC_PHY_TIMER
81
82/*******************************************************************************
83 * Platform specific page table and MMU setup constants
84 ******************************************************************************/
David Cunadoc1503122018-02-16 21:12:58 +000085#define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 32)
86#define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 32)
Soren Brinkmann6d1ba582016-07-08 14:45:14 -070087#define MAX_MMAP_REGIONS 7
Soren Brinkmann7ac746c2016-07-25 10:33:53 -070088#define MAX_XLAT_TABLES 5
Soren Brinkmann76fcae32016-03-06 20:16:27 -080089
90#define CACHE_WRITEBACK_SHIFT 6
91#define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT)
92
93#define PLAT_ARM_GICD_BASE BASE_GICD_BASE
94#define PLAT_ARM_GICC_BASE BASE_GICC_BASE
95/*
Jeenu Viswambharan9bde1302017-09-29 11:15:18 +010096 * Define properties of Group 1 Secure and Group 0 interrupts as per GICv3
Soren Brinkmann76fcae32016-03-06 20:16:27 -080097 * terminology. On a GICv2 system or mode, the lists will be merged and treated
98 * as Group 0 interrupts.
99 */
Siva Durga Prasad Paladuguefd431b2018-04-30 20:12:12 +0530100#if !ZYNQMP_WDT_RESTART
Jeenu Viswambharan9bde1302017-09-29 11:15:18 +0100101#define PLAT_ARM_G1S_IRQ_PROPS(grp) \
102 INTR_PROP_DESC(ARM_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, grp, \
103 GIC_INTR_CFG_LEVEL), \
104 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_0, GIC_HIGHEST_SEC_PRIORITY, grp, \
105 GIC_INTR_CFG_EDGE), \
106 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_1, GIC_HIGHEST_SEC_PRIORITY, grp, \
107 GIC_INTR_CFG_EDGE), \
108 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_2, GIC_HIGHEST_SEC_PRIORITY, grp, \
109 GIC_INTR_CFG_EDGE), \
110 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_3, GIC_HIGHEST_SEC_PRIORITY, grp, \
111 GIC_INTR_CFG_EDGE), \
112 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_4, GIC_HIGHEST_SEC_PRIORITY, grp, \
113 GIC_INTR_CFG_EDGE), \
114 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_5, GIC_HIGHEST_SEC_PRIORITY, grp, \
115 GIC_INTR_CFG_EDGE), \
116 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, grp, \
117 GIC_INTR_CFG_EDGE), \
118 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
119 GIC_INTR_CFG_EDGE)
Siva Durga Prasad Paladuguefd431b2018-04-30 20:12:12 +0530120#else
121#define PLAT_ARM_G1S_IRQ_PROPS(grp) \
122 INTR_PROP_DESC(ARM_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, grp, \
123 GIC_INTR_CFG_LEVEL), \
124 INTR_PROP_DESC(IRQ_TTC3_1, GIC_HIGHEST_SEC_PRIORITY, grp, \
125 GIC_INTR_CFG_EDGE), \
126 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_0, GIC_HIGHEST_SEC_PRIORITY, grp, \
127 GIC_INTR_CFG_EDGE), \
128 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_1, GIC_HIGHEST_SEC_PRIORITY, grp, \
129 GIC_INTR_CFG_EDGE), \
130 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_2, GIC_HIGHEST_SEC_PRIORITY, grp, \
131 GIC_INTR_CFG_EDGE), \
132 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_3, GIC_HIGHEST_SEC_PRIORITY, grp, \
133 GIC_INTR_CFG_EDGE), \
134 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_4, GIC_HIGHEST_SEC_PRIORITY, grp, \
135 GIC_INTR_CFG_EDGE), \
136 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_5, GIC_HIGHEST_SEC_PRIORITY, grp, \
137 GIC_INTR_CFG_EDGE), \
138 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, grp, \
139 GIC_INTR_CFG_EDGE), \
140 INTR_PROP_DESC(ARM_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
141 GIC_INTR_CFG_EDGE)
142#endif
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800143
Jeenu Viswambharan9bde1302017-09-29 11:15:18 +0100144#define PLAT_ARM_G0_IRQ_PROPS(grp)
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800145
Antonio Nino Diaz6f3ccc52018-07-20 09:17:26 +0100146#endif /* PLATFORM_DEF_H */