mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 09:17:14 +08:00 
			
		
		
		
	rockchip: support generic firmware installation
This commit is contained in:
		
				
					committed by
					
						
						mergify[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							ab84bd93a3
						
					
				
				
					commit
					0b2e2fe9b3
				
			@@ -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;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user