about summary refs log tree commit diff
path: root/nixos/modules/hardware/device-tree.nix
AgeCommit message (Collapse)AuthorFilesLines
2022-08-31nixos/*: convert internal option descriptions to MDpennae1-1/+1
we'll have to do it eventually, may as well be now.
2022-08-24Merge pull request #187528 from rnhmjoj/pr-fix-dt-overlaysK9001-0/+10
nixos/hardware/device-tree: make overlays more reliable
2022-08-20nixos/hardware/device-tree: make overlays more reliablernhmjoj1-0/+10
This make the process of applying overlays more reliable by: 1. Ignoring dtb files that are not really device trees. [^1] 2. Adding a `filter` option (per-overlay, there already is a global one) to limit the files to which the overlay applies. This is useful in cases where the `compatible` string is ambiguous and multiple unrelated files match. Previously the script would fail in both cases. [^1]: For example, there is dtbs/overlays/overlay_map.dtb in the Raspberry Pi 1 kernel.
2022-08-19nixos/hardware/device-tree: use symbols from the exact kernel packageK9001-19/+4
2022-07-30treewide: automatically md-convert option descriptionspennae1-9/+9
the conversion procedure is simple: - find all things that look like options, ie calls to either `mkOption` or `lib.mkOption` that take an attrset. remember the attrset as the option - for all options, find a `description` attribute who's value is not a call to `mdDoc` or `lib.mdDoc` - textually convert the entire value of the attribute to MD with a few simple regexes (the set from mdize-module.sh) - if the change produced a change in the manual output, discard - if the change kept the manual unchanged, add some text to the description to make sure we've actually found an option. if the manual changes this time, keep the converted description this procedure converts 80% of nixos options to markdown. around 2000 options remain to be inspected, but most of those fail the "does not change the manual output check": currently the MD conversion process does not faithfully convert docbook tags like <code> and <package>, so any option using such tags will not be converted at all.
2022-06-18nixos/device-tree: preprocess overlays before compilingBen Wolsieffer1-2/+3
Run the device tree overlays through the preprocessor before compiling it, as is done in the kernel. This helps make overlays easier to understand, and improves compatibility with those found in the wild. I found the correct command line by running the kernel build with V=1, and then removing all the arguments related to dependency tracking.
2022-06-18nixos/device-tree: use new overlay syntax in exampleBen Wolsieffer1-8/+5
Since dtc 1.4.7 (released in 2018), there has been a much nicer syntax for device tree overlays. This commit converts the dtsText example to use this syntax.
2021-10-04nixos/doc: clean up defaults and examplesNaïm Favier1-5/+5
2021-01-23lib: Clean up how linux and gcc config is specifiedJohn Ericson1-4/+4
Second attempt of 8929989614589ee3acd070a6409b2b9700c92d65; see that commit for details. This reverts commit 0bc275e63423456d6deb650e146120c39c1e0723.
2021-01-22Revert "lib: Clean up how linux and gcc config is specified"Jonathan Ringer1-4/+4
This is a stdenv-rebuild, and should not be merged into master This reverts commit 8929989614589ee3acd070a6409b2b9700c92d65.
2021-01-21lib: Clean up how linux and gcc config is specifiedJohn Ericson1-4/+4
The `platform` field is pointless nesting: it's just stuff that happens to be defined together, and that should be an implementation detail. This instead makes `linux-kernel` and `gcc` top level fields in platform configs. They join `rustc` there [all are optional], which was put there and not in `platform` in anticipation of a change like this. `linux-kernel.arch` in particular also becomes `linuxArch`, to match the other `*Arch`es. The next step after is this to combine the *specific* machines from `lib.systems.platforms` with `lib.systems.examples`, keeping just the "multiplatform" ones for defaulting.
2020-09-09nixos/device-tree: improve overlays supportRichard Marko1-13/+151
Now allows applying external overlays either in form of .dts file, literal dts context added to store or precompiled .dtbo. If overlays are defined, kernel device-trees are compiled with '-@' so the .dtb files contain symbols which we can reference in our overlays. Since `fdtoverlay` doesn't respect `/ compatible` by itself we query compatible strings of both `dtb` and `dtbo(verlay)` and apply only if latter is substring of the former. Also adds support for filtering .dtb files (as there are now nearly 1k dtbs). Co-authored-by: georgewhewell <georgerw@gmail.com> Co-authored-by: Kai Wohlfahrt <kai.wohlfahrt@gmail.com>
2020-06-21hardware.deviceTree: add nameFlorian Klink1-0/+11
This can be used to explicitly specify a specific dtb file, relative to the dtb base. Update the generic-extlinux-compatible module to make use of this option.
2020-06-21nixos/deviceTree: fix descriptionFlorian Klink1-1/+1
hardware.deviceTree.base points to a path, not a package (and also if of types.path) It defaults to ${config.boot.kernelPackages.kernel}/dtbs.
2020-05-10nixos/device-tree: fix package name in examplesGaelan1-2/+2
deviceTree_rpi got renamed to device-tree_rpi a while back, so this updates the examples to reflect that.
2019-08-07nixos/hardware.deviceTree: Move things aroundKai Wohlfahrt1-5/+5
In response to comments, create a sub-folder for deviceTree packages (starting with rpi), and a top-level package for helpers.
2019-08-07nixos/hardware.deviceTree: new moduleKai Wohlfahrt1-0/+56
Add support for custom device-tree files, and applying overlays to them. This is useful for supporting non-discoverable hardware, such as sensors attached to GPIO pins on a Raspberry Pi.