blob: b6a6cdbdf9782872813afc6805cc89f30d49dbf9 [file] [log] [blame] [view]
David Brazdil0dbb41f2019-09-09 18:03:35 +01001# Hafnium Manifest
2
3## Format
4
5The format of the manifest is a simple DeviceTree overlay:
6
7```
8/dts-v1/;
David Brazdil0dbb41f2019-09-09 18:03:35 +01009
David Brazdila2358d42020-01-27 18:51:38 +000010/ {
David Brazdil0dbb41f2019-09-09 18:03:35 +010011 hypervisor {
David Brazdilea707d62019-11-06 10:10:17 +000012 compatible = "hafnium,hafnium";
13
Olivier Deprez622ab8d2021-08-02 12:15:45 +020014 ffa_tee_enabled;
Andrew Walbran41a49d82020-01-10 17:46:38 +000015
David Brazdil0dbb41f2019-09-09 18:03:35 +010016 vm1 {
17 debug_name = "name";
Andrew Scull72b43c02019-09-18 13:53:45 +010018 kernel_filename = "vmlinuz";
David Brazdile6f83222019-09-23 14:47:37 +010019 ramdisk_filename = "initrd.img";
David Brazdil0dbb41f2019-09-09 18:03:35 +010020 };
21
22 vm2 {
23 debug_name = "name";
24 kernel_filename = "filename";
25 vcpu_count = <N>;
26 mem_size = <M>;
27 };
28 ...
29 };
30};
31```
32
David Brazdil0dbb41f2019-09-09 18:03:35 +010033## Example
34
Andrew Scull72b43c02019-09-18 13:53:45 +010035The following manifest defines a primary VM with two secondary VMs. The first
36secondary VM has 1MB of memory, 2 CPUs and kernel image called `kernel0`
37(matches filename in Hafnium's [ramdisk](HafniumRamDisk.md)). The second has 2MB
38of memory, 4 CPUs and, by omitting the `kernel_filename` property, a kernel
39preloaded into memory. The primary VM is given all remaining memory, the same
David Brazdile6f83222019-09-23 14:47:37 +010040number of CPUs as the hardware, a kernel image called `vmlinuz` and a ramdisk
Andrew Walbranb5ab43c2020-04-30 11:32:54 +010041`initrd.img`. Secondaries cannot have a ramdisk. FF-A memory sharing with the
Andrew Walbran41a49d82020-01-10 17:46:38 +000042TEE is enabled.
David Brazdil0dbb41f2019-09-09 18:03:35 +010043
44```
45/dts-v1/;
David Brazdil0dbb41f2019-09-09 18:03:35 +010046
David Brazdila2358d42020-01-27 18:51:38 +000047/ {
David Brazdil0dbb41f2019-09-09 18:03:35 +010048 hypervisor {
David Brazdilea707d62019-11-06 10:10:17 +000049 compatible = "hafnium,hafnium";
50
Olivier Deprez622ab8d2021-08-02 12:15:45 +020051 ffa_tee_enabled;
Andrew Walbran41a49d82020-01-10 17:46:38 +000052
David Brazdil0dbb41f2019-09-09 18:03:35 +010053 vm1 {
54 debug_name = "primary VM";
Andrew Scull72b43c02019-09-18 13:53:45 +010055 kernel_filename = "vmlinuz";
David Brazdile6f83222019-09-23 14:47:37 +010056 ramdisk_filename = "initrd.img";
Andrew Scullae9962e2019-10-03 16:51:16 +010057
58 smc_whitelist = <
59 0x04000000
60 0x3200ffff
61 >;
David Brazdil0dbb41f2019-09-09 18:03:35 +010062 };
63
64 vm2 {
65 debug_name = "secondary VM 1";
66 kernel_filename = "kernel0";
67 vcpu_count = <2>;
68 mem_size = <0x100000>;
Andrew Scullae9962e2019-10-03 16:51:16 +010069
Andrew Scull5dc089e2019-11-04 13:21:03 +000070 smc_whitelist_permissive;
David Brazdil0dbb41f2019-09-09 18:03:35 +010071 };
72
73 vm3 {
74 debug_name = "secondary VM 2";
David Brazdil0dbb41f2019-09-09 18:03:35 +010075 vcpu_count = <4>;
76 mem_size = <0x200000>;
77 };
78 };
79};
80```
81
Olivier Deprez41682032021-04-21 10:29:21 +020082## FF-A partition
83Partitions wishing to follow the FF-A specification must respect the
84format 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 +010085
David Brazdil0dbb41f2019-09-09 18:03:35 +010086## Compiling
87
David Brazdila2358d42020-01-27 18:51:38 +000088Hafnium expects the manifest inside its [RAM disk](HafniumRamDisk.md),
89in DeviceTree's binary format (DTB).
David Brazdil0dbb41f2019-09-09 18:03:35 +010090
David Brazdila2358d42020-01-27 18:51:38 +000091Compile the manifest's source file into a DTB with:
David Brazdil0dbb41f2019-09-09 18:03:35 +010092```shell
David Brazdila2358d42020-01-27 18:51:38 +000093prebuilts/linux-x64/dtc/dtc -I dts -O dtb --out-version 17 -o manifest.dtb <manifest_source_file>
David Brazdil0dbb41f2019-09-09 18:03:35 +010094```