Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove buildUBoot function from U-Boot build #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 72 additions & 23 deletions nxp/imx8mp-evk/bsp/imx8mp-uboot.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,57 @@
{pkgs}:
with pkgs; let
inherit buildUBoot;
in
(buildUBoot {
pname = "imx8mp-uboot";
version = "2023.04";

src = fetchgit {
{ stdenv
, lib
, bison
, dtc
, fetchgit
, flex
, gnutls
, libuuid
, ncurses
, openssl
, which
, perl
, buildPackages
}:
let
ubsrc = fetchgit {
url = "https://github.com/nxp-imx/uboot-imx.git";
# tag: "lf-6.1.55-2.2.0"
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
};
in
(stdenv.mkDerivation {
pname = "imx8mp-uboot";
version = "2023.04";
src = ubsrc;

extraConfig = ''
postPatch = ''
patchShebangs tools
patchShebangs scripts
'';

nativeBuildInputs = [
bison
flex
openssl
which
ncurses
libuuid
gnutls
openssl
perl
];

depsBuildBuild = [ buildPackages.stdenv.cc ];
hardeningDisable = [ "all" ];
enableParallelBuilding = true;

makeFlags = [
"DTC=${lib.getExe buildPackages.dtc}"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];

extraConfig = ''
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
CONFIG_CMD_BOOTEFI_SELFTEST=y
Expand All @@ -25,17 +63,28 @@ in
CONFIG_CMD_CACHE=y
'';

enableParallelBuilding = true;
defconfig = "imx8mp_evk_defconfig";
extraMeta.platforms = ["aarch64-linux"];

filesToInstall = [
"./u-boot-nodtb.bin"
"./spl/u-boot-spl.bin"
"./arch/arm/dts/imx8mp-evk.dtb"
".config"
];
})
.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.perl];
passAsFile = [ "extraConfig" ];

configurePhase = ''
runHook preConfigure

make imx8mp_evk_defconfig
cat $extraConfigPath >> .config

runHook postConfigure
'';

installPhase = ''
runHook preInstall

mkdir -p $out
cp ./u-boot-nodtb.bin $out
cp ./spl/u-boot-spl.bin $out
cp ./arch/arm/dts/imx8mp-evk.dtb $out
cp .config $out

runHook postInstall
'';

dontStrip = true;
})
95 changes: 72 additions & 23 deletions nxp/imx8mq-evk/bsp/imx8mq-uboot.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,57 @@
{pkgs}:
with pkgs; let
inherit buildUBoot;
in
(buildUBoot {
pname = "imx8mq-uboot";
version = "2023.04";

src = fetchgit {
{ stdenv
, lib
, bison
, dtc
, fetchgit
, flex
, gnutls
, libuuid
, ncurses
, openssl
, which
, perl
, buildPackages
}:
let
ubsrc = fetchgit {
url = "https://github.com/nxp-imx/uboot-imx.git";
# tag: "lf-6.1.55-2.2.0"
rev = "49b102d98881fc28af6e0a8af5ea2186c1d90a5f";
sha256 = "sha256-1j6X82DqezEizeWoSS600XKPNwrQ4yT0vZuUImKAVVA=";
};
in
(stdenv.mkDerivation {
pname = "imx8mq-uboot";
version = "2023.04";
src = ubsrc;

extraConfig = ''
postPatch = ''
patchShebangs tools
patchShebangs scripts
'';

nativeBuildInputs = [
bison
flex
openssl
which
ncurses
libuuid
gnutls
openssl
perl
];

depsBuildBuild = [ buildPackages.stdenv.cc ];
hardeningDisable = [ "all" ];
enableParallelBuilding = true;

makeFlags = [
"DTC=${lib.getExe buildPackages.dtc}"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];

extraConfig = ''
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="setenv ramdisk_addr_r 0x45000000; setenv fdt_addr_r 0x44000000; run distro_bootcmd; "
CONFIG_CMD_BOOTEFI_SELFTEST=y
Expand All @@ -25,17 +63,28 @@ in
CONFIG_CMD_CACHE=y
'';

enableParallelBuilding = true;
defconfig = "imx8mq_evk_defconfig";
extraMeta.platforms = ["aarch64-linux"];

filesToInstall = [
"./u-boot-nodtb.bin"
"./spl/u-boot-spl.bin"
"./arch/arm/dts/imx8mq-evk.dtb"
".config"
];
})
.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.perl];
passAsFile = [ "extraConfig" ];

configurePhase = ''
runHook preConfigure

make imx8mq_evk_defconfig
cat $extraConfigPath >> .config

runHook postConfigure
'';

installPhase = ''
runHook preInstall

mkdir -p $out
cp ./u-boot-nodtb.bin $out
cp ./spl/u-boot-spl.bin $out
cp ./arch/arm/dts/imx8mq-evk.dtb $out
cp .config $out

runHook postInstall
'';

dontStrip = true;
})