Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | 6f3ccc5 | 2018-07-20 09:17:26 +0100 | [diff] [blame] | 2 | * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved. |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
Antonio Nino Diaz | 6f3ccc5 | 2018-07-20 09:17:26 +0100 | [diff] [blame] | 7 | #ifndef PLATFORM_DEF_H |
| 8 | #define PLATFORM_DEF_H |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 9 | |
| 10 | #include <arch.h> |
Jeenu Viswambharan | 9bde130 | 2017-09-29 11:15:18 +0100 | [diff] [blame] | 11 | #include <gic_common.h> |
| 12 | #include <interrupt_props.h> |
Antonio Nino Diaz | 6f3ccc5 | 2018-07-20 09:17:26 +0100 | [diff] [blame] | 13 | #include <utils_def.h> |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 14 | #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 Diaz | 6f3ccc5 | 2018-07-20 09:17:26 +0100 | [diff] [blame] | 25 | #define PLAT_MAX_PWR_LVL U(1) |
| 26 | #define PLAT_MAX_RET_STATE U(1) |
| 27 | #define PLAT_MAX_OFF_STATE U(2) |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 28 | |
| 29 | /******************************************************************************* |
| 30 | * BL31 specific defines. |
| 31 | ******************************************************************************/ |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 32 | /* |
| 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 Brinkmann | 4a9ca04 | 2016-04-14 10:27:00 -0700 | [diff] [blame] | 37 | #ifndef ZYNQMP_ATF_MEM_BASE |
Siva Durga Prasad Paladugu | ee1a114 | 2018-06-20 17:01:13 +0530 | [diff] [blame] | 38 | #if !DEBUG && defined(SPD_none) |
Soren Brinkmann | 802ba1d | 2016-07-15 06:23:37 -0700 | [diff] [blame] | 39 | # define BL31_BASE 0xfffea000 |
Soren Brinkmann | 4a9ca04 | 2016-04-14 10:27:00 -0700 | [diff] [blame] | 40 | # define BL31_LIMIT 0xffffffff |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 41 | #else |
Jolly Shah | 8f5ddb3 | 2018-01-30 11:31:53 -0800 | [diff] [blame] | 42 | # define BL31_BASE 0x1000 |
| 43 | # define BL31_LIMIT 0x7ffff |
| 44 | #endif |
| 45 | #else |
Soren Brinkmann | 4a9ca04 | 2016-04-14 10:27:00 -0700 | [diff] [blame] | 46 | # 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 Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 51 | #endif |
| 52 | |
| 53 | /******************************************************************************* |
| 54 | * BL32 specific defines. |
| 55 | ******************************************************************************/ |
Soren Brinkmann | 4a9ca04 | 2016-04-14 10:27:00 -0700 | [diff] [blame] | 56 | #ifndef ZYNQMP_BL32_MEM_BASE |
| 57 | # define BL32_BASE 0x60000000 |
| 58 | # define BL32_LIMIT 0x7fffffff |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 59 | #else |
Soren Brinkmann | 4a9ca04 | 2016-04-14 10:27:00 -0700 | [diff] [blame] | 60 | # define BL32_BASE (ZYNQMP_BL32_MEM_BASE) |
| 61 | # define BL32_LIMIT (ZYNQMP_BL32_MEM_BASE + ZYNQMP_BL32_MEM_SIZE - 1) |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 62 | #endif |
| 63 | |
Soren Brinkmann | 4a9ca04 | 2016-04-14 10:27:00 -0700 | [diff] [blame] | 64 | /******************************************************************************* |
| 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 Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 80 | #define TSP_IRQ_SEC_PHY_TIMER ARM_IRQ_SEC_PHY_TIMER |
| 81 | |
| 82 | /******************************************************************************* |
| 83 | * Platform specific page table and MMU setup constants |
| 84 | ******************************************************************************/ |
David Cunado | c150312 | 2018-02-16 21:12:58 +0000 | [diff] [blame] | 85 | #define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 32) |
| 86 | #define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 32) |
Soren Brinkmann | 6d1ba58 | 2016-07-08 14:45:14 -0700 | [diff] [blame] | 87 | #define MAX_MMAP_REGIONS 7 |
Soren Brinkmann | 7ac746c | 2016-07-25 10:33:53 -0700 | [diff] [blame] | 88 | #define MAX_XLAT_TABLES 5 |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 89 | |
| 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 Viswambharan | 9bde130 | 2017-09-29 11:15:18 +0100 | [diff] [blame] | 96 | * Define properties of Group 1 Secure and Group 0 interrupts as per GICv3 |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 97 | * terminology. On a GICv2 system or mode, the lists will be merged and treated |
| 98 | * as Group 0 interrupts. |
| 99 | */ |
Siva Durga Prasad Paladugu | efd431b | 2018-04-30 20:12:12 +0530 | [diff] [blame] | 100 | #if !ZYNQMP_WDT_RESTART |
Jeenu Viswambharan | 9bde130 | 2017-09-29 11:15:18 +0100 | [diff] [blame] | 101 | #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 Paladugu | efd431b | 2018-04-30 20:12:12 +0530 | [diff] [blame] | 120 | #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 Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 143 | |
Jeenu Viswambharan | 9bde130 | 2017-09-29 11:15:18 +0100 | [diff] [blame] | 144 | #define PLAT_ARM_G0_IRQ_PROPS(grp) |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 145 | |
Antonio Nino Diaz | 6f3ccc5 | 2018-07-20 09:17:26 +0100 | [diff] [blame] | 146 | #endif /* PLATFORM_DEF_H */ |