]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Include/Library/ArmTrustZoneLib.h
8eeb6a2fee393d86079fa57ce61ac93df72c55f4
[mirror_edk2.git] / ArmPkg / Include / Library / ArmTrustZoneLib.h
1 /** @file
2 *
3 * Copyright (c) 2011, ARM Limited. All rights reserved.
4 *
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
9 *
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 *
13 **/
14
15 #ifndef __ARM_TRUSTZONE_LIB_H__
16 #define __ARM_TRUSTZONE_LIB_H__
17
18 #include <Uefi.h>
19
20 // Setup TZ Protection Controller
21 #define TZPC_DECPROT_0 0
22 #define TZPC_DECPROT_1 1
23 #define TZPC_DECPROT_2 2
24 #define TZPC_DECPROT_MAX 2
25
26 /**
27 FIXME: Need documentation
28 **/
29 EFI_STATUS TZPCSetDecProtBits(UINTN tzpc_base, UINTN tzpc_id, UINTN bits);
30
31 /**
32 FIXME: Need documentation
33 **/
34 EFI_STATUS TZPCClearDecProtBits(UINTN tzpc_base, UINTN tzpc_id, UINTN bits);
35
36 // Setup TZ Address Space Controller
37 #define TZASC_REGION_ENABLED 1
38 #define TZASC_REGION_DISABLED 0
39 #define TZASC_REGION_SIZE_32KB 0xE
40 #define TZASC_REGION_SIZE_64KB 0xF
41 #define TZASC_REGION_SIZE_128KB 0x10
42 #define TZASC_REGION_SIZE_256KB 0x11
43 #define TZASC_REGION_SIZE_512KB 0x12
44 #define TZASC_REGION_SIZE_1MB 0x13
45 #define TZASC_REGION_SIZE_2MB 0x14
46 #define TZASC_REGION_SIZE_4MB 0x15
47 #define TZASC_REGION_SIZE_8MB 0x16
48 #define TZASC_REGION_SIZE_16MB 0x17
49 #define TZASC_REGION_SIZE_32MB 0x18
50 #define TZASC_REGION_SIZE_64MB 0x19
51 #define TZASC_REGION_SIZE_128MB 0x1A
52 #define TZASC_REGION_SIZE_256MB 0x1B
53 #define TZASC_REGION_SIZE_512MB 0x1C
54 #define TZASC_REGION_SIZE_1GB 0x1D
55 #define TZASC_REGION_SIZE_2GB 0x1E
56 #define TZASC_REGION_SIZE_4GB 0x1F
57 #define TZASC_REGION_SECURITY_SR (1 << 3)
58 #define TZASC_REGION_SECURITY_SW (1 << 2)
59 #define TZASC_REGION_SECURITY_SRW (TZASC_REGION_SECURITY_SR|TZASC_REGION_SECURITY_SW)
60 #define TZASC_REGION_SECURITY_NSR (1 << 1)
61 #define TZASC_REGION_SECURITY_NSW 1
62 #define TZASC_REGION_SECURITY_NSRW (TZASC_REGION_SECURITY_NSR|TZASC_REGION_SECURITY_NSW)
63
64 /**
65 FIXME: Need documentation
66 **/
67 EFI_STATUS TZASCSetRegion(UINTN tzasc_base, UINTN region_id, UINTN enabled, UINTN low_address, UINTN high_address, UINTN size, UINTN security);
68
69 #endif