blob: 42efdeef75acafe5ca6e0fcce0f0b91d3dcbcc9d [file] [log] [blame]
Deepak Pandey9cbacf62018-08-08 10:32:51 +05301/*
Tamas Ban307b3d82023-05-08 13:51:27 +02002 * Copyright (c) 2018-2024, 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
Tamas Ban307b3d82023-05-08 13:51:27 +02009#include <drivers/arm/css/sds.h>
Aditya Angadi20b48412019-04-16 11:29:14 +053010#include <drivers/arm/sbsa.h>
Tamas Ban307b3d82023-05-08 13:51:27 +020011#include <lib/utils_def.h>
sah016ec01e82021-06-06 14:38:01 +053012#include <plat/arm/common/plat_arm.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000013
Manoj Kumar69bebd82019-06-21 17:07:13 +010014#include "n1sdp_def.h"
15
Deepak Pandey9cbacf62018-08-08 10:32:51 +053016/*
17 * Table of regions to map using the MMU.
18 * Replace or extend the below regions as required
19 */
20
sah016ec01e82021-06-06 14:38:01 +053021#if IMAGE_BL1
22const mmap_region_t plat_arm_mmap[] = {
23 ARM_MAP_SHARED_RAM,
24 N1SDP_MAP_DEVICE,
25 N1SDP_MAP_NS_SRAM,
26 ARM_MAP_DRAM1,
27 {0}
28};
29#endif
30
31#if IMAGE_BL2
Deepak Pandey9cbacf62018-08-08 10:32:51 +053032const mmap_region_t plat_arm_mmap[] = {
33 ARM_MAP_SHARED_RAM,
34 N1SDP_MAP_DEVICE,
Manoj Kumar69bebd82019-06-21 17:07:13 +010035 N1SDP_MAP_NS_SRAM,
36 ARM_MAP_DRAM1,
37 ARM_MAP_DRAM2,
Arvind Ram Prakash11b9b492022-11-22 14:41:00 -060038#if TRUSTED_BOARD_BOOT && !RESET_TO_BL2
sah016ec01e82021-06-06 14:38:01 +053039 ARM_MAP_BL1_RW,
40#endif
41 {0}
42};
43#endif
44
45#if IMAGE_BL31
46const mmap_region_t plat_arm_mmap[] = {
47 ARM_MAP_SHARED_RAM,
48 N1SDP_MAP_DEVICE,
49 N1SDP_MAP_NS_SRAM,
Manish Pandeyb68e2862019-09-11 17:07:40 +010050 N1SDP_MAP_REMOTE_DEVICE,
51 N1SDP_MAP_REMOTE_DRAM1,
52 N1SDP_MAP_REMOTE_DRAM2,
Deepak Pandey9cbacf62018-08-08 10:32:51 +053053 {0}
54};
sah016ec01e82021-06-06 14:38:01 +053055#endif
56
57#if TRUSTED_BOARD_BOOT
58int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
59{
60 assert(heap_addr != NULL);
61 assert(heap_size != NULL);
62
63 return arm_get_mbedtls_heap(heap_addr, heap_size);
64}
65#endif
Deepak Pandey9cbacf62018-08-08 10:32:51 +053066
Aditya Angadi20b48412019-04-16 11:29:14 +053067void plat_arm_secure_wdt_start(void)
68{
69 sbsa_wdog_start(SBSA_SECURE_WDOG_BASE, SBSA_SECURE_WDOG_TIMEOUT);
70}
71
72void plat_arm_secure_wdt_stop(void)
73{
74 sbsa_wdog_stop(SBSA_SECURE_WDOG_BASE);
75}
Tamas Ban307b3d82023-05-08 13:51:27 +020076
77#if CSS_USE_SCMI_SDS_DRIVER
78static sds_region_desc_t n1sdp_sds_regions[] = {
79 { .base = PLAT_ARM_SDS_MEM_BASE },
80};
81
82sds_region_desc_t *plat_sds_get_regions(unsigned int *region_count)
83{
84 *region_count = ARRAY_SIZE(n1sdp_sds_regions);
85
86 return n1sdp_sds_regions;
87}
88#endif /* CSS_USE_SCMI_SDS_DRIVER */