blob: 747ff068ca4722edf8e441da23e5f9055aec1f81 [file] [log] [blame]
Deepak Pandey9cbacf62018-08-08 10:32:51 +05301/*
Arvind Ram Prakash11b9b492022-11-22 14:41:00 -06002 * Copyright (c) 2018-2023, Arm Limited. All rights reserved.
Deepak Pandey9cbacf62018-08-08 10:32:51 +05303 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
sah016ec01e82021-06-06 14:38:01 +05307#include <assert.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008
Aditya Angadi20b48412019-04-16 11:29:14 +05309#include <drivers/arm/sbsa.h>
sah016ec01e82021-06-06 14:38:01 +053010#include <plat/arm/common/plat_arm.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011
Manoj Kumar69bebd82019-06-21 17:07:13 +010012#include "n1sdp_def.h"
13
Deepak Pandey9cbacf62018-08-08 10:32:51 +053014/*
15 * Table of regions to map using the MMU.
16 * Replace or extend the below regions as required
17 */
18
sah016ec01e82021-06-06 14:38:01 +053019#if IMAGE_BL1
20const 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 Pandey9cbacf62018-08-08 10:32:51 +053030const mmap_region_t plat_arm_mmap[] = {
31 ARM_MAP_SHARED_RAM,
32 N1SDP_MAP_DEVICE,
Manoj Kumar69bebd82019-06-21 17:07:13 +010033 N1SDP_MAP_NS_SRAM,
34 ARM_MAP_DRAM1,
35 ARM_MAP_DRAM2,
Arvind Ram Prakash11b9b492022-11-22 14:41:00 -060036#if TRUSTED_BOARD_BOOT && !RESET_TO_BL2
sah016ec01e82021-06-06 14:38:01 +053037 ARM_MAP_BL1_RW,
38#endif
39 {0}
40};
41#endif
42
43#if IMAGE_BL31
44const mmap_region_t plat_arm_mmap[] = {
45 ARM_MAP_SHARED_RAM,
46 N1SDP_MAP_DEVICE,
47 N1SDP_MAP_NS_SRAM,
Manish Pandeyb68e2862019-09-11 17:07:40 +010048 N1SDP_MAP_REMOTE_DEVICE,
49 N1SDP_MAP_REMOTE_DRAM1,
50 N1SDP_MAP_REMOTE_DRAM2,
Deepak Pandey9cbacf62018-08-08 10:32:51 +053051 {0}
52};
sah016ec01e82021-06-06 14:38:01 +053053#endif
54
55#if TRUSTED_BOARD_BOOT
56int 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 Pandey9cbacf62018-08-08 10:32:51 +053064
Aditya Angadi20b48412019-04-16 11:29:14 +053065void plat_arm_secure_wdt_start(void)
66{
67 sbsa_wdog_start(SBSA_SECURE_WDOG_BASE, SBSA_SECURE_WDOG_TIMEOUT);
68}
69
70void plat_arm_secure_wdt_stop(void)
71{
72 sbsa_wdog_stop(SBSA_SECURE_WDOG_BASE);
73}