Skip to content

Commit

Permalink
snippets: add rpi_5_xen_domd to demo hw passing to xen domain
Browse files Browse the repository at this point in the history
Add rpi_5_xen_domd snippet to demonstrate enabling RPI 5 HW in Xen domain.
Only GPIO LED is supported.

Signed-off-by: Grygorii Strashko <[email protected]>
  • Loading branch information
Grygorii Strashko committed May 3, 2024
1 parent c8d922a commit e8daa5b
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
17 changes: 17 additions & 0 deletions snippets/rpi_5_xen_domd/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _rpi_5_xen_domd:

RPI 5 Xen DomD: snippet for XEN HW domain
#########################################

Overview
********

This snippet allows user to build Zephyr `xenvm` with RPI 5 hardware support as
a Xen hardware domain (DomD) to demonstrate how RPI 5 hardware can be passed to Xen domain.
Only GPIO LED is supported for now.

For example:

.. code-block:: console
west build -b xenvm -S rpi_5_xen_domd samples/basic/blinky
3 changes: 3 additions & 0 deletions snippets/rpi_5_xen_domd/rpi_5_xen_domd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_ARM64_VA_BITS_40=y
CONFIG_ARM64_PA_BITS_40=y
CONFIG_UART_INTERRUPT_DRIVEN=n
45 changes: 45 additions & 0 deletions snippets/rpi_5_xen_domd/rpi_5_xen_domd.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2024 EPAM Systems.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <mem.h>
#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
compatible = "raspberrypi,5-model-b-domd", "raspberrypi,5-model-b", "brcm,bcm2712";
model = "Raspberry Pi 5 Xen DomD";

chosen {
zephyr,shell-uart = &xen_hvc;
};

aliases {
led0 = &led_act;
};

leds {
compatible = "gpio-leds";

led_act: led-act {
gpios = <&gio_aon 9 GPIO_ACTIVE_LOW>;
label = "ACT";
};
};

gpio2@107d517c00 {
compatible = "simple-bus";
reg = <0x10 0x7d517c00 0x0 0x40>;

#address-cells = <1>;
#size-cells = <0>;
gio_aon: gpio@0 {
compatible = "brcm,brcmstb-gpio";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <17>;
};
};
};
4 changes: 4 additions & 0 deletions snippets/rpi_5_xen_domd/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: rpi_5_xen_domd
append:
EXTRA_DTC_OVERLAY_FILE: rpi_5_xen_domd.overlay
EXTRA_CONF_FILE: rpi_5_xen_domd.conf

0 comments on commit e8daa5b

Please sign in to comment.