• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2 *
3 *  Copyright (c) 2011-2012, 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_H__
16 #define __ARM_TRUSTZONE_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
30 TZPCSetDecProtBits (
31   IN  UINTN TzpcBase,
32   IN  UINTN TzpcId,
33   IN  UINTN Bits
34   );
35 
36 /**
37     FIXME: Need documentation
38 **/
39 EFI_STATUS
40 TZPCClearDecProtBits (
41   IN  UINTN TzpcBase,
42   IN  UINTN TzpcId,
43   IN  UINTN Bits
44   );
45 
46 // Setup TZ Address Space Controller
47 #define TZASC_REGION_ENABLED        1
48 #define TZASC_REGION_DISABLED       0
49 #define TZASC_REGION_SIZE_32KB      0xE
50 #define TZASC_REGION_SIZE_64KB      0xF
51 #define TZASC_REGION_SIZE_128KB     0x10
52 #define TZASC_REGION_SIZE_256KB     0x11
53 #define TZASC_REGION_SIZE_512KB     0x12
54 #define TZASC_REGION_SIZE_1MB       0x13
55 #define TZASC_REGION_SIZE_2MB       0x14
56 #define TZASC_REGION_SIZE_4MB       0x15
57 #define TZASC_REGION_SIZE_8MB       0x16
58 #define TZASC_REGION_SIZE_16MB      0x17
59 #define TZASC_REGION_SIZE_32MB      0x18
60 #define TZASC_REGION_SIZE_64MB      0x19
61 #define TZASC_REGION_SIZE_128MB     0x1A
62 #define TZASC_REGION_SIZE_256MB     0x1B
63 #define TZASC_REGION_SIZE_512MB     0x1C
64 #define TZASC_REGION_SIZE_1GB       0x1D
65 #define TZASC_REGION_SIZE_2GB       0x1E
66 #define TZASC_REGION_SIZE_4GB       0x1F
67 #define TZASC_REGION_SECURITY_SR    (1 << 3)
68 #define TZASC_REGION_SECURITY_SW    (1 << 2)
69 #define TZASC_REGION_SECURITY_SRW   (TZASC_REGION_SECURITY_SR|TZASC_REGION_SECURITY_SW)
70 #define TZASC_REGION_SECURITY_NSR   (1 << 1)
71 #define TZASC_REGION_SECURITY_NSW   1
72 #define TZASC_REGION_SECURITY_NSRW  (TZASC_REGION_SECURITY_NSR|TZASC_REGION_SECURITY_NSW)
73 
74 /**
75     FIXME: Need documentation
76 **/
77 EFI_STATUS
78 TZASCSetRegion (
79   IN  INTN  TzascBase,
80   IN  UINTN RegionId,
81   IN  UINTN Enabled,
82   IN  UINTN LowAddress,
83   IN  UINTN HighAddress,
84   IN  UINTN Size,
85   IN  UINTN Security
86   );
87 
88 #endif
89