Skip to content

Commit e7c8fc7

Browse files
jmbaurdanielfullmer
authored andcommitted
Add firmware needed for R816{8,9} network devices
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`.
1 parent 6f6fc3b commit e7c8fc7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

modules/devices.nix

+35
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,39 @@ lib.mkMerge [{
147147
else
148148
"-F 32 -n ESP";
149149
};
150+
})
151+
(lib.mkIf (lib.any (som: som == cfg.som) [ "orin-nx" "orin-nano" ]) {
152+
hardware.firmware = [
153+
(pkgs.linkFarm "r8169-firmware"
154+
(map
155+
(firmwarePath: {
156+
name = "lib/firmware/${firmwarePath}";
157+
path = "${pkgs.linux-firmware}/lib/firmware/${firmwarePath}";
158+
}) [
159+
# From https://github.com/OE4T/linux-tegra-5.10/blob/20443c6df8b9095e4676b4bf696987279fac30a9/drivers/net/ethernet/realtek/r8169_main.c#L38
160+
# We include all the firmware referenced by the r8168 module so that
161+
# `makeModulesClosure` doesn't spit out warnings.
162+
"rtl_nic/rtl8168d-1.fw"
163+
"rtl_nic/rtl8168d-2.fw"
164+
"rtl_nic/rtl8168e-1.fw"
165+
"rtl_nic/rtl8168e-2.fw"
166+
"rtl_nic/rtl8168e-3.fw"
167+
"rtl_nic/rtl8168f-1.fw"
168+
"rtl_nic/rtl8168f-2.fw"
169+
"rtl_nic/rtl8105e-1.fw"
170+
"rtl_nic/rtl8402-1.fw"
171+
"rtl_nic/rtl8411-1.fw"
172+
"rtl_nic/rtl8411-2.fw"
173+
"rtl_nic/rtl8106e-1.fw"
174+
"rtl_nic/rtl8106e-2.fw"
175+
"rtl_nic/rtl8168g-2.fw"
176+
"rtl_nic/rtl8168g-3.fw"
177+
"rtl_nic/rtl8168h-2.fw" # wanted by orin-nano and orin-nx
178+
"rtl_nic/rtl8168fp-3.fw"
179+
"rtl_nic/rtl8107e-2.fw"
180+
"rtl_nic/rtl8125a-3.fw"
181+
"rtl_nic/rtl8125b-2.fw"
182+
"rtl_nic/rtl8126a-2.fw"
183+
]))
184+
];
150185
})]

0 commit comments

Comments
 (0)