blob: e9ef5872d434c59bd385e966cc5a2be164b852c2 [file] [log] [blame] [view]
David Brazdil0dbb41f2019-09-09 18:03:35 +01001# Hafnium Manifest
2
Andrew Walbranb7849972019-11-15 15:23:43 +00003[TOC]
4
David Brazdil0dbb41f2019-09-09 18:03:35 +01005## Format
6
7The format of the manifest is a simple DeviceTree overlay:
8
9```
10/dts-v1/;
David Brazdil0dbb41f2019-09-09 18:03:35 +010011
David Brazdila2358d42020-01-27 18:51:38 +000012/ {
David Brazdil0dbb41f2019-09-09 18:03:35 +010013 hypervisor {
David Brazdilea707d62019-11-06 10:10:17 +000014 compatible = "hafnium,hafnium";
15
Andrew Walbranb5ab43c2020-04-30 11:32:54 +010016 ffa_tee;
Andrew Walbran41a49d82020-01-10 17:46:38 +000017
David Brazdil0dbb41f2019-09-09 18:03:35 +010018 vm1 {
19 debug_name = "name";
Andrew Scull72b43c02019-09-18 13:53:45 +010020 kernel_filename = "vmlinuz";
David Brazdile6f83222019-09-23 14:47:37 +010021 ramdisk_filename = "initrd.img";
David Brazdil0dbb41f2019-09-09 18:03:35 +010022 };
23
24 vm2 {
25 debug_name = "name";
26 kernel_filename = "filename";
27 vcpu_count = <N>;
28 mem_size = <M>;
29 };
30 ...
31 };
32};
33```
34
David Brazdil0dbb41f2019-09-09 18:03:35 +010035## Example
36
Andrew Scull72b43c02019-09-18 13:53:45 +010037The following manifest defines a primary VM with two secondary VMs. The first
38secondary VM has 1MB of memory, 2 CPUs and kernel image called `kernel0`
39(matches filename in Hafnium's [ramdisk](HafniumRamDisk.md)). The second has 2MB
40of memory, 4 CPUs and, by omitting the `kernel_filename` property, a kernel
41preloaded into memory. The primary VM is given all remaining memory, the same
David Brazdile6f83222019-09-23 14:47:37 +010042number of CPUs as the hardware, a kernel image called `vmlinuz` and a ramdisk
Andrew Walbranb5ab43c2020-04-30 11:32:54 +010043`initrd.img`. Secondaries cannot have a ramdisk. FF-A memory sharing with the
Andrew Walbran41a49d82020-01-10 17:46:38 +000044TEE is enabled.
David Brazdil0dbb41f2019-09-09 18:03:35 +010045
46```
47/dts-v1/;
David Brazdil0dbb41f2019-09-09 18:03:35 +010048
David Brazdila2358d42020-01-27 18:51:38 +000049/ {
David Brazdil0dbb41f2019-09-09 18:03:35 +010050 hypervisor {
David Brazdilea707d62019-11-06 10:10:17 +000051 compatible = "hafnium,hafnium";
52
Andrew Walbranb5ab43c2020-04-30 11:32:54 +010053 ffa_tee;
Andrew Walbran41a49d82020-01-10 17:46:38 +000054
David Brazdil0dbb41f2019-09-09 18:03:35 +010055 vm1 {
56 debug_name = "primary VM";
Andrew Scull72b43c02019-09-18 13:53:45 +010057 kernel_filename = "vmlinuz";
David Brazdile6f83222019-09-23 14:47:37 +010058 ramdisk_filename = "initrd.img";
Andrew Scullae9962e2019-10-03 16:51:16 +010059
60 smc_whitelist = <
61 0x04000000
62 0x3200ffff
63 >;
David Brazdil0dbb41f2019-09-09 18:03:35 +010064 };
65
66 vm2 {
67 debug_name = "secondary VM 1";
68 kernel_filename = "kernel0";
69 vcpu_count = <2>;
70 mem_size = <0x100000>;
Andrew Scullae9962e2019-10-03 16:51:16 +010071
Andrew Scull5dc089e2019-11-04 13:21:03 +000072 smc_whitelist_permissive;
David Brazdil0dbb41f2019-09-09 18:03:35 +010073 };
74
75 vm3 {
76 debug_name = "secondary VM 2";
David Brazdil0dbb41f2019-09-09 18:03:35 +010077 vcpu_count = <4>;
78 mem_size = <0x200000>;
79 };
80 };
81};
82```
83
Olivier Deprez41682032021-04-21 10:29:21 +020084## FF-A partition
85Partitions wishing to follow the FF-A specification must respect the
86format specified by the [TF-A binding document](https://trustedfirmware-a.readthedocs.io/en/latest/components/ffa-manifest-binding.html).
Olivier Deprez62d99e32020-01-09 15:58:07 +010087
David Brazdil0dbb41f2019-09-09 18:03:35 +010088## Compiling
89
David Brazdila2358d42020-01-27 18:51:38 +000090Hafnium expects the manifest inside its [RAM disk](HafniumRamDisk.md),
91in DeviceTree's binary format (DTB).
David Brazdil0dbb41f2019-09-09 18:03:35 +010092
David Brazdila2358d42020-01-27 18:51:38 +000093Compile the manifest's source file into a DTB with:
David Brazdil0dbb41f2019-09-09 18:03:35 +010094```shell
David Brazdila2358d42020-01-27 18:51:38 +000095prebuilts/linux-x64/dtc/dtc -I dts -O dtb --out-version 17 -o manifest.dtb <manifest_source_file>
David Brazdil0dbb41f2019-09-09 18:03:35 +010096```