Skip to content

Commit

Permalink
Add firmware needed for R816{8,9} network devices
Browse files Browse the repository at this point in the history
The orin-nano and orin-nx SOMs have realtek NICs that take advantage of
firmware that lives in the `linux-firmware` derivation. Instead of
pulling in all of linux-firmware (1GiB+), just pull in what is needed
for the `r8168` kernel module. Note that in Jetpack 35.3.1 the kernel
module was called `r8169` and in Jetpack 35.4.1 the kernel module was
changed to be `r8168`. This differs from mainline linux where the kernel
module is `r8169`.
  • Loading branch information
jmbaur committed Mar 27, 2024
1 parent 6f6fc3b commit aed38dd
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions modules/devices.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,39 @@ lib.mkMerge [{
else
"-F 32 -n ESP";
};
})
(lib.mkIf (lib.any (som: som == cfg.som) [ "orin-nx" "orin-nano" ]) {
hardware.firmware = [
(pkgs.linkFarm "r8169-firmware"
(map
(firmwarePath: {
name = "lib/firmware/${firmwarePath}";
path = "${pkgs.linux-firmware}/lib/firmware/${firmwarePath}";
}) [
# From https://github.com/OE4T/linux-tegra-5.10/blob/20443c6df8b9095e4676b4bf696987279fac30a9/drivers/net/ethernet/realtek/r8169_main.c#L38
# We include all the firmware referenced by the r8168 module so that
# `makeModulesClosure` doesn't spit out warnings.
"rtl_nic/rtl8168d-1.fw"
"rtl_nic/rtl8168d-2.fw"
"rtl_nic/rtl8168e-1.fw"
"rtl_nic/rtl8168e-2.fw"
"rtl_nic/rtl8168e-3.fw"
"rtl_nic/rtl8168f-1.fw"
"rtl_nic/rtl8168f-2.fw"
"rtl_nic/rtl8105e-1.fw"
"rtl_nic/rtl8402-1.fw"
"rtl_nic/rtl8411-1.fw"
"rtl_nic/rtl8411-2.fw"
"rtl_nic/rtl8106e-1.fw"
"rtl_nic/rtl8106e-2.fw"
"rtl_nic/rtl8168g-2.fw"
"rtl_nic/rtl8168g-3.fw"
"rtl_nic/rtl8168h-2.fw" # wanted by orin-nano and orin-nx
"rtl_nic/rtl8168fp-3.fw"
"rtl_nic/rtl8107e-2.fw"
"rtl_nic/rtl8125a-3.fw"
"rtl_nic/rtl8125b-2.fw"
"rtl_nic/rtl8126a-2.fw"
]))
];
})]

0 comments on commit aed38dd

Please sign in to comment.