liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

hardware.nix (3707B)


      1 ## Hardware-dependent options
      2 ## ==========================
      3 ##
      4 ## These are attributes of the hardware not of the application
      5 ## you want to run on it, and would usually be set in the "device" file:
      6 ## :file:`devices/manuf-model/default.nix`
      7 
      8 { lib, ... }:
      9 let
     10   inherit (lib) mkOption types;
     11 in
     12 {
     13   options = {
     14     boot = { };
     15     hardware = {
     16       ubi = {
     17         minIOSize = mkOption { type = types.str; };
     18         logicalEraseBlockSize = mkOption { type = types.str; }; # LEB
     19         physicalEraseBlockSize = mkOption { type = types.str; }; # PEB
     20         maxLEBcount = mkOption { type = types.str; }; # LEB
     21       };
     22       dts = {
     23         src = mkOption {
     24           type = types.nullOr types.path;
     25           description = ''
     26             If the device requires an external device tree to be loaded
     27             alongside the kernel, this is the path to the device tree source
     28             (we usually get these from OpenWrt). This value may be null if the
     29             platform creates the device tree - currently this is the case
     30             only for QEMU.
     31           '';
     32         };
     33         includePaths = mkOption {
     34           default = [ ];
     35           description = "List of directories to search for DTS includes (.dtsi files)";
     36           type = types.listOf types.path;
     37         };
     38         includes = mkOption {
     39           default = [ ];
     40           description = "\"dtsi\" fragments to include in the generated device tree";
     41           type = types.listOf types.path;
     42         };
     43       };
     44       defaultOutput = mkOption {
     45         description = "\"Default\" output: what gets built for this device when outputs.default is requested. Typically this is \"mtdimage\" or \"vmroot\"";
     46         type = types.nonEmptyStr;
     47       };
     48       ram = {
     49         startAddress = mkOption {
     50           type = types.int;
     51         };
     52       };
     53 
     54       flash = {
     55         # start address and size of whichever partition (often
     56         # called "firmware") we're going to overwrite with our
     57         # kernel uimage and root fs. Not the entire flash, as
     58         # that often also contains the bootloader, data for
     59         # for wireless devices, etc
     60         address = mkOption {
     61           description = ''
     62             Start address of whichever partition (often
     63             called "firmware") we're going to overwrite with our
     64             kernel uimage and root fs. Usually not the entire flash, as
     65             we don't want to clobber the bootloader, calibration data etc
     66           '';
     67           type = types.ints.unsigned;
     68         };
     69         size = mkOption {
     70           type = types.ints.unsigned;
     71           description = "Size in bytes of the firmware partition";
     72         };
     73         eraseBlockSize = mkOption {
     74           description = "Flash erase block size in bytes";
     75           type = types.ints.unsigned;
     76         };
     77       };
     78       loadAddress = mkOption {
     79         type = types.ints.unsigned;
     80         default = null;
     81       };
     82       entryPoint = mkOption { type = types.ints.unsigned; };
     83       alignment = mkOption {
     84         type = types.nullOr types.ints.unsigned;
     85         default = null;
     86         description = "Alignment passed to `mkimage` for FIT";
     87       };
     88       radios = mkOption {
     89         description = ''
     90           Kernel modules (from mac80211 package) required for the
     91           wireless devices on this board
     92         '';
     93         type = types.listOf types.str;
     94         default = [ ];
     95         example = [
     96           "ath9k"
     97           "ath10k"
     98         ];
     99       };
    100       rootDevice = mkOption {
    101         description = "Full path to preferred root device";
    102         type = types.str;
    103         example = "/dev/mtdblock3";
    104       };
    105       networkInterfaces = mkOption {
    106         type = types.attrsOf types.anything;
    107       };
    108     };
    109   };
    110 }