nouveau: add option to avoid 535 firmware in initramfs
Subsystems (3)
Dave Airlie
maintainerPATCH 1/1 nouveau: add option to avoid 535 firmware in initramfs
From: Dave Airlie <[email protected]>
Ben gave me this idea before he finished up, and I just didn't think to write it out. This adds a config option that if enabled will stop the 535 firmware being requested, so that it won't end up in the initramfs.
This option should only be enabled if you are on a distro with a new enough linux-firmware with the 570 firmware contained in it.
--- drivers/gpu/drm/nouveau/Kconfig | 9 +++++++++ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c | 2 ++ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c | 2 ++ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c | 2 ++ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c | 2 ++ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c | 2 ++ 6 files changed, 19 insertions(+)
drivers/gpu/drm/nouveau/Kconfig +9 -0
@@ -39,6 +39,15 @@ config NOUVEAU_PLATFORM_DRIVER Support for Nouveau platform driver, used for SoC GPUs as found on NVIDIA Tegra K1. +config DRM_NOUVEAU_570_ONLY + bool "Only support 570 firmware, don't add 535 to the initrd." + depends on DRM_NOUVEAU + default n + help + Nouveau can support 535 and 570 firmwares, but that means both + will end up in initramfs, bloating it. If you can guarantee you + have the 570 in your distro or install, enable this option. + config NOUVEAU_DEBUG int "Maximum debug level" depends on DRM_NOUVEAU
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c +2 -0
@@ -53,11 +53,13 @@ ad102_gsp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,return nvkm_gsp_new_ (ad102_gsps, device, type, inst, pgsp); } +#ifndef CONFIG_DRM_NOUVEAU_570_ONLY NVKM_GSP_FIRMWARE_BOOTER(ad102, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ad103, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ad104, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ad106, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ad107, 535.113.01); +#endif NVKM_GSP_FIRMWARE_BOOTER (ad102,570.144 );NVKM_GSP_FIRMWARE_BOOTER (ad103,570.144 );
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c +2 -0
@@ -71,5 +71,7 @@ ga100_gsp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,return nvkm_gsp_new_ (ga100_gsps, device, type, inst, pgsp); } +#ifndef CONFIG_DRM_NOUVEAU_570_ONLY NVKM_GSP_FIRMWARE_BOOTER(ga100, 535.113.01); +#endif NVKM_GSP_FIRMWARE_BOOTER (ga100,570.144 );
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c +2 -0
@@ -187,11 +187,13 @@ ga102_gsp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,return nvkm_gsp_new_ (ga102_gsps, device, type, inst, pgsp); } +#ifndef CONFIG_DRM_NOUVEAU_570_ONLY NVKM_GSP_FIRMWARE_BOOTER(ga102, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ga103, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ga104, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ga106, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(ga107, 535.113.01); +#endif NVKM_GSP_FIRMWARE_BOOTER (ga102,570.144 );NVKM_GSP_FIRMWARE_BOOTER (ga103,570.144 );
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c +2 -0
@@ -436,9 +436,11 @@ tu102_gsp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,return nvkm_gsp_new_ (tu102_gsps, device, type, inst, pgsp); } +#ifndef CONFIG_DRM_NOUVEAU_570_ONLY NVKM_GSP_FIRMWARE_BOOTER(tu102, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(tu104, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(tu106, 535.113.01); +#endif NVKM_GSP_FIRMWARE_BOOTER (tu102,570.144 );NVKM_GSP_FIRMWARE_BOOTER (tu104,570.144 );
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c +2 -0
@@ -54,8 +54,10 @@ tu116_gsp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,return nvkm_gsp_new_ (tu116_gsps, device, type, inst, pgsp); } +#ifndef CONFIG_DRM_NOUVEAU_570_ONLY NVKM_GSP_FIRMWARE_BOOTER(tu116, 535.113.01); NVKM_GSP_FIRMWARE_BOOTER(tu117, 535.113.01); +#endif NVKM_GSP_FIRMWARE_BOOTER (tu116,570.144 );NVKM_GSP_FIRMWARE_BOOTER (tu117,570.144 );
Signature · 1 line
2.51.0
drivers/gpu/drm/nouveau/Kconfig config NOUVEAU_PLATFORM_DRIVER · line 50
Quoted 9 lines · Dave Airlie
drivers/gpu/drm/nouveau/Kconfig +9
-0+config DRM_NOUVEAU_570_ONLY + bool "Only support 570 firmware, don't add 535 to the initrd." + depends on DRM_NOUVEAU + default n + help + Nouveau can support 535 and 570 firmwares, but that means both + will end up in initramfs, bloating it. If you can guarantee you + have the 570 in your distro or install, enable this option. +
I don't like the idea of using the specific version number in the Kconfig.
Can we rename this to "DRM_NOUVEAU_LATEST_FW_ONLY" or something like that, and Nouveau automatically only supports whatever the latest version is? I know we probably won't add support for anything after 570, but we might.
Dave Airlie
maintainerQuoted 14 lines · Timur Tabi
drivers/gpu/drm/nouveau/Kconfig config NOUVEAU_PLATFORM_DRIVER · line 50
Quoted 9 lines · Dave Airlie
drivers/gpu/drm/nouveau/Kconfig +9
-0+config DRM_NOUVEAU_570_ONLY + bool "Only support 570 firmware, don't add 535 to the initrd." + depends on DRM_NOUVEAU + default n + help + Nouveau can support 535 and 570 firmwares, but that means both + will end up in initramfs, bloating it. If you can guarantee you + have the 570 in your distro or install, enable this option. +I don't like the idea of using the specific version number in the
Kconfig.
Quoted 3 lines
Can we rename this to "
DRM_NOUVEAU_LATEST_FW_ONLY" or something like that, and Nouveau automatically only supports whatever the latest version is? I know we probably won't add support for anything after 570, but we might.
We can't do that, because if we moved to 580, and distros have this option on for 570, they would fail unless they had the 580 firmware, so it needs to be versioned.
Dave.
Quoted 3 lines · Dave Airlie
We can't do that, because if we moved to 580, and distros have this option on for 570, they would fail unless they had the 580 firmware, so it needs to be versioned.
Hmmm then how about making it a choice of which version to support:
choice
prompt "Firmware version supported"
default DRM_NOUVEAU_ANY
config DRM_NOUVEAU_535_ONLY
...
config DRM_NOUVEAU_535_ONLY
...
endchoice
Or something like that. I can't figure out how choices work, but the idea is that the defconfig defaults to allowing all versions, but you can pick a specific one.
Hi all,
Quoted 10 lines · Dave Airlie
Quoted 3 lines
We can't do that, because if we moved to 580, and distros have this option on for 570, they would fail unless they had the 580 firmware, so it needs to be versioned.
Hmmm then how about making it a choice of which version to support:
choice
prompt "Firmware version supported"
defaultDRM_NOUVEAU_ANY
You probably know it, in case you don't: DRM_NOUVEAU_ANY needs to be also as config:
config DRM_NOUVEAU_ANY
bool "Support all firmware versions" ...
Quoted 7 lines
config
DRM_NOUVEAU_535_ONLY
...config
DRM_NOUVEAU_535_ONLY
...endchoice
+1
Quoted 1 line
Or something like that. I can't figure out how choices work, but the idea is that the defconfig
Kind regards,
Petr
Quoted 1 line
defaults to allowing all versions, but you can pick a specific one.
Dave Airlie
maintainerQuoted 27 lines · Petr Vorel
Hi all,
Quoted 10 lines · Dave Airlie
Quoted 3 lines
We can't do that, because if we moved to 580, and distros have this option on for 570, they would fail unless they had the 580 firmware, so it needs to be versioned.
Hmmm then how about making it a choice of which version to support:
choice
prompt "Firmware version supported"
defaultDRM_NOUVEAU_ANYYou probably know it, in case you don't:
DRM_NOUVEAU_ANYneeds to be also as config:config
DRM_NOUVEAU_ANY
bool "Support all firmware versions"
...Quoted 5 lines
config
DRM_NOUVEAU_535_ONLY
...config
DRM_NOUVEAU_535_ONLY
...
Quoted 10 lines
Quoted 1 line
endchoice
+1
Quoted 1 line
Or something like that. I can't figure out how choices work, but the idea is that the defconfig
Kind regards,
PetrQuoted 1 line
defaults to allowing all versions, but you can pick a specific one.
I think that is getting a bit complicated for distros though. There is no reason to ever want 535 only. We don't want to give people options we don't actually support.
The options we have in the current driver, is you get 535 + 570, and we give you the option to say I only need 570. If we add 580, we add another option and fix it then, but I don't see the point in overdesigning this for now.
Dave.
Quoted 1 line
Quoted 3 lines · Dave Airlie
I think that is getting a bit complicated for distros though. There is no reason to ever want 535 only. We don't want to give people options we don't actually support.
My Ubuntu 25.04 system ships with kernel 6.14 but only the r535 firmware. So there systems out there with recent kernels that would select 535-only.
Quoted 4 lines
The options we have in the current driver, is you get 535 + 570, and we give you the option to say I only need 570. If we add 580, we add another option and fix it then, but I don't see the point in overdesigning this for now.
Well, like you said, if we move to 580, then now we need to decide between 570 and 580. So let's set up a Kconfig system that handles multiple versions in a future-proof way.
Dave Airlie
maintainerQuoted 8 lines · Timur Tabi
Quoted 3 lines · Dave Airlie
I think that is getting a bit complicated for distros though. There is no reason to ever want 535 only. We don't want to give people options we don't actually support.
My Ubuntu 25.04 system ships with kernel 6.14 but only the r535 firmware. So there systems out there with recent kernels that would select 535-only.
But there is no need to select 535 only, if you only have 535 firmware you can't get the initramfs having 535 + 570 firmware.
The problem is when the distro has 535 + 570, you want to let them say that and drop 535. Nobody needs 535 only as an option, so it confuses people to provide it.
Quoted 8 lines
Quoted 5 lines
The options we have in the current driver, is you get 535 + 570, and we give you the option to say I only need 570. If we add 580, we add another option and fix it then, but I don't see the point in overdesigning this for now.
Well, like you said, if we move to 580, then now we need to decide between 570 and 580. So let's set up a
Kconfigsystem that handles multiple versions in a future-proof way.
We just add the exact same option when we merge 580 support, I'm not sure what future proofing we would need, the option isn't that much work.
Dave.