xref: /optee_os/README.md (revision 8541149400cfc3ddb8b329bc8dc192754f45a4d0)
1# OP-TEE Trusted OS
2The optee_os git, containing the source code for the TEE in Linux using
3the ARM(R) Trustzone(R) technology. This component meets the Global
4Platform TEE System Architecture specification. It also provides the
5TEE Internal API v1.0 as defined by the Global Platform TEE Standard
6for the development of trusted apllications.
7It is distributed mostly under the BSD 2-clause open-source license.
8It includes few external files under BSD 3-clause license or other free
9software licenses. For a general overview of OP-TEE, please see the
10[Notice.md](Notice.md) file.
11
12In this git, the binary to build is tee.elf.
13The Trusted OS is accessible from the Rich OS (Linux) through the Global
14Platform TEE Client API and performs secure execution of applications
15inside the TEE.
16
17## License
18The software is provided under the
19[BSD 2-Clause](http://opensource.org/licenses/BSD-2-Clause) license.
20[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license.
21
22## Platforms supported
23This software has hardware dependencies.
24The software has been tested using:
25
26- STMicroelectronics b2020-h416 (orly-2) hardware (32-bits)
27- Some initial testing has been done using
28[Foundation FVP](http://www.arm.com/fvp), which can be downloaded free of
29charge.
30
31## Get and build the software
32### Get the compiler
33We will strive to use the latest available compiler from Linaro. Start by
34downloading and unpacking the compiler. Then export the PATH to the bin folder.
35
36	$ cd $HOME
37	$ mkdir toolchains
38	$ cd toolchains
39	$ wget http://releases.linaro.org/14.05/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux.tar.xz
40	$ tar xvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux.tar.xz
41	$ export PATH=$HOME/toolchains/gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux/bin:$PATH
42
43### Download the source code
44	$ cd $HOME
45	$ mkdir devel
46	$ cd devel
47	$ git clone https://github.com/OP-TEE/optee_os.git
48
49### Build
50	$ cd $HOME/devel/optee_os
51	$ CROSS_COMPILE=arm-linux-gnueabihf- make
52
53#### Compiler flags
54To be able to see the full command when building you could build using following
55flag:
56
57`$ make V=1`
58
59## Coding standards
60In this project we are trying to adhere to the same coding convention as used in
61the Linux kernel (see
62[CodingStyle](https://www.kernel.org/doc/Documentation/CodingStyle)). We achieve this by running
63[checkpatch](http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl) from Linux kernel.
64However there are a few exceptions that we had to make since the code also
65follows GlobalPlatform standards. The exceptions are as follows:
66
67- CamelCase for GlobalPlatform types are allowed.
68- And we also exclude checking third party code that we might use in this
69  project, such as LibTomCrypt, MPA, newlib (not in this particular git, but
70  those are also part of the complete TEE solution). The reason for excluding
71  and not fixing third party code is because we would probably deviate too much
72  from upstream and therefore it would be hard to rebase against those projects
73  later on (and we don't expect that it is easy to convince other software
74  projects to change coding style).
75
76### checkpatch
77Since checkpatch is licensed under the terms of GNU GPL License Version 2, we
78cannot include this script directly into this project. Therefore we have
79written the Makefile so you need to explicitly point to the script by exporting
80an environment variable, namely CHECKPATCH. So, suppose that the source code for
81the Linux kernel is at `$HOME/devel/linux`, then you have to export like follows:
82
83	$ export CHECKPATCH=$HOME/devel/linux/scripts/checkpatch.pl
84thereafter it should be possible to use one of the different checkpatch targets
85in the [Makefile](Makefile). There are targets for checking all files, checking
86against latest commit, against a certain base-commit etc. For the details, read
87the [Makefile](Makefile).
88