-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from juliuskoskela/ghaf_integration
Implement building with Nix flake
- Loading branch information
Showing
9 changed files
with
1,227 additions
and
40 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2023 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
description = "bpmp-virt"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
flake-utils, | ||
}: let | ||
systems = with flake-utils.lib.system; [ | ||
x86_64-linux | ||
aarch64-linux | ||
]; | ||
in | ||
# Combine list of attribute sets together | ||
nixpkgs.lib.foldr nixpkgs.lib.recursiveUpdate {} [ | ||
(flake-utils.lib.eachSystem systems (system: { | ||
formatter = nixpkgs.legacyPackages.${system}.alejandra; | ||
})) | ||
|
||
{ | ||
nixosModules.bpmp-virt-host = ./nixosModules/bpmp-virt-host.nix; | ||
nixosModules.bpmp-virt-guest = ./nixosModules/bpmp-virt-guest.nix; | ||
} | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
[[ ! -d linux-tegra-5.10 ]] && git clone https://github.com/OE4T/linux-tegra-5.10 --branch oe4t-patches-l4t-r35.3.ga --single-branch linux-tegra-5.10 | ||
|
||
pushd linux-tegra-5.10 | ||
git reset --hard | ||
git clean -xdf | ||
|
||
cp -Rv ../drivers/bpmp-{guest,host}-proxy ./drivers/ | ||
cat ../drivers/Kconfig >> drivers/Kconfig | ||
cat ../drivers/Makefile >> drivers/Makefile | ||
|
||
git add . | ||
git commit -m "Virtual BPMP drivers" | ||
git format-patch -k -1 -o .. | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright 2023 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{lib, ...}: { | ||
boot.kernelPatches = [ | ||
{ | ||
name = "BPMP Driver patch"; | ||
patch = ../0001-Virtual-BPMP-drivers.patch; | ||
} | ||
{ | ||
name = "VFIO reset patch"; | ||
patch = ../0002-vfio_platform-reset-required-false.patch; | ||
} | ||
{ | ||
name = "BPMP support patch"; | ||
patch = ../0003-bpmp-support-bpmp-virt.patch; | ||
} | ||
{ | ||
name = "BPMP kernel configuration"; | ||
patch = null; | ||
extraStructuredConfig = with lib.kernel; { | ||
CONFIG_HOTPLUG_PCI = yes; | ||
CONFIG_PCI_DEBUG = yes; | ||
CONFIG_PCI_HOST_GENERIC = yes; | ||
CONFIG_PCI_STUB = yes; | ||
CONFIG_VFIO = yes; | ||
CONFIG_VFIO_IOMMU_TYPE1 = yes; | ||
CONFIG_VIRTIO_MMIO = yes; | ||
CONFIG_VIRTIO_PCI = yes; | ||
CONFIG_HOTPLUG_PCI_ACPI = yes; | ||
CONFIG_PCI_HOST_COMMON = yes; | ||
}; | ||
} | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2023 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{lib, ...}: { | ||
imports = [ | ||
./bpmp-virt-common.nix | ||
]; | ||
boot.kernelPatches = [ | ||
{ | ||
name = "BPMP virt enable guest"; | ||
patch = null; | ||
extraStructuredConfig = with lib.kernel; { | ||
TEGRA_BPMP_GUEST_PROXY = yes; | ||
}; | ||
} | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2023 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{lib, ...}: { | ||
imports = [ | ||
./bpmp-virt-common.nix | ||
]; | ||
boot.kernelPatches = [ | ||
{ | ||
name = "BPMP virt enable host"; | ||
patch = null; | ||
extraStructuredConfig = with lib.kernel; { | ||
TEGRA_BPMP_HOST_PROXY = yes; | ||
}; | ||
} | ||
]; | ||
} |
This file was deleted.
Oops, something went wrong.