2023-08-09 23:27:37 +02:00
|
|
|
## Hardware-dependent options
|
|
|
|
## ==========================
|
|
|
|
##
|
|
|
|
## These are attributes of the hardware not of the application
|
|
|
|
## you want to run on it, and would usually be set in the "device" file:
|
|
|
|
## :file:`devices/manuf-model/default.nix`
|
|
|
|
|
|
|
|
|
2023-03-03 21:04:39 +01:00
|
|
|
{ lib, pkgs, config, ...}:
|
|
|
|
let
|
|
|
|
inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
boot = {
|
2023-03-03 23:43:44 +01:00
|
|
|
};
|
2023-03-03 23:52:33 +01:00
|
|
|
hardware = {
|
2023-03-03 21:04:39 +01:00
|
|
|
dts = {
|
2023-08-07 22:43:12 +02:00
|
|
|
src = mkOption {
|
|
|
|
type = types.path;
|
|
|
|
description = "Path to the device tree source (usually from OpenWrt)";
|
|
|
|
};
|
2023-03-03 21:04:39 +01:00
|
|
|
includes = mkOption {
|
|
|
|
default = [];
|
2023-08-07 22:43:12 +02:00
|
|
|
description = "List of directories to search for DTS includes (.dtsi files)";
|
2023-03-03 21:04:39 +01:00
|
|
|
type = types.listOf types.path;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
defaultOutput = mkOption {
|
2023-08-07 22:43:12 +02:00
|
|
|
description = "\"Default\" output: what gets built for this device when outputs.default is requested. Typically this is \"flashimage\" or \"vmroot\"";
|
2023-03-03 21:04:39 +01:00
|
|
|
type = types.nonEmptyStr;
|
|
|
|
};
|
2023-11-05 16:11:58 +01:00
|
|
|
ram = {
|
|
|
|
startAddress = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-03-03 21:04:39 +01:00
|
|
|
flash = {
|
2023-03-07 23:03:31 +01:00
|
|
|
# start address and size of whichever partition (often
|
|
|
|
# called "firmware") we're going to overwrite with our
|
|
|
|
# kernel uimage and root fs. Not the entire flash, as
|
|
|
|
# that often also contains the bootloader, data for
|
|
|
|
# for wireless devices, etc
|
2023-08-07 22:43:12 +02:00
|
|
|
address = mkOption {
|
|
|
|
description = ''
|
|
|
|
Start address of whichever partition (often
|
|
|
|
called "firmware") we're going to overwrite with our
|
|
|
|
kernel uimage and root fs. Usually not the entire flash, as
|
|
|
|
we don't want to clobber the bootloader, calibration data etc
|
|
|
|
'';
|
2023-11-12 21:39:06 +01:00
|
|
|
type = types.ints.unsigned;
|
2023-08-07 22:43:12 +02:00
|
|
|
};
|
|
|
|
size = mkOption {
|
2023-11-12 21:39:06 +01:00
|
|
|
type = types.ints.unsigned;
|
2023-08-07 22:43:12 +02:00
|
|
|
description = "Size in bytes of the firmware partition";
|
|
|
|
};
|
|
|
|
eraseBlockSize = mkOption {
|
|
|
|
description = "Flash erase block size in bytes";
|
2023-11-12 21:39:06 +01:00
|
|
|
type = types.ints.unsigned;
|
2023-08-07 22:43:12 +02:00
|
|
|
};
|
2023-03-03 21:04:39 +01:00
|
|
|
};
|
2023-11-12 19:47:31 +01:00
|
|
|
loadAddress = mkOption { type = types.ints.unsigned; default = null; };
|
2023-11-12 19:50:47 +01:00
|
|
|
entryPoint = mkOption { type = types.ints.unsigned; };
|
2023-03-03 21:04:39 +01:00
|
|
|
radios = mkOption {
|
2023-08-07 22:43:12 +02:00
|
|
|
description = ''
|
|
|
|
Kernel modules (from mac80211 package) required for the
|
|
|
|
wireless devices on this board
|
|
|
|
'';
|
2023-03-03 21:04:39 +01:00
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [];
|
|
|
|
example = ["ath9k" "ath10k"];
|
|
|
|
};
|
|
|
|
rootDevice = mkOption { };
|
|
|
|
networkInterfaces = mkOption {
|
|
|
|
type = types.attrsOf types.anything;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|