xref: /rk3399_ARM-atf/plat/arm/board/fvp/fvp_security.c (revision 3fc4124c7513554dc14a83a0b94010ce771e7e1c)
1*3fc4124cSDan Handley /*
2*3fc4124cSDan Handley  * Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved.
3*3fc4124cSDan Handley  *
4*3fc4124cSDan Handley  * Redistribution and use in source and binary forms, with or without
5*3fc4124cSDan Handley  * modification, are permitted provided that the following conditions are met:
6*3fc4124cSDan Handley  *
7*3fc4124cSDan Handley  * Redistributions of source code must retain the above copyright notice, this
8*3fc4124cSDan Handley  * list of conditions and the following disclaimer.
9*3fc4124cSDan Handley  *
10*3fc4124cSDan Handley  * Redistributions in binary form must reproduce the above copyright notice,
11*3fc4124cSDan Handley  * this list of conditions and the following disclaimer in the documentation
12*3fc4124cSDan Handley  * and/or other materials provided with the distribution.
13*3fc4124cSDan Handley  *
14*3fc4124cSDan Handley  * Neither the name of ARM nor the names of its contributors may be used
15*3fc4124cSDan Handley  * to endorse or promote products derived from this software without specific
16*3fc4124cSDan Handley  * prior written permission.
17*3fc4124cSDan Handley  *
18*3fc4124cSDan Handley  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19*3fc4124cSDan Handley  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*3fc4124cSDan Handley  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*3fc4124cSDan Handley  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22*3fc4124cSDan Handley  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23*3fc4124cSDan Handley  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24*3fc4124cSDan Handley  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25*3fc4124cSDan Handley  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26*3fc4124cSDan Handley  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27*3fc4124cSDan Handley  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*3fc4124cSDan Handley  * POSSIBILITY OF SUCH DAMAGE.
29*3fc4124cSDan Handley  */
30*3fc4124cSDan Handley 
31*3fc4124cSDan Handley #include <arm_config.h>
32*3fc4124cSDan Handley #include <plat_arm.h>
33*3fc4124cSDan Handley 
34*3fc4124cSDan Handley /*
35*3fc4124cSDan Handley  * We assume that all security programming is done by the primary core.
36*3fc4124cSDan Handley  */
37*3fc4124cSDan Handley void plat_arm_security_setup(void)
38*3fc4124cSDan Handley {
39*3fc4124cSDan Handley 	/*
40*3fc4124cSDan Handley 	 * The Base FVP has a TrustZone address space controller, the Foundation
41*3fc4124cSDan Handley 	 * FVP does not. Trying to program the device on the foundation FVP will
42*3fc4124cSDan Handley 	 * cause an abort.
43*3fc4124cSDan Handley 	 *
44*3fc4124cSDan Handley 	 * If the platform had additional peripheral specific security
45*3fc4124cSDan Handley 	 * configurations, those would be configured here.
46*3fc4124cSDan Handley 	 */
47*3fc4124cSDan Handley 
48*3fc4124cSDan Handley 	if (get_arm_config()->flags & ARM_CONFIG_HAS_TZC)
49*3fc4124cSDan Handley 		arm_tzc_setup();
50*3fc4124cSDan Handley }
51