From 7f04c352c14c0253110305df4f62162fe06ba646 Mon Sep 17 00:00:00 2001 From: Dmytro Firsov Date: Tue, 8 Aug 2023 12:47:50 +0300 Subject: [PATCH] snippets: xen_dom0: add support for Renesas R-Car Gen3 boards Renesas rcar_h3ulcb_ca57 and rcar_salvator_xs_m3 boards support recently was added to Zephyr mainline. Add Xen control domain guest support for them via xen_dom0 snippet extention. Note: please pay attetion to overlay nodes and comments in case of any issues on your setup. Signed-off-by: Dmytro Firsov --- .../xen_dom0/boards/rcar_h3ulcb_ca57.overlay | 41 +++++++++++++++++++ .../boards/rcar_salvator_xs_m3.overlay | 41 +++++++++++++++++++ snippets/xen_dom0/snippet.yml | 6 +++ 3 files changed, 88 insertions(+) create mode 100644 snippets/xen_dom0/boards/rcar_h3ulcb_ca57.overlay create mode 100644 snippets/xen_dom0/boards/rcar_salvator_xs_m3.overlay diff --git a/snippets/xen_dom0/boards/rcar_h3ulcb_ca57.overlay b/snippets/xen_dom0/boards/rcar_h3ulcb_ca57.overlay new file mode 100644 index 000000000000..9af28690c2cd --- /dev/null +++ b/snippets/xen_dom0/boards/rcar_h3ulcb_ca57.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 EPAM Systems. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/delete-node/ &ram; +/delete-node/ &scif2; + +/ { + /* + * This node may differs on different setups, please check + * following line in Xen boot log to set it right: + * (XEN) Grant table range: 0x00000088080000-0x000000880c0000 + * + * Xen passes actual values for setup in domain device tree, but Zephyr + * is not capable to parse and handle it in runtime. + */ + hypervisor: hypervisor@88080000 { + compatible = "xen,xen"; + reg = <0x0 0x88080000 0x0 0x40000>; + interrupts = ; + interrupt-parent = <&gic>; + status = "okay"; + }; + + /* + * This node may differs on different setups, because Xen picks + * region for Domain-0 for every specific configuration. You can + * start Xen for your platform and check following log: + * (XEN) Allocating 1:1 mappings for dom0: + * (XEN) BANK[0] 0x00000060000000-0x00000070000000 (256MB) + * + * Xen passes actual values for setup in domain device tree, but Zephyr + * is not capable to parse and handle it in runtime. + */ + ram: memory@60000000 { + device_type = "mmio-sram"; + reg = <0x00 0x60000000 0x00 DT_SIZE_M(256)>; + }; +}; diff --git a/snippets/xen_dom0/boards/rcar_salvator_xs_m3.overlay b/snippets/xen_dom0/boards/rcar_salvator_xs_m3.overlay new file mode 100644 index 000000000000..9af28690c2cd --- /dev/null +++ b/snippets/xen_dom0/boards/rcar_salvator_xs_m3.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 EPAM Systems. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/delete-node/ &ram; +/delete-node/ &scif2; + +/ { + /* + * This node may differs on different setups, please check + * following line in Xen boot log to set it right: + * (XEN) Grant table range: 0x00000088080000-0x000000880c0000 + * + * Xen passes actual values for setup in domain device tree, but Zephyr + * is not capable to parse and handle it in runtime. + */ + hypervisor: hypervisor@88080000 { + compatible = "xen,xen"; + reg = <0x0 0x88080000 0x0 0x40000>; + interrupts = ; + interrupt-parent = <&gic>; + status = "okay"; + }; + + /* + * This node may differs on different setups, because Xen picks + * region for Domain-0 for every specific configuration. You can + * start Xen for your platform and check following log: + * (XEN) Allocating 1:1 mappings for dom0: + * (XEN) BANK[0] 0x00000060000000-0x00000070000000 (256MB) + * + * Xen passes actual values for setup in domain device tree, but Zephyr + * is not capable to parse and handle it in runtime. + */ + ram: memory@60000000 { + device_type = "mmio-sram"; + reg = <0x00 0x60000000 0x00 DT_SIZE_M(256)>; + }; +}; diff --git a/snippets/xen_dom0/snippet.yml b/snippets/xen_dom0/snippet.yml index d3af96f9527a..cb6fddeaccdc 100644 --- a/snippets/xen_dom0/snippet.yml +++ b/snippets/xen_dom0/snippet.yml @@ -7,3 +7,9 @@ boards: qemu_cortex_a53: append: EXTRA_DTC_OVERLAY_FILE: boards/qemu_cortex_a53.overlay + rcar_h3ulcb_ca57: + append: + EXTRA_DTC_OVERLAY_FILE: boards/rcar_h3ulcb_ca57.overlay + rcar_salvator_xs_m3: + append: + EXTRA_DTC_OVERLAY_FILE: boards/rcar_salvator_xs_m3.overlay