diff --git a/devices/motorola-rav/kernel/0001-Mobile-NixOS-Enable-simplefb-framebuffer.patch b/devices/motorola-rav/kernel/0001-Mobile-NixOS-Enable-simplefb-framebuffer.patch new file mode 100644 index 00000000..09b86612 --- /dev/null +++ b/devices/motorola-rav/kernel/0001-Mobile-NixOS-Enable-simplefb-framebuffer.patch @@ -0,0 +1,58 @@ +From 9d8ef8d5040691cf6bbd5872887f8b523b123597 Mon Sep 17 00:00:00 2001 +From: Samuel Dionne-Riel +Date: Tue, 29 Jun 2021 21:13:16 -0400 +Subject: [PATCH] [Mobile NixOS]: Enable simplefb framebuffer + +Note that when the DRM subsystem kick-in, it will irreparably trample +over the framebuffer setup. +--- + arch/arm64/boot/dts/qcom/trinket-rav-base.dts | 36 +++++++++++++++++++ + 1 file changed, 36 insertions(+) + +diff --git a/arch/arm64/boot/dts/qcom/trinket-rav-base.dts b/arch/arm64/boot/dts/qcom/trinket-rav-base.dts +index f89a2757a3363..b474a15aeebf7 100644 +--- a/arch/arm64/boot/dts/qcom/trinket-rav-base.dts ++++ b/arch/arm64/boot/dts/qcom/trinket-rav-base.dts +@@ -23,3 +23,39 @@ + &firmware { + /delete-node/ android; + }; ++ ++/ { ++ aliases { ++ display0 = &framebuffer0; ++ }; ++ ++ chosen { ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ranges; ++ stdout-path = "display0"; ++ ++ /* ++ * HACK: Use framebuffer setup by the bootloader for simplefb. ++ * https://wiki.postmarketos.org/wiki/SDM845_Mainlining#Creating_a_framebuffer ++ * 0x5C000000, 0x01000000, "Display Reserved", AddMem, MEM_RES, SYS_MEM_CAP, Reserv, WRITE_THROUGH_XN ++ */ ++ framebuffer0: framebuffer@9d400000 { ++ compatible = "simple-framebuffer"; ++ reg = <0 0x5C000000 0 (720 * 1560 * 4)>; ++ width = <720>; ++ height = <1560>; ++ stride = <(720 * 4)>; ++ format = "a8r8g8b8"; ++ status = "okay"; ++ }; ++ }; ++ ++ reserved-memory { ++ fb_mem: memory@a1a10000 { ++ compatible = "removed-dma-pool"; ++ no-map; ++ reg = <0 0x5C000000 0 (720 * 1560 * 4)>; ++ }; ++ }; ++}; +-- +2.29.2 + diff --git a/devices/motorola-rav/kernel/config.aarch64 b/devices/motorola-rav/kernel/config.aarch64 index dfb22b2c..dc303095 100644 --- a/devices/motorola-rav/kernel/config.aarch64 +++ b/devices/motorola-rav/kernel/config.aarch64 @@ -3331,7 +3331,7 @@ CONFIG_FB_VIRTUAL=y # CONFIG_FB_MSM is not set # CONFIG_FB_BROADSHEET is not set # CONFIG_FB_AUO_K190X is not set -# CONFIG_FB_SIMPLE is not set +CONFIG_FB_SIMPLE=y # CONFIG_MSM_DBA is not set # CONFIG_FB_SSD1307 is not set # CONFIG_FB_SM712 is not set diff --git a/devices/motorola-rav/kernel/default.nix b/devices/motorola-rav/kernel/default.nix index 8e059096..fda051ba 100644 --- a/devices/motorola-rav/kernel/default.nix +++ b/devices/motorola-rav/kernel/default.nix @@ -28,6 +28,7 @@ mobile-nixos.kernel-builder-clang_8 { ./0001-HACK-himax_mmi-Fix-early-init-and-work-around-suspen.patch ./0001-himax_0flash_mmi-Fix-for-built-in-module.patch ./0003-arch-arm64-Add-config-option-to-fix-bootloader-cmdli.patch + ./0001-Mobile-NixOS-Enable-simplefb-framebuffer.patch ]; enableRemovingWerror = true;