Skip to content

Commit

Permalink
feat(baremetal): add support for building with different GIC versions
Browse files Browse the repository at this point in the history
Signed-off-by: Diogo Costa <[email protected]>
  • Loading branch information
Diogo21Costa committed May 31, 2024
1 parent a520f91 commit 8f5aa3d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkgs/guest/baremetal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
, setup-cfg
, guest_name ? "baremetal"
, baremetal_srcs_path ? " "
, irq_controller ? " "
}:

stdenv.mkDerivation rec {
Expand Down Expand Up @@ -40,7 +41,12 @@ stdenv.mkDerivation rec {
buildPhase = ''
export ARCH=${setup-cfg.arch}
export CROSS_COMPILE=${setup-cfg.toolchain_name}-
make -C $out PLATFORM=${setup-cfg.platform_name}
if [ ARCH == "aarch64" ]; then
make -C $out PLATFORM=${setup-cfg.platform_name} \
GIC_VERSION=${irq_controller}
else
make -C $out PLATFORM=${setup-cfg.platform_name}
fi
'';

installPhase = ''
Expand Down
12 changes: 11 additions & 1 deletion pkgs/guest/tf/baremetal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
, list_tests ? " "
, list_suites ? " "
, log_level ? "2"
, irq_controller ? " "
}:

stdenv.mkDerivation rec {
Expand Down Expand Up @@ -62,7 +63,16 @@ stdenv.mkDerivation rec {
export CROSS_COMPILE=${setup-cfg.toolchain_name}-
export TESTF_TESTS_DIR=$out/tests/src
export TESTF_REPO_DIR=$out/tests/bao-tests
make -C $out PLATFORM=${setup-cfg.platform_name} BAO_TEST=1 SUITES=${list_suites} TESTS=${list_tests} TESTF_LOG_LEVEL=${log_level}
if [ ARCH == "aarch64" ]; then
make -C $out PLATFORM=${setup-cfg.platform_name} \
BAO_TEST=1 SUITES=${list_suites} TESTS=${list_tests} \
TESTF_LOG_LEVEL=${log_level} \
GIC_VERSION=${irq_controller}
else
make -C $out PLATFORM=${setup-cfg.platform_name} \
BAO_TEST=1 SUITES=${list_suites} TESTS=${list_tests} \
TESTF_LOG_LEVEL=${log_level}
fi
'';

installPhase = ''
Expand Down

0 comments on commit 8f5aa3d

Please sign in to comment.