mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-04 23:13:29 +01:00
raspberry-pi: explain config.txt default overrides
This commit is contained in:
1 parent
428be44435
commit
5c1804b403
1 file changed
+8
-22
+8
-22
@@ -155,6 +155,8 @@ Use `null` with `mkForce` to remove a parameter.
|
|||||||
The module concatenates lists from separate modules, but the order is not the order of definition.
|
The module concatenates lists from separate modules, but the order is not the order of definition.
|
||||||
If one overlay must load before another, set the order with `mkBefore` or `mkAfter`.
|
If one overlay must load before another, set the order with `mkBefore` or `mkAfter`.
|
||||||
|
|
||||||
|
For overlay names and hardware-specific parameters, use the [Raspberry Pi overlay reference](https://github.com/raspberrypi/linux/blob/rpi-6.18.y/arch/arm/boot/dts/overlays/README).
|
||||||
|
|
||||||
The Raspberry Pi firmware applies these overlays before U-Boot starts.
|
The Raspberry Pi firmware applies these overlays before U-Boot starts.
|
||||||
Set `boot.loader.generic-extlinux-compatible.useGenerationDeviceTree = false` so U-Boot keeps that device tree instead of loading one from the NixOS generation.
|
Set `boot.loader.generic-extlinux-compatible.useGenerationDeviceTree = false` so U-Boot keeps that device tree instead of loading one from the NixOS generation.
|
||||||
Enabling `hardware.raspberry-pi.firmware.uboot.enable` sets this automatically.
|
Enabling `hardware.raspberry-pi.firmware.uboot.enable` sets this automatically.
|
||||||
@@ -163,23 +165,14 @@ The firmware partition must contain the generated `config.txt` and stock overlay
|
|||||||
SD image builds populate it automatically.
|
SD image builds populate it automatically.
|
||||||
On a running system, set `hardware.raspberry-pi.firmware.enable = true`.
|
On a running system, set `hardware.raspberry-pi.firmware.enable = true`.
|
||||||
|
|
||||||
#### DWC2 USB controller
|
To supply your own file, set `configtxt.file`.
|
||||||
|
The module then ignores `settings` and `deviceTreeOverlays`.
|
||||||
|
|
||||||
Use the stock `dwc2` overlay to enable the USB 2.0 controller on the Pi 4B USB-C connector:
|
#### Overriding board defaults
|
||||||
|
|
||||||
```nix
|
The shared board defaults are defined in [`common/config-txt-defaults.nix`](./common/config-txt-defaults.nix) with `lib.mkDefault`.
|
||||||
{
|
Set a `hardware.raspberry-pi.configtxt.settings` value to `null` to omit that default from the generated `config.txt`.
|
||||||
hardware.raspberry-pi.configtxt.deviceTreeOverlays."board-type=0x11" = [
|
For example, to remove the default `otg_mode` setting before loading `dwc2` on CM4, use:
|
||||||
{ dwc2 = { }; }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
`board-type=0x11` matches the Pi 4B.
|
|
||||||
The broader `pi4` filter also matches Pi 400, CM4, and CM4S.
|
|
||||||
|
|
||||||
[Raspberry Pi OS sets `otg_mode=1` on CM4](https://github.com/RPi-Distro/pi-gen/blob/master/stage1/00-boot-files/files/config.txt#L39-L43), and [nixos-hardware sets the same default](./common/config-txt-defaults.nix).
|
|
||||||
Set it to `null` before loading DWC2:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -192,13 +185,6 @@ Set it to `null` before loading DWC2:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `cm4` filter matches CM4 only.
|
|
||||||
Set `dwc2.dr_mode` to `host`, `peripheral`, or `otg` to override the overlay default.
|
|
||||||
The overlay also accepts `g-rx-fifo-size` and `g-np-tx-fifo-size`.
|
|
||||||
|
|
||||||
To supply your own file, set `configtxt.file`.
|
|
||||||
The module then ignores `settings` and `deviceTreeOverlays`.
|
|
||||||
|
|
||||||
## Audio
|
## Audio
|
||||||
|
|
||||||
To enable the headphone jack on Raspberry Pi 2, 3, or 4:
|
To enable the headphone jack on Raspberry Pi 2, 3, or 4:
|
||||||
|
|||||||
Reference in new issue
Block a user