Dave Airlie
2025-Oct-07 01:32 UTC
[PATCH] nouveau: add option to avoid 535 firmware in initramfs
From: Dave Airlie <airlied at redhat.com> 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. Signed-off-by: Dave Airlie <airlied at redhat.com> --- 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(+) diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index c88776d1e784..fd56458189dd 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -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 diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c index 35d1fcef520b..452c1e4f4095 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c @@ -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); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c index d201e8697226..d8410f3c65da 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c @@ -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); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c index 917f7e2f6c46..55e58373ca6d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c @@ -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); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c index 81e56da0474a..691453ddf191 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c @@ -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); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c index 97eb046c25d0..fd142c17a9d0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c @@ -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); -- 2.51.0
Timur Tabi
2025-Oct-07 03:29 UTC
[PATCH] nouveau: add option to avoid 535 firmware in initramfs
On Tue, 2025-10-07 at 11:32 +1000, Dave Airlie wrote:> +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.