Skip to content

Instantly share code, notes, and snippets.

@samueldr

samueldr/tmp.nix Secret

Created May 12, 2021 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueldr/f4894cd1597d61bbeee50ff242c3b271 to your computer and use it in GitHub Desktop.
Save samueldr/f4894cd1597d61bbeee50ff242c3b271 to your computer and use it in GitHub Desktop.
{ pkgs, ... }:
{
hardware.deviceTree = {
filter = "bcm2711-rpi-*.dtb";
overlays = [
# Equivalent to:
# https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/cma-overlay.dts
{
name = "rpi4-cma-overlay";
dtsText = ''
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2711";
fragment@0 {
target = <&cma>;
__overlay__ {
size = <(${toString 512 /* FIXME: option ? */} * 1024 * 1024)>;
};
};
};
'';
}
# Equivalent to:
# https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts
{
name = "rpi4-vc4-fkms-v3d-overlay";
dtsText = ''
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2711";
fragment@1 {
target = <&fb>;
__overlay__ {
status = "disabled";
};
};
fragment@2 {
target = <&firmwarekms>;
__overlay__ {
status = "okay";
};
};
fragment@3 {
target = <&v3d>;
__overlay__ {
status = "okay";
};
};
fragment@4 {
target = <&vc4>;
__overlay__ {
status = "okay";
};
};
};
'';
}
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment