blob: 1167d343c0f2f7adf24157ec34a5f2fd77cccf8d [file] [log] [blame]
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +05301/*
Venkatesh Yadav Abbarapu9156ffd2020-01-22 21:23:20 -07002 * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved.
Akshay Belsarebdffd362023-01-18 17:04:22 +05303 * Copyright (C) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +05304 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
Tejas Patel354fe572018-12-14 00:55:37 -08008#include <plat_ipi.h>
Tejas Patel0a2f9ad2018-12-14 00:55:30 -08009#include <versal_def.h>
Tejas Patel69409962018-12-14 00:55:29 -080010#include <plat_private.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011#include <common/debug.h>
12#include <drivers/generic_delay_timer.h>
13#include <lib/mmio.h>
14#include <lib/xlat_tables/xlat_tables.h>
15#include <plat/common/platform.h>
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +053016
17/*
18 * Table of regions to map using the MMU.
19 * This doesn't include TZRAM as the 'mem_layout' argument passed to
20 * configure_mmu_elx() will give the available subset of that,
21 */
22const mmap_region_t plat_versal_mmap[] = {
23 MAP_REGION_FLAT(DEVICE0_BASE, DEVICE0_SIZE, MT_DEVICE | MT_RW | MT_SECURE),
24 MAP_REGION_FLAT(DEVICE1_BASE, DEVICE1_SIZE, MT_DEVICE | MT_RW | MT_SECURE),
25 MAP_REGION_FLAT(CRF_BASE, CRF_SIZE, MT_DEVICE | MT_RW | MT_SECURE),
Michal Simek467e16e2023-04-14 08:39:49 +020026 MAP_REGION_FLAT(PLAT_ARM_CCI_BASE, PLAT_ARM_CCI_SIZE, MT_DEVICE | MT_RW |
Tejas Patel54d13192019-02-27 18:44:55 +053027 MT_SECURE),
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +053028 { 0 }
29};
30
31const mmap_region_t *plat_versal_get_mmap(void)
32{
33 return plat_versal_mmap;
34}
35
36static void versal_print_platform_name(void)
37{
Akshay Belsarebdffd362023-01-18 17:04:22 +053038 NOTICE("TF-A running on %s\n", PLATFORM_NAME);
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +053039}
40
41void versal_config_setup(void)
42{
Tejas Patel354fe572018-12-14 00:55:37 -080043 /* Configure IPI data for versal */
44 versal_ipi_config_table_init();
45
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +053046 versal_print_platform_name();
47
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +053048 generic_delay_timer_init();
49}
50
Venkatesh Yadav Abbarapubde87592022-05-24 11:11:12 +053051uint32_t plat_get_syscnt_freq2(void)
Siva Durga Prasad Paladugufe4af662018-09-25 18:44:58 +053052{
53 return VERSAL_CPU_CLOCK;
54}
55