mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-01 00:29:40 +01:00
Implement dt overlay for enabling built-in xhci controller
This commit is contained in:
parent
ca41b8a227
commit
f8d3c75462
1 changed files with 40 additions and 0 deletions
40
raspberry-pi/4/xhci.nix
Normal file
40
raspberry-pi/4/xhci.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hardware.raspberry-pi."4".xhci;
|
||||
in {
|
||||
options.hardware = {
|
||||
raspberry-pi."4".xhci = {
|
||||
enable = lib.mkEnableOption ''
|
||||
Enable builtin XHCI controller for USB with otg_mode=1 in config.txt
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.deviceTree = {
|
||||
overlays = [
|
||||
{
|
||||
name = "enable-xhci";
|
||||
dtsText = ''
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2711";
|
||||
fragment@0 {
|
||||
//target-path = "/scb/xhci@7e9c0000";
|
||||
target = <&xhci>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue