blob: 280865d9566fd43c2af3889d3c56bc2183a04fb9 [file] [log] [blame]
Mona Hossain41789f32011-11-18 11:18:07 -08001Introduction:
2=============
3
4The tz_log driver is a platform device driver that exposes a debugfs
5interface for accessing and displaying diagnostic information related
6to secure code (Trustzone).
7
8The Secure code (Trustzone) will store the diagnostic data in 4KB of
9IMEM. The address of this IMEM region varies from platform. The
10diagnostic data encodes information related to secure code boot-up,
11reset, interrupt and other attributes in a specific format as shown
12below:
13
14 ----------------------------
15 | |
16 | General info |
17 | (Magic #, CPU cnt etc) |
18 | |
19 ----------------------------
20 | |
21 | VMID info |
22 | |
23 ----------------------------
24 | |
25 | Boot info (per CPU) |
26 | |
27 ----------------------------
28 | |
29 | Reset info (per CPU) |
30 | |
31 ----------------------------
32 | |
33 | Interrupt info (per CPU) |
34 | |
35 ----------------------------
36 | |
37 | Data logged by TZ |
38 | |
39 ----------------------------
40
41During the initialization of the driver module, this 4KB of IMEM
42is remapped for access by kernel. Further more, an additonal 4KB
43memory is allocated for storing the formatted data that will be
44displayed by the debugfs interface.
45
46Once the device is booted up and HLOS is up, the standard debugfs
47interface is used to read out and display this information that
48was logged in by secure code in a specific format as shown below.
49
50Debugfs is typically mounted with a command like:
51 mount -t debugfs none /sys/kernel/debug
52(Or an equivalent /etc/fstab line).
53
54Note that the debugfs API is exported GPL-only to modules.
55
56Software description
57====================
58
59The tz_log module is a Linux platform device driver with a debugfs
60interface. The goal of this module is to provide a way to peek into
61the Trustzone diagnostic information to help debug issues with
62Trustzone. Although, this tz_log platform device driver will be
63compiled into the kernel, the debugfs entries will not be exposed
64unless Trustzone is supported by the platform.
65
66
67On loading the tz_log driver, tzdbgfs_init() is invoked. tzdbgfs_init()
68initializes the tz_log debugfs interface. The following is done in
69this initialization call.
70
71(1) Create a directory "tzdbg", to hold a set of debugfs files
72
73(2) Create the following debugfs files in the "tzdbg" directory
74- boot_info
75 Contains information on the warm boot jump address
76- reset_info
77 Contains information on the cause of a CPU reset, number of
78 resets occurred on a specific CPU
79- interrupt_info
80 Contains information on the number of IRQ and FIQ Interrupts
81 (with a brief description), interrupts fired and the number
82 of times it is fired on a specific CPU.
83- general_info
84 Contains information on number of CPUs supported, magic number,
85 version number.
86- vmid_info
87 Contains information on VMID supported, with a brief description
88- log
89 Debug information (ASCII text) that is logged by Trustzone
90
91Following are the set of file operation defines and register
92- read()
93- open()
94
95(3) Remap the IMEM region where the secure code diagnostic information
96is stored.
97
98(4) Allocate 4KB buffer for storing the formatted information
99to be displayed
100
101When the tz_log driver is unloaded the tz_log debugfs entries are
102explicitly removed.
103
104
105Power Management
106================
107
108n/a
109
110Security
111========
112
113None
114
115Interface
116=========
117
118This module will create debugfs files under sys/kernel/debug which
119contains information that can be displayed by using the "cat" command.
120
121
122Dependencies
123============
124
125This driver interacts with Trustzone operating environment, thus depends
126on the TZBSP supported architecture. It also depends on debugfs.
127
128
129To do
130=====
131
132TBD