# Trusty, a Trusted Execution Environment

**URL:** <https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099>\
**Category:** Jetson AGX Xavier\
**Tags:** security\
**Created:** [June 17, 2021, 2:26pm UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099 "2021-06-17T14:26:56Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 17, 2021, 2:26pm UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/1 "2021-06-17T14:26:56Z")

</div>

Hi there I want to Implement Trusty on Jetson AGX Xavier.  
So far  
I have gone through Secureboot and Disk Encryption. I have **[L4T Driver Package (BSP) Sources](https://developer.nvidia.com/embedded/l4t/r32_release_v5.1/r32_release_v5.1/sources/t186/public_sources.tbz2)** on my host. I am not sure what to do next kindly guide me what will be the next step from here.  
Thanks

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [June 18, 2021, 2:45am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/3 "2021-06-18T02:45:26Z")

</div>

> [@AbdulWasey](#):
>
> I want to Implement Trusty

hello AbdulWasey,

are you saying developing TAs/CAs that run with Trusty’s Trusted Execution Environment (TEE)?  
please access to developer guide, [Trusted Application Development](https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-325/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/trusty.html#wwpID0E0DI0HA) for reference,  
thanks

---

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 18, 2021, 5:27am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/4 "2021-06-18T05:27:22Z")

</div>

Hi @JerryChang

> [@JerryChang](#):
>
> are you saying developing TAs/CAs that run with Trusty’s Trusted Execution Environment (TEE)?

Yes, But this \<trusty\_top\> directory of source package is available on the host. I am trying to understand how trusty will be available on Xavier where I can build and run my code in TEE on the Xavier not on the host.

---

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 18, 2021, 7:47am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/5 "2021-06-18T07:47:48Z")

</div>

Hi @JerryChang  
I am trying to understand the trusty and how it can be implemented?  
I can see a file `atf_and_trusty_README.txt` in` /source/public` which shows how to create `tos_t194.img` and replacing with the old `tos.img`. Now what will happen when board is flashed with new `tos_t194.img`? Did this creates some secure directory where I can put my data and code?  
Thanks

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [June 18, 2021, 7:54am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/6 "2021-06-18T07:54:23Z")

</div>

please check this thread as see-also. [[TRUSTY] Trusted Application Testing](https://forums.developer.nvidia.com/t/trusty-trusted-application-testing/180049/)

---

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 18, 2021, 8:12am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/7 "2021-06-18T08:12:36Z")

</div>

Hi @JerryChang  
Where can I get more details about CAs and TAs implementation? I don’t have much idea about that. I can see in . [[TRUSTY] Trusted Application Testing](https://forums.developer.nvidia.com/t/trusty-trusted-application-testing/180049/) that I have to go through the _atf\_and\_trusty.README_ to implement SecureOS. Will this all to enable TEE on the Xavier.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [June 18, 2021, 8:42am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/8 "2021-06-18T08:42:05Z")

</div>

hello AbdulWasey,

there’s NO specific rules for the implementation of CA.  
please refer to this for the steps or guides to implement or extend more functions into it.  
thanks

> [@Trusty Client Applications in Non-secure World](https://forums.developer.nvidia.com/t/trusty-client-applications-in-non-secure-world/128041/8):
>
> hello tsunakai, there are three simple TA demos, ske1, ske2, and timer demonstrate “Hello, world” in Trusty. there’s NO specific rules for the implementation of CA. you may implement CA as you want once the application model and TIPC interface are defined. FYI, please refer to below steps or guides to implement or extend more functions into it. define the interface of TIPC which includes the service name and the format of data packets create the IPC service: please reference the sample cod…

---

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 21, 2021, 7:36am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/9 "2021-06-21T07:36:31Z")

</div>

Hi @JerryChang  
`The bootloader allocates a dedicated carveout, TZ-DRAM, to run a secure OS`  
**What is the allocated size of TZ-DRAM in case of Xavier AGX can you specify please**  
thanks

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [June 21, 2021, 7:53am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/10 "2021-06-21T07:53:07Z")

</div>

hello AbdulWasey,

please refer to cboot sources for the carveout index.  
for example, _$L4T\_Sources/r32.5.1/Linux\_for\_Tegra/source/public/cboot$ vim ./bootloader/partner/t19x/mb1-headers/tegrabl\_carveout\_id.h_  
it’s `#define CARVEOUT_TZDRAM 34U ` for the TZ-DRAM.

then, you’re able to check the CBoot logs for allocated base address and also the size.  
for example,

```auto
��[0001.089] I> Welcome to Cboot
��fmon_post initialized
��[0001.090] I> Cboot Version: t194-9efcbc4f
...
[0001.367] I> 34) Base:0xf3c00000 Size:0x01000000

```

note,  
there’s erroneous in the makefile, please check [Physical address range in the secure world - #5 by JerryChang](https://forums.developer.nvidia.com/t/physical-address-range-in-the-secure-world/164643/5).  
we’ve also done the update, please expect next public release (i.e. JetPack-4.6) will include the fixes.  
thanks

---

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 21, 2021, 9:00am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/11 "2021-06-21T09:00:22Z")

</div>

Hi @JerryChang  
I have gone through the `atf_and_trusty.README` and successfully created the tos\_t194.img, and will flash that after enabling the scureboot. but I am bit confused regarding the TAs/CAs. The thing I want to do with trusty is to save some keys, some important data and certificates and access them and change them whenever I need. How can be this possible kindly guide me.  
Thanks

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [June 21, 2021, 9:26am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/12 "2021-06-21T09:26:48Z")

</div>

hello AbdulWasey,

please check the TA/CA sample in the developer guide, it’s hwkey-agent and hwkey-app to use the key for data encryption and decryption.  
thanks

---

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 21, 2021, 1:14pm UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/13 "2021-06-21T13:14:06Z")

</div>

Hi @JerryChang  
I have gone through hwkey-agent and hwkey-app. To enable the hwkey-agent and other TAs on Xavier I have to do ?

1. newly generated **`tos_t194.img`** placed in `/linux_for-tegra/bootloader/` directory by following the instruction in `atf_and_trusty.README`
2. Secureboot enabled with **\<pkc.pem\>** and **\<SBK.key\>** keys
3. **\<eks\_image\_file\>** genrated by `gen_ekb.py` and placed in `/linux_for-tegra/bootloader/` directory  
or there is anything else that I am missing kindly guide me.  
Thanks

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [June 22, 2021, 2:48am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/14 "2021-06-22T02:48:06Z")

</div>

hello AbdulWasey,

you’ll need to have secure-os partition flashed with your customize image,  
for example,

```auto
[214.3226] Writing partition secure-os with tos-trusty_t194_sigheader.img.encrypt
[214.4007] [................................................] 100%

```

those others looks correct, please have a try,  
thanks

---

<div class="post-metadata">

**Author:** ![AbdulWasey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AbdulWasey](https://forums.developer.nvidia.com/u/AbdulWasey)\
**Post date:** [June 22, 2021, 6:27am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/15 "2021-06-22T06:27:07Z")

</div>

Hi @JerryChang

> [@JerryChang](#):
>
> it’s `#define CARVEOUT_TZDRAM 34U ` for the TZ-DRAM.

Does the

> [@JerryChang](#):
>
> `Size:0x01000000`

Means that the `0x01000000` in hex equals to `16,777,216` in decimal so is this size in bytes? So it will be then 16MB of TZ-DRAM allocated to secure OS?  
Thanks

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [June 22, 2021, 7:05am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/16 "2021-06-22T07:05:15Z")

</div>

that’s correct.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [August 29, 2021, 5:38am UTC](https://forums.developer.nvidia.com/t/trusty-a-trusted-execution-environment/181099/18 "2021-08-29T05:38:45Z")

</div>

Closed on August 29, 2021, 5:38am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
