Deepak Pandey | 9cbacf6 | 2018-08-08 10:32:51 +0530 | [diff] [blame] | 1 | /* |
sah01 | 6ec01e8 | 2021-06-06 14:38:01 +0530 | [diff] [blame] | 2 | * Copyright (c) 2018-2022, Arm Limited. All rights reserved. |
Deepak Pandey | 9cbacf6 | 2018-08-08 10:32:51 +0530 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
sah01 | 6ec01e8 | 2021-06-06 14:38:01 +0530 | [diff] [blame] | 7 | #include <assert.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 8 | |
Aditya Angadi | 20b4841 | 2019-04-16 11:29:14 +0530 | [diff] [blame] | 9 | #include <drivers/arm/sbsa.h> |
sah01 | 6ec01e8 | 2021-06-06 14:38:01 +0530 | [diff] [blame] | 10 | #include <plat/arm/common/plat_arm.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | |
Manoj Kumar | 69bebd8 | 2019-06-21 17:07:13 +0100 | [diff] [blame] | 12 | #include "n1sdp_def.h" |
| 13 | |
Deepak Pandey | 9cbacf6 | 2018-08-08 10:32:51 +0530 | [diff] [blame] | 14 | /* |
| 15 | * Table of regions to map using the MMU. |
| 16 | * Replace or extend the below regions as required |
| 17 | */ |
| 18 | |
sah01 | 6ec01e8 | 2021-06-06 14:38:01 +0530 | [diff] [blame] | 19 | #if IMAGE_BL1 |
| 20 | const mmap_region_t plat_arm_mmap[] = { |
| 21 | ARM_MAP_SHARED_RAM, |
| 22 | N1SDP_MAP_DEVICE, |
| 23 | N1SDP_MAP_NS_SRAM, |
| 24 | ARM_MAP_DRAM1, |
| 25 | {0} |
| 26 | }; |
| 27 | #endif |
| 28 | |
| 29 | #if IMAGE_BL2 |
Deepak Pandey | 9cbacf6 | 2018-08-08 10:32:51 +0530 | [diff] [blame] | 30 | const mmap_region_t plat_arm_mmap[] = { |
| 31 | ARM_MAP_SHARED_RAM, |
| 32 | N1SDP_MAP_DEVICE, |
Manoj Kumar | 69bebd8 | 2019-06-21 17:07:13 +0100 | [diff] [blame] | 33 | N1SDP_MAP_NS_SRAM, |
| 34 | ARM_MAP_DRAM1, |
| 35 | ARM_MAP_DRAM2, |
sah01 | 6ec01e8 | 2021-06-06 14:38:01 +0530 | [diff] [blame] | 36 | #if TRUSTED_BOARD_BOOT && !BL2_AT_EL3 |
| 37 | ARM_MAP_BL1_RW, |
| 38 | #endif |
| 39 | {0} |
| 40 | }; |
| 41 | #endif |
| 42 | |
| 43 | #if IMAGE_BL31 |
| 44 | const mmap_region_t plat_arm_mmap[] = { |
| 45 | ARM_MAP_SHARED_RAM, |
| 46 | N1SDP_MAP_DEVICE, |
| 47 | N1SDP_MAP_NS_SRAM, |
Manish Pandey | b68e286 | 2019-09-11 17:07:40 +0100 | [diff] [blame] | 48 | N1SDP_MAP_REMOTE_DEVICE, |
| 49 | N1SDP_MAP_REMOTE_DRAM1, |
| 50 | N1SDP_MAP_REMOTE_DRAM2, |
Deepak Pandey | 9cbacf6 | 2018-08-08 10:32:51 +0530 | [diff] [blame] | 51 | {0} |
| 52 | }; |
sah01 | 6ec01e8 | 2021-06-06 14:38:01 +0530 | [diff] [blame] | 53 | #endif |
| 54 | |
| 55 | #if TRUSTED_BOARD_BOOT |
| 56 | int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size) |
| 57 | { |
| 58 | assert(heap_addr != NULL); |
| 59 | assert(heap_size != NULL); |
| 60 | |
| 61 | return arm_get_mbedtls_heap(heap_addr, heap_size); |
| 62 | } |
| 63 | #endif |
Deepak Pandey | 9cbacf6 | 2018-08-08 10:32:51 +0530 | [diff] [blame] | 64 | |
Aditya Angadi | 20b4841 | 2019-04-16 11:29:14 +0530 | [diff] [blame] | 65 | void plat_arm_secure_wdt_start(void) |
| 66 | { |
| 67 | sbsa_wdog_start(SBSA_SECURE_WDOG_BASE, SBSA_SECURE_WDOG_TIMEOUT); |
| 68 | } |
| 69 | |
| 70 | void plat_arm_secure_wdt_stop(void) |
| 71 | { |
| 72 | sbsa_wdog_stop(SBSA_SECURE_WDOG_BASE); |
| 73 | } |