-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
machine: add toradex apalis imx6 board configs (#2)
* Add toradex apalis imx6 board configs * Disable firmware for toradex apalis imx6 * Add build for toradex apalis imx6 minimal image into TravisCI
- Loading branch information
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
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
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,62 @@ | ||
{ config, pkgs, ... }: | ||
let | ||
toradex_apalis_imx6 = import ./system.nix; | ||
in | ||
{ | ||
# specify the system we're compiling to | ||
nixpkgs.crossSystem = toradex_apalis_imx6; | ||
|
||
# enable free firmware | ||
hardware.enableRedistributableFirmware = false; | ||
|
||
# specify a good kernel version | ||
boot.kernelPackages = pkgs.linuxPackages_5_0; | ||
|
||
# do our own boot-loader | ||
boot.loader.grub.enable = false; | ||
boot.loader.systemd-boot.enable = false; | ||
boot.loader.generic-extlinux-compatible.enable = false; | ||
|
||
# build & install boot loader | ||
sdImage.populateBootCommands = let | ||
kernel = toradex_apalis_imx6.platform.kernelTarget; | ||
init = "${config.system.build.toplevel}/init"; | ||
root = "/dev/mmcblk2p2"; | ||
uboot = pkgs.buildUBoot { | ||
defconfig = "apalis_imx6_defconfig"; | ||
extraMeta.platforms = [toradex_apalis_imx6.system]; | ||
filesToInstall = ["SPL" "u-boot.img"]; | ||
}; | ||
uEnv = pkgs.writeText "uEnv.txt" '' | ||
bootdir= | ||
bootcmd=run uenvcmd; | ||
bootfile=${kernel} | ||
fdtfile=${toradex_apalis_imx6.dtb} | ||
loadaddr=0x11000000 | ||
fdtaddr=0x12000000 | ||
loadfdt=load mmc 0:1 ''${fdtaddr} ''${fdtfile} | ||
loaduimage=load mmc 0:1 ''${loadaddr} ''${bootfile} | ||
uenvcmd=mmc rescan; run loaduimage; run loadfdt; run fdtboot | ||
fdtboot=run mmc_args; bootz ''${loadaddr} - ''${fdtaddr} | ||
mmc_args=setenv bootargs console=''${console} ''${optargs} root=${root} rootfstype=ext4 init=${init} | ||
''; | ||
|
||
# Populate result/nix-support/tezi folder for ToradexEasyInstaller. | ||
populateToradexTezi = '' | ||
mkdir -p $out/nix-support/tezi/ | ||
cp ${uboot}/SPL $out/nix-support/tezi/ | ||
cp ${uboot}/u-boot.img $out/nix-support/tezi/ | ||
cp ${config.boot.kernelPackages.kernel}/${kernel} $out/nix-support/tezi/ | ||
cp ${config.boot.kernelPackages.kernel}/dtbs/${toradex_apalis_imx6.dtb} $out/nix-support/tezi/ | ||
cp ${uEnv} $out/nix-support/tezi/uEnv.txt | ||
''; | ||
|
||
in '' | ||
${populateToradexTezi} | ||
cp ${uboot}/SPL boot/ | ||
cp ${uboot}/u-boot.img boot/ | ||
cp ${config.boot.kernelPackages.kernel}/${kernel} boot/ | ||
cp ${config.boot.kernelPackages.kernel}/dtbs/${toradex_apalis_imx6.dtb} boot/ | ||
cp ${uEnv} boot/uEnv.txt | ||
''; | ||
} |
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,22 @@ | ||
with builtins; | ||
{ | ||
config = "armv7l-unknown-linux-gnueabihf"; | ||
system = "armv7l-linux"; | ||
platform = { | ||
name = "toradex_apalis_imx6"; | ||
kernelBaseConfig = "imx_v6_v7_defconfig"; | ||
kernelAutoModules = false; | ||
kernelTarget = "zImage"; | ||
kernelMajor = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc. | ||
kernelArch = "arm"; | ||
kernelDTB = true; | ||
kernelPreferBuiltin = true; | ||
kernelExtraConfig = '' | ||
''; | ||
gcc = { | ||
cpu = "cortex-a9"; | ||
fpu = "neon"; | ||
}; | ||
}; | ||
dtb = "imx6q-apalis-eval.dtb"; | ||
} |