xref: /optee_os/core/arch/arm/plat-ti/ti_pl310.c (revision d83a652a9bf81fb12a2dcb9816152b233d35920b)
1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3  * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
4  *	Andrew Davis <afd@ti.com>
5  */
6 
7 #include <arm32.h>
8 #include <io.h>
9 #include <kernel/boot.h>
10 #include <kernel/tz_ssvce_def.h>
11 #include <kernel/tz_ssvce_pl310.h>
12 #include <mm/core_memprot.h>
13 #include <platform_config.h>
14 
15 register_phys_mem_pgdir(MEM_AREA_IO_SEC, PL310_BASE, PL310_SIZE);
16 
pl310_base(void)17 vaddr_t pl310_base(void)
18 {
19 	static void *va;
20 
21 	if (cpu_mmu_enabled()) {
22 		if (!va)
23 			va = phys_to_virt(PL310_BASE, MEM_AREA_IO_SEC,
24 					  PL310_SIZE);
25 		return (vaddr_t)va;
26 	}
27 
28 	return PL310_BASE;
29 }
30 
31 /* ROM handles initial setup for us */
arm_cl2_config(vaddr_t pl310_base)32 void arm_cl2_config(vaddr_t pl310_base)
33 {
34 	(void)pl310_base;
35 }
36 
37 /* We provide platform services that expect the cache to be disabled on boot */
arm_cl2_enable(vaddr_t pl310_base)38 void arm_cl2_enable(vaddr_t pl310_base)
39 {
40 	(void)pl310_base;
41 }
42