1 /*
2 * Copyright (c) 2018-2022, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #include <assert.h>
8
9 #include <drivers/arm/sbsa.h>
10 #include <plat/arm/common/plat_arm.h>
11
12 #include "n1sdp_def.h"
13
14 /*
15 * Table of regions to map using the MMU.
16 * Replace or extend the below regions as required
17 */
18
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
30 const mmap_region_t plat_arm_mmap[] = {
31 ARM_MAP_SHARED_RAM,
32 N1SDP_MAP_DEVICE,
33 N1SDP_MAP_NS_SRAM,
34 ARM_MAP_DRAM1,
35 ARM_MAP_DRAM2,
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,
48 N1SDP_MAP_REMOTE_DEVICE,
49 N1SDP_MAP_REMOTE_DRAM1,
50 N1SDP_MAP_REMOTE_DRAM2,
51 {0}
52 };
53 #endif
54
55 #if TRUSTED_BOARD_BOOT
plat_get_mbedtls_heap(void ** heap_addr,size_t * heap_size)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
64
plat_arm_secure_wdt_start(void)65 void plat_arm_secure_wdt_start(void)
66 {
67 sbsa_wdog_start(SBSA_SECURE_WDOG_BASE, SBSA_SECURE_WDOG_TIMEOUT);
68 }
69
plat_arm_secure_wdt_stop(void)70 void plat_arm_secure_wdt_stop(void)
71 {
72 sbsa_wdog_stop(SBSA_SECURE_WDOG_BASE);
73 }
74