rockchip: support generic firmware installation
This commit is contained in:
parent
ab84bd93a3
commit
0b2e2fe9b3
5 changed files with 24 additions and 43 deletions
|
|
@ -74,8 +74,8 @@ Below is an annoated flake example to create the initial boot image.
|
|||
# Override the default bootloader with a cross built one.
|
||||
# Use this if you do not have binfmt configured on your system.
|
||||
# For NixOS, please add `boot.binfmt.emulatedSystems = [ "aarch64-linux" ];` to your system configuration.
|
||||
# Update the system and the firmware package according to your device.
|
||||
# hardware.radxa.rock-4c-plus.platformFirmware = nixpkgs-unfree.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.ubootRock4CPlus;
|
||||
# Read the device module to see how it was configured.
|
||||
# hardware.rockchip.platformFirmware = nixpkgs-unfree.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.ubootRock4CPlus;
|
||||
|
||||
users.users.radxa = {
|
||||
isNormalUser = true;
|
||||
|
|
|
|||
|
|
@ -2,29 +2,18 @@
|
|||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.radxa.rock-4c-plus;
|
||||
rkCfg = config.hardware.rockchip;
|
||||
in {
|
||||
}: {
|
||||
imports = [
|
||||
../.
|
||||
../../rockchip
|
||||
];
|
||||
|
||||
options.hardware.radxa.rock-4c-plus = {
|
||||
platformFirmware = lib.mkPackageOption pkgs "ubootRock4CPlus" { };
|
||||
};
|
||||
|
||||
config = {
|
||||
hardware = {
|
||||
radxa.enable = true;
|
||||
rockchip = {
|
||||
rk3399.enable = true;
|
||||
diskoExtraPostVM = ''
|
||||
dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64
|
||||
dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384
|
||||
'';
|
||||
platformFirmware = pkgs.ubootRock4CPlus;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,29 +2,18 @@
|
|||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.radxa.rock-5b;
|
||||
rkCfg = config.hardware.rockchip;
|
||||
in {
|
||||
}: {
|
||||
imports = [
|
||||
../.
|
||||
../../rockchip
|
||||
];
|
||||
|
||||
options.hardware.radxa.rock-5b = {
|
||||
platformFirmware = lib.mkPackageOption pkgs "ubootRock5ModelB" { };
|
||||
};
|
||||
|
||||
config = {
|
||||
hardware = {
|
||||
radxa.enable = true;
|
||||
rockchip = {
|
||||
rk3588.enable = true;
|
||||
diskoExtraPostVM = ''
|
||||
dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64
|
||||
dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384
|
||||
'';
|
||||
platformFirmware = pkgs.ubootRock5ModelB;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,29 +2,18 @@
|
|||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.hardware.radxa.rock-pi-4;
|
||||
rkCfg = config.hardware.rockchip;
|
||||
in {
|
||||
}: {
|
||||
imports = [
|
||||
../.
|
||||
../../rockchip
|
||||
];
|
||||
|
||||
options.hardware.radxa.rock-pi-4 = {
|
||||
platformFirmware = lib.mkPackageOption pkgs "ubootRockPi4" { };
|
||||
};
|
||||
|
||||
config = {
|
||||
hardware = {
|
||||
radxa.enable = true;
|
||||
rockchip = {
|
||||
rk3399.enable = true;
|
||||
diskoExtraPostVM = ''
|
||||
dd conv=notrunc,fsync if=${cfg.platformFirmware}/idbloader.img of=$out/${rkCfg.diskoImageName} bs=512 seek=64
|
||||
dd conv=notrunc,fsync if=${cfg.platformFirmware}/u-boot.itb of=$out/${rkCfg.diskoImageName} bs=512 seek=16384
|
||||
'';
|
||||
platformFirmware = pkgs.ubootRockPi4;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue