Skip to content

Commit

Permalink
Workaround to get HDMI working
Browse files Browse the repository at this point in the history
Xen doesn't map any range of memory not explicitly specified in the device
tree. Unfortunately, the framebuffer memory region is not specified in the
device tree, so Xen doesn't map that region. Accesses to the framebuffer memory
were being trapped by Xen, leading to a Linux kernel panic.

Work around this by introducing a dummy device to get Xen to map the frame
buffer region.

Signed-off-by: Stewart Hildebrand <[email protected]>
  • Loading branch information
stewdk committed Nov 18, 2021
1 parent 2d29489 commit be5f8ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ When the script is finished, flash to SD card with (for example):
Xen will print messages to the UART.
Log in with username `dornerworks` password `dornerworks`.

To install a graphical desktop, expand the rootfs partition, ensure that you have an internet connection, run the command `sudo apt install ubuntu-desktop`, and reboot.

This script is a little bit like [https://github.com/mirage/xen-arm-builder](https://github.com/mirage/xen-arm-builder) and [https://github.com/RPi-Distro/pi-gen](https://github.com/RPi-Distro/pi-gen) but for Xen+Ubuntu instead of Raspbian.
More info about Ubuntu Base is available here [https://wiki.ubuntu.com/Base](https://wiki.ubuntu.com/Base).

## Limitations

* HDMI not working
* Raspberry Pi kernel not suitable for domU
* aux spi1 and aux spi2 are disabled

Expand Down
30 changes: 24 additions & 6 deletions patches/linux/0001-Add-Xen-overlay-for-the-Pi-4.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Subject: [PATCH] Add Xen overlay for the Pi 4

Signed-off-by: Corey Minyard <[email protected]>
---
arch/arm/boot/dts/overlays/Makefile | 4 +++-
.../boot/dts/overlays/pi4-32-xen-overlay.dts | 21 +++++++++++++++++++
.../boot/dts/overlays/pi4-64-xen-overlay.dts | 21 +++++++++++++++++++
3 files changed, 45 insertions(+), 1 deletion(-)
arch/arm/boot/dts/overlays/Makefile | 4 +-
.../boot/dts/overlays/pi4-32-xen-overlay.dts | 21 ++++++++++
.../boot/dts/overlays/pi4-64-xen-overlay.dts | 39 +++++++++++++++++++
3 files changed, 63 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boot/dts/overlays/pi4-32-xen-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/pi4-64-xen-overlay.dts

Expand Down Expand Up @@ -55,10 +55,10 @@ index 000000000000..47afa6ac24b7
+};
diff --git a/arch/arm/boot/dts/overlays/pi4-64-xen-overlay.dts b/arch/arm/boot/dts/overlays/pi4-64-xen-overlay.dts
new file mode 100644
index 000000000000..362e238576bf
index 000000000000..6c499a831db6
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/pi4-64-xen-overlay.dts
@@ -0,0 +1,21 @@
@@ -0,0 +1,39 @@
+// Xen configuration for Pi 4
+/dts-v1/;
+/plugin/;
Expand All @@ -79,6 +79,24 @@ index 000000000000..362e238576bf
+ };
+ };
+ };
+
+ /* Introduce a dummy device node to make Xen map the framebuffer */
+ fragment@1 {
+ target-path = "/";
+ __overlay__ {
+ fb_bus {
+ compatible = "simple-bus";
+ ranges;
+ #address-cells = <2>;
+ #size-cells = <1>;
+ fb_mem {
+ compatible = "dummy";
+ status = "okay";
+ reg = <0x0 0x3b400000 0x04c00000>;
+ };
+ };
+ };
+ };
+};
--
2.34.0
Expand Down

0 comments on commit be5f8ce

Please sign in to comment.