All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nouveau: add option to avoid 535 firmware in initramfs
@ 2025-10-07  1:32 Dave Airlie
  2025-10-07  3:29 ` Timur Tabi
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Airlie @ 2025-10-07  1:32 UTC (permalink / raw)
  To: dri-devel; +Cc: nouveau, dakr

From: Dave Airlie <airlied@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@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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-12-13 12:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07  1:32 [PATCH] nouveau: add option to avoid 535 firmware in initramfs Dave Airlie
2025-10-07  3:29 ` Timur Tabi
2025-10-07  3:31   ` Dave Airlie
2025-10-07  3:41     ` Timur Tabi
2025-10-07 15:20       ` Petr Vorel
2025-10-08  1:48         ` Dave Airlie
2025-10-08  3:18           ` Timur Tabi
2025-10-08  3:43             ` Dave Airlie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.