Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 1 | /* |
Vikram Kanigiri | eade34c | 2016-01-20 15:57:35 +0000 | [diff] [blame] | 2 | * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved. |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are met: |
| 6 | * |
| 7 | * Redistributions of source code must retain the above copyright notice, this |
| 8 | * list of conditions and the following disclaimer. |
| 9 | * |
| 10 | * Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * Neither the name of ARM nor the names of its contributors may be used |
| 15 | * to endorse or promote products derived from this software without specific |
| 16 | * prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 28 | * POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
| 30 | #ifndef __BOARD_ARM_DEF_H__ |
| 31 | #define __BOARD_ARM_DEF_H__ |
| 32 | |
| 33 | #include <v2m_def.h> |
| 34 | |
| 35 | |
| 36 | /* |
| 37 | * Required platform porting definitions common to all ARM |
| 38 | * development platforms |
| 39 | */ |
| 40 | |
| 41 | /* Size of cacheable stacks */ |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 42 | #if defined(IMAGE_BL1) |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 43 | #if TRUSTED_BOARD_BOOT |
| 44 | # define PLATFORM_STACK_SIZE 0x1000 |
| 45 | #else |
| 46 | # define PLATFORM_STACK_SIZE 0x440 |
| 47 | #endif |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 48 | #elif defined(IMAGE_BL2) |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 49 | # if TRUSTED_BOARD_BOOT |
| 50 | # define PLATFORM_STACK_SIZE 0x1000 |
| 51 | # else |
| 52 | # define PLATFORM_STACK_SIZE 0x400 |
| 53 | # endif |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 54 | #elif defined(IMAGE_BL2U) |
Yatharth Kochar | 3a11eda | 2015-10-14 15:28:11 +0100 | [diff] [blame] | 55 | # define PLATFORM_STACK_SIZE 0x200 |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 56 | #elif defined(IMAGE_BL31) |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 57 | # define PLATFORM_STACK_SIZE 0x400 |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 58 | #elif defined(IMAGE_BL32) |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 59 | # define PLATFORM_STACK_SIZE 0x440 |
| 60 | #endif |
| 61 | |
| 62 | /* |
Vikram Kanigiri | eade34c | 2016-01-20 15:57:35 +0000 | [diff] [blame] | 63 | * The constants below are not optimised for memory usage. Platforms that wish |
Antonio Nino Diaz | 30ce3ad | 2016-07-25 12:04:31 +0100 | [diff] [blame] | 64 | * to optimise these constants should set `ARM_BOARD_OPTIMISE_MEM` to 1 and |
Vikram Kanigiri | eade34c | 2016-01-20 15:57:35 +0000 | [diff] [blame] | 65 | * provide there own values. |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 66 | */ |
Antonio Nino Diaz | 30ce3ad | 2016-07-25 12:04:31 +0100 | [diff] [blame] | 67 | #if !ARM_BOARD_OPTIMISE_MEM |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 68 | /* |
Vikram Kanigiri | eade34c | 2016-01-20 15:57:35 +0000 | [diff] [blame] | 69 | * PLAT_ARM_MMAP_ENTRIES depends on the number of entries in the |
| 70 | * plat_arm_mmap array defined for each BL stage. |
| 71 | * |
| 72 | * Provide relatively optimised values for the runtime images (BL31 and BL32). |
| 73 | * Optimisation is less important for the other, transient boot images so a |
| 74 | * common, maximum value is used across these images. |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 75 | */ |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 76 | #if defined(IMAGE_BL31) || defined(IMAGE_BL32) |
Vikram Kanigiri | eade34c | 2016-01-20 15:57:35 +0000 | [diff] [blame] | 77 | # define PLAT_ARM_MMAP_ENTRIES 6 |
Vikram Kanigiri | eade34c | 2016-01-20 15:57:35 +0000 | [diff] [blame] | 78 | # define MAX_XLAT_TABLES 4 |
David Wang | 0ba499f | 2016-03-07 11:02:57 +0800 | [diff] [blame] | 79 | #else |
| 80 | # define PLAT_ARM_MMAP_ENTRIES 10 |
| 81 | # define MAX_XLAT_TABLES 5 |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 82 | #endif |
| 83 | |
Antonio Nino Diaz | 30ce3ad | 2016-07-25 12:04:31 +0100 | [diff] [blame] | 84 | /* |
| 85 | * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size |
| 86 | * plus a little space for growth. |
| 87 | */ |
| 88 | #define PLAT_ARM_MAX_BL1_RW_SIZE 0xA000 |
| 89 | |
| 90 | /* |
| 91 | * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a |
| 92 | * little space for growth. |
| 93 | */ |
| 94 | #if TRUSTED_BOARD_BOOT |
| 95 | # define PLAT_ARM_MAX_BL2_SIZE 0x1D000 |
| 96 | #else |
| 97 | # define PLAT_ARM_MAX_BL2_SIZE 0xF000 |
| 98 | #endif |
| 99 | |
| 100 | /* |
| 101 | * PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a |
| 102 | * little space for growth. |
| 103 | */ |
| 104 | #define PLAT_ARM_MAX_BL31_SIZE 0x1D000 |
| 105 | |
| 106 | #endif /* ARM_BOARD_OPTIMISE_MEM */ |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 107 | |
| 108 | #define MAX_IO_DEVICES 3 |
| 109 | #define MAX_IO_HANDLES 4 |
| 110 | |
| 111 | #define PLAT_ARM_TRUSTED_SRAM_SIZE 0x00040000 /* 256 KB */ |
| 112 | |
| 113 | #define PLAT_ARM_FIP_BASE V2M_FLASH0_BASE |
| 114 | #define PLAT_ARM_FIP_MAX_SIZE V2M_FLASH0_SIZE |
| 115 | |
Yatharth Kochar | f11b29a | 2016-02-01 11:04:46 +0000 | [diff] [blame] | 116 | #define PLAT_ARM_NVM_BASE V2M_FLASH0_BASE |
| 117 | #define PLAT_ARM_NVM_SIZE V2M_FLASH0_SIZE |
| 118 | |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 119 | |
| 120 | #endif /* __BOARD_ARM_DEF_H__ */ |