From 2371483b9a8e3ddc4b0977fcb8d10468c54178ee Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Fri, 25 Jun 2021 16:24:51 -0400 Subject: [PATCH] cedar build --- configuration.nix | 1 + kernel/Pine64-PineCube-support.patch | 32 ++++++++++++++++++++++++---- kernel/sunxi-cedar.nix | 17 +++++++++------ 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/configuration.nix b/configuration.nix index b76ce99..8939735 100644 --- a/configuration.nix +++ b/configuration.nix @@ -50,6 +50,7 @@ ffmpeg (v4l_utils.override { withGUI = false; }) usbutils + gcc gnumake cmake ]; ### diff --git a/kernel/Pine64-PineCube-support.patch b/kernel/Pine64-PineCube-support.patch index 0ac08bf..936a5c8 100644 --- a/kernel/Pine64-PineCube-support.patch +++ b/kernel/Pine64-PineCube-support.patch @@ -43,17 +43,41 @@ diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi index e5312869c0d2..b4069df84d10 100644 --- a/arch/arm/boot/dts/sun8i-v3s.dtsi +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi -@@ -138,6 +138,15 @@ mixer0_out_tcon0: endpoint { +@@ -138,6 +138,39 @@ mixer0_out_tcon0: endpoint { }; }; -+ syscon: system-control@1c00000 { -+ compatible = "allwinner,sun8i-v3s-system-control", -+ "allwinner,sun8i-h3-system-control"; ++syscon: system-control@1c00000 { ++ compatible = "allwinner,sun8i-h3-system-control","syscon"; + reg = <0x01c00000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; ++ ++ sram_c: sram@1d00000 { ++ compatible = "mmio-sram"; ++ reg = <0x01d00000 0x80000>; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0 0x01d00000 0x80000>; ++ ++ ve_sram: sram-section@0 { ++ compatible = "allwinner,sun8i-h3-sram-c1", ++ "allwinner,sun4i-a10-sram-c1"; ++ reg = <0x000000 0x80000>; ++ }; ++ }; ++ }; ++ve: video-engine@01c0e000 { ++ compatible = "allwinner,sunxi-cedar-ve"; ++ reg = < 0x1c0e000 0x1000 0x1c00000 0x10 0x1c20000 0x800 >; ++ memory-region = < 0x84 >; ++ syscon = < 0x15 >; ++ clocks = < 0x03 0x29 0x03 0x6c 0x03 0x61 >; ++ clock-names = "ahb\0mod\0ram"; ++ resets = < 0x03 0x1a >; ++ status = "okay"; ++ interrupts = < 0x00 0x3a 0x04 >; + }; + tcon0: lcd-controller@1c0c000 { diff --git a/kernel/sunxi-cedar.nix b/kernel/sunxi-cedar.nix index 4f48a1d..abb4ae5 100644 --- a/kernel/sunxi-cedar.nix +++ b/kernel/sunxi-cedar.nix @@ -11,15 +11,20 @@ stdenv.mkDerivation rec { sha256 = "s/Cxr1GlmvORBvoJvU0LCpezacuQv5qT/9GyJYcAtq4="; }; - makeFlags = [ - # For Makefile.linux - #"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - #"INSTALL_MOD_PATH=$(out)" - #"KERNELRELEASE=${kernel.modDirVersion}" + preConfigure = '' + # forgive my laziness... add an install target to Makefile + echo "install:" >> Makefile + echo " $MAKE -C $KERNEL_SOURCE M=$PWD install" >> Makefile + ''; - # For Makefile + # For "Makefile" + makeFlags = [ + "ARCH=arm" "KERNEL_SOURCE=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "CROSS_COMPILE=armv7l-unknown-linux-gnueabihf-" + "INSTALL_MOD_PATH=$(out)" ]; + nativeBuildInputs = kernel.moduleBuildDependencies; hardeningDisable = [ "pic" ];