Skip to content

Commit

Permalink
snippets: xen_dom0: update documentation regarding device trees
Browse files Browse the repository at this point in the history
Since device tree overlays from snippets are applied last, it makes
impossible to application to set correct boot addresses in device tree
in own overlay. Since it was removed from snippet, update documentation
with dedicated section.

Signed-off-by: Dmytro Firsov <[email protected]>
Acked-by: Mykola Kvach <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
  • Loading branch information
firscity authored and lorc committed May 29, 2024
1 parent bd85444 commit ec0e853
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions snippets/xen_dom0/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,51 @@ Xen control domain example. To run such setup, you need to:
* take and compile sample device tree from `example/` directory
* build your Zephyr sample/application with `xen_dom0` snippet and start it as Xen control domain

**Important notice regarding device tree**

Xen allocates addresses used for Dom0 image and grant tables/extended regions dynamically so they
may differs on specific setups (they depends on memory banks location and size, application
image size, hypervisor load address used by bootloader etc.). Since Zephyr does not parse device
tree in runtime and is not a position independent executable, it needs to know exact values on
build time. To make it you need to build your final binary, try to boot it with Xen and analyze
hypervisor output to get exact addesses for your setup. They will look as follows:

Grant table region (first reg in hypervisor node):

.. code-block:: console
(XEN) Grant table range: 0x00000088080000-0x000000880c0000
Extended regions (2nd and further regs in hypervisor node):

.. code-block:: console
(XEN) [ 0.928173] d0: extended region 2: 0x40000000->0x47e00000
Zephyr Dom0 memory:

.. code-block:: console
(XEN) Allocating 1:1 mappings for dom0:
(XEN) BANK[0] 0x00000060000000-0x00000070000000 (256MB)
Device tree nodes, that should be added by application overlay for provided example:

.. code-block:: devicetree
hypervisor: hypervisor@88080000 {
compatible = "xen,xen";
reg = <0x0 0x88080000 0x0 0x40000 0x0 0x40000000 0x0 0x7e00000>;
interrupts = <GIC_PPI 0x0 IRQ_TYPE_EDGE IRQ_DEFAULT_PRIORITY>;
interrupt-parent = <&gic>;
status = "okay";
};
ram: memory@60000000 {
device_type = "mmio-sram";
reg = <0x00 0x60000000 0x00 DT_SIZE_M(256)>;
};
For starting you can use QEMU from Zephyr SDK by following command:

.. code-block:: console
Expand Down

0 comments on commit ec0e853

Please sign in to comment.