]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/nouveau: add support for GB20x
authorBen Skeggs <bskeggs@nvidia.com>
Mon, 3 Feb 2025 22:54:57 +0000 (08:54 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 18 May 2025 21:14:45 +0000 (07:14 +1000)
This commit adds support for the GB20x GPUs found on GeForce RTX 50xx
series boards.

Beyond a few miscellaneous register moves and HW class ID plumbing,
this reuses most of the code added to support GH100/GB10x.

Signed-off-by: Ben Skeggs <bskeggs@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Timur Tabi <ttabi@nvidia.com>
Tested-by: Timur Tabi <ttabi@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
32 files changed:
drivers/gpu/drm/nouveau/include/nvhw/ref/gb10b/dev_fbhub.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/include/nvhw/ref/gb202/dev_ce.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/include/nvhw/ref/gb202/dev_therm.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/include/nvif/class.h
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/fsp.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_chan.c
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nvif/user.c
drivers/gpu/drm/nouveau/nvkm/engine/ce/Kbuild
drivers/gpu/drm/nouveau/nvkm/engine/ce/gb202.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/engine/ce/priv.h
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/Kbuild
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gb202.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h
drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gb202.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/fsp/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/fsp/gb202.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gb20x.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gpu.h
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fifo.c
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/rm.c
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h

diff --git a/drivers/gpu/drm/nouveau/include/nvhw/ref/gb10b/dev_fbhub.h b/drivers/gpu/drm/nouveau/include/nvhw/ref/gb10b/dev_fbhub.h
new file mode 100644 (file)
index 0000000..4d0bb8e
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#ifndef __gb10b_dev_fb_h__
+#define __gb10b_dev_fb_h__
+
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO                                0x008a1d58 /* RW-4R */
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO_ADR                                  31:0 /* RWIVF */
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO_ADR_INIT                       0x00000000 /* RWI-V */
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO_ADR_MASK                       0xffffff00 /* RW--V */
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI                                0x008a1d5c /* RW-4R */
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI_ADR                                  31:0 /* RWIVF */
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI_ADR_INIT                       0x00000000 /* RWI-V */
+#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI_ADR_MASK                       0x000fffff /* RW--V */
+
+#endif // __gb10b_dev_fb_h__
+
diff --git a/drivers/gpu/drm/nouveau/include/nvhw/ref/gb202/dev_ce.h b/drivers/gpu/drm/nouveau/include/nvhw/ref/gb202/dev_ce.h
new file mode 100644 (file)
index 0000000..b09f04b
--- /dev/null
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#ifndef __gb202_dev_ce_h__
+#define __gb202_dev_ce_h__
+
+#define NV_CE_GRCE_MASK                                                       0x001040d8 /* C--4R */
+#define NV_CE_GRCE_MASK_VALUE                                                        9:0 /* C--VF */
+#define NV_CE_GRCE_MASK_VALUE_INIT                                                 0x00f /* C---V */
+
+#endif // __gb202_dev_ce_h__
diff --git a/drivers/gpu/drm/nouveau/include/nvhw/ref/gb202/dev_therm.h b/drivers/gpu/drm/nouveau/include/nvhw/ref/gb202/dev_therm.h
new file mode 100644 (file)
index 0000000..ed359cb
--- /dev/null
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#ifndef __gb202_dev_therm_h__
+#define __gb202_dev_therm_h__
+
+#define NV_THERM_I2CS_SCRATCH                                                  0x00ad00bc /* RW-4R */
+#define NV_THERM_I2CS_SCRATCH_DATA                                                   31:0 /* RWIVF */
+#define NV_THERM_I2CS_SCRATCH_DATA_INIT                                        0x00000000 /* RWI-V */
+#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE                                   NV_THERM_I2CS_SCRATCH
+#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE_STATUS                                             31:0
+#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE_STATUS_SUCCESS                               0x000000FF
+#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE_STATUS_FAILED                                0x00000000
+
+#endif // __gb202_dev_therm_h__
+
index 606483fc850bb162c888cd18438d54cb6617196c..ff6823cb2cd8bf9a7988fd5abb4ac59751db52f2 100644 (file)
@@ -65,6 +65,7 @@
 #define TURING_USERMODE_A                                            0x0000c461
 #define AMPERE_USERMODE_A                                            0x0000c561
 #define HOPPER_USERMODE_A                                            0x0000c661
+#define BLACKWELL_USERMODE_A                                         0x0000c761
 
 #define MAXWELL_FAULT_BUFFER_A                        /* clb069.h */ 0x0000b069
 #define VOLTA_FAULT_BUFFER_A                          /* clb069.h */ 0x0000c369
@@ -89,6 +90,7 @@
 #define AMPERE_CHANNEL_GPFIFO_B                       /* if0020.h */ 0x0000c76f
 #define HOPPER_CHANNEL_GPFIFO_A                                      0x0000c86f
 #define BLACKWELL_CHANNEL_GPFIFO_A                                   0x0000c96f
+#define BLACKWELL_CHANNEL_GPFIFO_B                                   0x0000ca6f
 
 #define NV50_DISP                                     /* if0010.h */ 0x00005070
 #define G82_DISP                                      /* if0010.h */ 0x00008270
 #define TU102_DISP                                    /* if0010.h */ 0x0000c570
 #define GA102_DISP                                    /* if0010.h */ 0x0000c670
 #define AD102_DISP                                    /* if0010.h */ 0x0000c770
+#define GB202_DISP                                                   0x0000ca70
 
 #define GV100_DISP_CAPS                                              0x0000c373
+#define GB202_DISP_CAPS                                              0x0000ca73
 
 #define NV31_MPEG                                                    0x00003174
 #define G82_MPEG                                                     0x00008274
 #define GV100_DISP_CURSOR                             /* if0014.h */ 0x0000c37a
 #define TU102_DISP_CURSOR                             /* if0014.h */ 0x0000c57a
 #define GA102_DISP_CURSOR                             /* if0014.h */ 0x0000c67a
+#define GB202_DISP_CURSOR                                            0x0000ca7a
 
 #define NV50_DISP_OVERLAY                             /* if0014.h */ 0x0000507b
 #define G82_DISP_OVERLAY                              /* if0014.h */ 0x0000827b
 #define GV100_DISP_WINDOW_IMM_CHANNEL_DMA             /* if0014.h */ 0x0000c37b
 #define TU102_DISP_WINDOW_IMM_CHANNEL_DMA             /* if0014.h */ 0x0000c57b
 #define GA102_DISP_WINDOW_IMM_CHANNEL_DMA             /* if0014.h */ 0x0000c67b
+#define GB202_DISP_WINDOW_IMM_CHANNEL_DMA                            0x0000ca7b
 
 #define NV50_DISP_BASE_CHANNEL_DMA                    /* if0014.h */ 0x0000507c
 #define G82_DISP_BASE_CHANNEL_DMA                     /* if0014.h */ 0x0000827c
 #define TU102_DISP_CORE_CHANNEL_DMA                   /* if0014.h */ 0x0000c57d
 #define GA102_DISP_CORE_CHANNEL_DMA                   /* if0014.h */ 0x0000c67d
 #define AD102_DISP_CORE_CHANNEL_DMA                   /* if0014.h */ 0x0000c77d
+#define GB202_DISP_CORE_CHANNEL_DMA                                  0x0000ca7d
 
 #define NV50_DISP_OVERLAY_CHANNEL_DMA                 /* if0014.h */ 0x0000507e
 #define G82_DISP_OVERLAY_CHANNEL_DMA                  /* if0014.h */ 0x0000827e
 #define GV100_DISP_WINDOW_CHANNEL_DMA                 /* if0014.h */ 0x0000c37e
 #define TU102_DISP_WINDOW_CHANNEL_DMA                 /* if0014.h */ 0x0000c57e
 #define GA102_DISP_WINDOW_CHANNEL_DMA                 /* if0014.h */ 0x0000c67e
+#define GB202_DISP_WINDOW_CHANNEL_DMA                                0x0000ca7e
 
 #define NV50_TESLA                                                   0x00005097
 #define G82_TESLA                                                    0x00008297
 #define HOPPER_A                                                     0x0000cb97
 
 #define BLACKWELL_A                                                  0x0000cd97
+#define BLACKWELL_B                                                  0x0000ce97
 
 #define NV74_BSP                                                     0x000074b0
 
 #define NVC7B0_VIDEO_DECODER                                         0x0000c7b0
 #define NVC9B0_VIDEO_DECODER                                         0x0000c9b0
 #define NVCDB0_VIDEO_DECODER                                         0x0000cdb0
+#define NVCFB0_VIDEO_DECODER                                         0x0000cfb0
 
 #define GT212_MSVLD                                                  0x000085b1
 #define IGT21A_MSVLD                                                 0x000086b1
 #define AMPERE_DMA_COPY_B                                            0x0000c7b5
 #define HOPPER_DMA_COPY_A                                            0x0000c8b5
 #define BLACKWELL_DMA_COPY_A                                         0x0000c9b5
+#define BLACKWELL_DMA_COPY_B                                         0x0000cab5
 
 #define NVC4B7_VIDEO_ENCODER                                         0x0000c4b7
 #define NVC7B7_VIDEO_ENCODER                                         0x0000c7b7
 #define NVC9B7_VIDEO_ENCODER                                         0x0000c9b7
+#define NVCFB7_VIDEO_ENCODER                                         0x0000cfb7
 
 #define FERMI_DECOMPRESS                                             0x000090b8
 
 #define ADA_COMPUTE_A                                                0x0000c9c0
 #define HOPPER_COMPUTE_A                                             0x0000cbc0
 #define BLACKWELL_COMPUTE_A                                          0x0000cdc0
+#define BLACKWELL_COMPUTE_B                                          0x0000cec0
 
 #define NV74_CIPHER                                                  0x000074c1
 
 #define NVC4D1_VIDEO_NVJPG                                           0x0000c4d1
 #define NVC9D1_VIDEO_NVJPG                                           0x0000c9d1
 #define NVCDD1_VIDEO_NVJPG                                           0x0000cdd1
+#define NVCFD1_VIDEO_NVJPG                                           0x0000cfd1
 
 #define NVB8FA_VIDEO_OFA                                             0x0000b8fa
 #define NVC6FA_VIDEO_OFA                                             0x0000c6fa
 #define NVC7FA_VIDEO_OFA                                             0x0000c7fa
 #define NVC9FA_VIDEO_OFA                                             0x0000c9fa
 #define NVCDFA_VIDEO_OFA                                             0x0000cdfa
+#define NVCFFA_VIDEO_OFA                                             0x0000cffa
 #endif
index 0664195e56849ffa53e4876835e70dd8b8dd406a..99579e7b937605c7d5273740edff79c12e7a9367 100644 (file)
@@ -49,6 +49,7 @@ struct nvkm_device {
                GH100    = 0x180,
                AD100    = 0x190,
                GB10x    = 0x1a0,
+               GB20x    = 0x1b0,
        } card_type;
        u32 chipset;
        u8  chiprev;
index 7bd73f9f749be8d4db1ff94e7423a2eb621f462b..e0d777a933e1c7c88bab073485a277fe0013ffae 100644 (file)
@@ -104,6 +104,7 @@ int ga100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct n
 int ga102_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
 int gh100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
 int gb100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
+int gb202_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
 
 #include <subdev/bios.h>
 #include <subdev/bios/ramcfg.h>
index 7122f814e4d06d802486505f50436912a5518321..8a3dbb1cbb46e2923126ef18f4d1f5c023dbe3c9 100644 (file)
@@ -20,4 +20,5 @@ int nvkm_fsp_boot_gsp_fmc(struct nvkm_fsp *, u64 args_addr, u32 rsvd_size, bool
 
 int gh100_fsp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fsp **);
 int gb100_fsp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fsp **);
+int gb202_fsp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fsp **);
 #endif
index c5982fd74725ae2efd285bbbbe69d367a0483083..226c7ec56b8ed9aab2c5d8ec80090b7d36218789 100644 (file)
@@ -493,4 +493,5 @@ int ga102_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_
 int gh100_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
 int ad102_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
 int gb100_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
+int gb202_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
 #endif
index 1a9a74c26e8ee757fe833365765585dff325ad42..b96f0555ca14535f1b39d8976924ec6db7047759 100644 (file)
@@ -1000,6 +1000,7 @@ nouveau_bo_move_init(struct nouveau_drm *drm)
                            struct ttm_resource *, struct ttm_resource *);
                int (*init)(struct nouveau_channel *, u32 handle);
        } _methods[] = {
+               {  "COPY", 4, 0xcab5, nve0_bo_move_copy, nve0_bo_move_init },
                {  "COPY", 4, 0xc9b5, nve0_bo_move_copy, nve0_bo_move_init },
                {  "COPY", 4, 0xc8b5, nve0_bo_move_copy, nve0_bo_move_init },
                {  "COPY", 4, 0xc7b5, nve0_bo_move_copy, nve0_bo_move_init },
index 726de0aa0fcf9c9a3b6e96750901100db9b3ab94..b1e92b1f7a262664d8eb3173d4b06b94ac818cc3 100644 (file)
@@ -249,6 +249,7 @@ nouveau_channel_ctor(struct nouveau_cli *cli, bool priv, u64 runm,
                     struct nouveau_channel **pchan)
 {
        const struct nvif_mclass hosts[] = {
+               { BLACKWELL_CHANNEL_GPFIFO_B, 0 },
                { BLACKWELL_CHANNEL_GPFIFO_A, 0 },
                {    HOPPER_CHANNEL_GPFIFO_A, 0 },
                {    AMPERE_CHANNEL_GPFIFO_B, 0 },
index 0be604af5b2952eb8dbd4ee185c47b924db3f896..0c82a63cd49d3ee463f8630183a271b4348a62bc 100644 (file)
@@ -511,6 +511,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
                case AMPERE_CHANNEL_GPFIFO_B:
                case HOPPER_CHANNEL_GPFIFO_A:
                case BLACKWELL_CHANNEL_GPFIFO_A:
+               case BLACKWELL_CHANNEL_GPFIFO_B:
                        ret = gv100_fence_create(drm);
                        break;
                default:
index ae470a1fdfb87fdf130e5e51a4dba1e642b8c5dd..53f03fa1c9c2eaa8c61c79f55accb4fb2526a14d 100644 (file)
@@ -41,10 +41,11 @@ nvif_user_ctor(struct nvif_device *device, const char *name)
                int version;
                const struct nvif_user_func *func;
        } users[] = {
-               { HOPPER_USERMODE_A, -1, &nvif_userc361 },
-               { AMPERE_USERMODE_A, -1, &nvif_userc361 },
-               { TURING_USERMODE_A, -1, &nvif_userc361 },
-               {  VOLTA_USERMODE_A, -1, &nvif_userc361 },
+               { BLACKWELL_USERMODE_A, -1, &nvif_userc361 },
+               {    HOPPER_USERMODE_A, -1, &nvif_userc361 },
+               {    AMPERE_USERMODE_A, -1, &nvif_userc361 },
+               {    TURING_USERMODE_A, -1, &nvif_userc361 },
+               {     VOLTA_USERMODE_A, -1, &nvif_userc361 },
                {}
        };
        int cid, ret;
index 8bf1635ffabc093f8c1fca62c86fd70e71a357ec..9754bac65df7fb42543fe92de57348607859b3a7 100644 (file)
@@ -10,3 +10,4 @@ nvkm-y += nvkm/engine/ce/gv100.o
 nvkm-y += nvkm/engine/ce/tu102.o
 nvkm-y += nvkm/engine/ce/ga100.o
 nvkm-y += nvkm/engine/ce/ga102.o
+nvkm-y += nvkm/engine/ce/gb202.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/gb202.c b/drivers/gpu/drm/nouveau/nvkm/engine/ce/gb202.c
new file mode 100644 (file)
index 0000000..37c3c61
--- /dev/null
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#include "priv.h"
+
+#include <nvhw/drf.h>
+#include <nvhw/ref/gb202/dev_ce.h>
+
+u32
+gb202_ce_grce_mask(struct nvkm_device *device)
+{
+       u32 data = nvkm_rd32(device, NV_CE_GRCE_MASK);
+
+       return NVVAL_GET(data, NV_CE, GRCE_MASK, VALUE);
+}
index 806a76a72249306f8879da5efebf1b6d5d607a59..34fd2657134b81b18b9607417eb5b9a33e7d6f84 100644 (file)
@@ -16,4 +16,6 @@ int ga100_ce_oneinit(struct nvkm_engine *);
 int ga100_ce_init(struct nvkm_engine *);
 int ga100_ce_fini(struct nvkm_engine *, bool);
 int ga100_ce_nonstall(struct nvkm_engine *);
+
+u32 gb202_ce_grce_mask(struct nvkm_device *);
 #endif
index f6f23cbc7a7340ae9d9b7cfa02e60046d9e033fb..3375a59ebf1a4af73daf4c029605a10a7721c725 100644 (file)
@@ -2832,6 +2832,86 @@ nv1a2_chipset = {
        .fifo     = { 0x00000001, ga102_fifo_new },
 };
 
+static const struct nvkm_device_chip
+nv1b2_chipset = {
+       .name = "GB202",
+       .bar      = { 0x00000001, tu102_bar_new },
+       .fb       = { 0x00000001, gb202_fb_new },
+       .fsp      = { 0x00000001, gb202_fsp_new },
+       .gsp      = { 0x00000001, gb202_gsp_new },
+       .imem     = { 0x00000001, gh100_instmem_new },
+       .mmu      = { 0x00000001, gh100_mmu_new },
+       .pci      = { 0x00000001, gh100_pci_new },
+       .timer    = { 0x00000001, gk20a_timer_new },
+       .vfn      = { 0x00000001, ga100_vfn_new },
+       .disp     = { 0x00000001, ga102_disp_new },
+       .fifo     = { 0x00000001, ga102_fifo_new },
+};
+
+static const struct nvkm_device_chip
+nv1b3_chipset = {
+       .name = "GB203",
+       .bar      = { 0x00000001, tu102_bar_new },
+       .fb       = { 0x00000001, gb202_fb_new },
+       .fsp      = { 0x00000001, gb202_fsp_new },
+       .gsp      = { 0x00000001, gb202_gsp_new },
+       .imem     = { 0x00000001, gh100_instmem_new },
+       .mmu      = { 0x00000001, gh100_mmu_new },
+       .pci      = { 0x00000001, gh100_pci_new },
+       .timer    = { 0x00000001, gk20a_timer_new },
+       .vfn      = { 0x00000001, ga100_vfn_new },
+       .disp     = { 0x00000001, ga102_disp_new },
+       .fifo     = { 0x00000001, ga102_fifo_new },
+};
+
+static const struct nvkm_device_chip
+nv1b5_chipset = {
+       .name = "GB205",
+       .bar      = { 0x00000001, tu102_bar_new },
+       .fb       = { 0x00000001, gb202_fb_new },
+       .fsp      = { 0x00000001, gb202_fsp_new },
+       .gsp      = { 0x00000001, gb202_gsp_new },
+       .imem     = { 0x00000001, gh100_instmem_new },
+       .mmu      = { 0x00000001, gh100_mmu_new },
+       .pci      = { 0x00000001, gh100_pci_new },
+       .timer    = { 0x00000001, gk20a_timer_new },
+       .vfn      = { 0x00000001, ga100_vfn_new },
+       .disp     = { 0x00000001, ga102_disp_new },
+       .fifo     = { 0x00000001, ga102_fifo_new },
+};
+
+static const struct nvkm_device_chip
+nv1b6_chipset = {
+       .name = "GB206",
+       .bar      = { 0x00000001, tu102_bar_new },
+       .fb       = { 0x00000001, gb202_fb_new },
+       .fsp      = { 0x00000001, gb202_fsp_new },
+       .gsp      = { 0x00000001, gb202_gsp_new },
+       .imem     = { 0x00000001, gh100_instmem_new },
+       .mmu      = { 0x00000001, gh100_mmu_new },
+       .pci      = { 0x00000001, gh100_pci_new },
+       .timer    = { 0x00000001, gk20a_timer_new },
+       .vfn      = { 0x00000001, ga100_vfn_new },
+       .disp     = { 0x00000001, ga102_disp_new },
+       .fifo     = { 0x00000001, ga102_fifo_new },
+};
+
+static const struct nvkm_device_chip
+nv1b7_chipset = {
+       .name = "GB207",
+       .bar      = { 0x00000001, tu102_bar_new },
+       .fb       = { 0x00000001, gb202_fb_new },
+       .fsp      = { 0x00000001, gb202_fsp_new },
+       .gsp      = { 0x00000001, gb202_gsp_new },
+       .imem     = { 0x00000001, gh100_instmem_new },
+       .mmu      = { 0x00000001, gh100_mmu_new },
+       .pci      = { 0x00000001, gh100_pci_new },
+       .timer    = { 0x00000001, gk20a_timer_new },
+       .vfn      = { 0x00000001, ga100_vfn_new },
+       .disp     = { 0x00000001, ga102_disp_new },
+       .fifo     = { 0x00000001, ga102_fifo_new },
+};
+
 struct nvkm_subdev *
 nvkm_device_subdev(struct nvkm_device *device, int type, int inst)
 {
@@ -3150,6 +3230,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
                case 0x180: device->card_type = GH100; break;
                case 0x190: device->card_type = AD100; break;
                case 0x1a0: device->card_type = GB10x; break;
+               case 0x1b0: device->card_type = GB20x; break;
                default:
                        break;
                }
@@ -3260,6 +3341,11 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
        case 0x197: device->chip = &nv197_chipset; break;
        case 0x1a0: device->chip = &nv1a0_chipset; break;
        case 0x1a2: device->chip = &nv1a2_chipset; break;
+       case 0x1b2: device->chip = &nv1b2_chipset; break;
+       case 0x1b3: device->chip = &nv1b3_chipset; break;
+       case 0x1b5: device->chip = &nv1b5_chipset; break;
+       case 0x1b6: device->chip = &nv1b6_chipset; break;
+       case 0x1b7: device->chip = &nv1b7_chipset; break;
        default:
                if (nvkm_boolopt(device->cfgopt, "NvEnableUnsupportedChipsets", false)) {
                        switch (device->chipset) {
index 07f45cc16210d5b941789078698b441583105fcd..58191b7a0494efbfbfcbb5b3cbaba360132a9477 100644 (file)
@@ -150,6 +150,7 @@ nvkm_udevice_info(struct nvkm_udevice *udev, void *data, u32 size)
        case AD100: args->v0.family = NV_DEVICE_INFO_V0_ADA; break;
        case GH100: args->v0.family = NV_DEVICE_INFO_V0_HOPPER; break;
        case GB10x: args->v0.family = NV_DEVICE_INFO_V0_BLACKWELL; break;
+       case GB20x: args->v0.family = NV_DEVICE_INFO_V0_BLACKWELL; break;
        default:
                args->v0.family = 0;
                break;
index 5a074b9970abe6612e0ee93ddfc32f1939c9701d..376e9c3bcb1a8f6ca3604fe23abf1ac5a5c5558f 100644 (file)
@@ -25,6 +25,7 @@ nvkm-y += nvkm/engine/fifo/gv100.o
 nvkm-y += nvkm/engine/fifo/tu102.o
 nvkm-y += nvkm/engine/fifo/ga100.o
 nvkm-y += nvkm/engine/fifo/ga102.o
+nvkm-y += nvkm/engine/fifo/gb202.o
 
 nvkm-y += nvkm/engine/fifo/ucgrp.o
 nvkm-y += nvkm/engine/fifo/uchan.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gb202.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gb202.c
new file mode 100644 (file)
index 0000000..b469e8a
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#include "priv.h"
+#include "cgrp.h"
+#include "chan.h"
+#include "runl.h"
+
+u32
+gb202_chan_doorbell_handle(struct nvkm_chan *chan)
+{
+       return BIT(30) | (chan->cgrp->runl->id << 16) | chan->id;
+}
index 9ebb35c31db0c048df1be2ec94cee2bf0fec00e9..5e81ae1953290d98b71dc3a80e66f3f2a40ca8a5 100644 (file)
@@ -208,6 +208,8 @@ extern const struct nvkm_engn_func ga100_engn_ce;
 extern const struct nvkm_cgrp_func ga100_cgrp;
 extern const struct nvkm_chan_func ga100_chan;
 
+u32 gb202_chan_doorbell_handle(struct nvkm_chan *);
+
 int nvkm_uchan_new(struct nvkm_fifo *, struct nvkm_cgrp *, const struct nvkm_oclass *,
                   void *argv, u32 argc, struct nvkm_object **);
 int nvkm_ucgrp_new(struct nvkm_fifo *, const struct nvkm_oclass *, void *argv, u32 argc,
index b438a57f2efcfefbc4aa508b4530c712aef22e80..8d8a5382d1b1907ab8aa5ccc44b1d77faf30e387 100644 (file)
@@ -37,6 +37,7 @@ nvkm-y += nvkm/subdev/fb/ga100.o
 nvkm-y += nvkm/subdev/fb/ga102.o
 nvkm-y += nvkm/subdev/fb/gh100.o
 nvkm-y += nvkm/subdev/fb/gb100.o
+nvkm-y += nvkm/subdev/fb/gb202.o
 
 nvkm-y += nvkm/subdev/fb/r535.o
 
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gb202.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gb202.c
new file mode 100644 (file)
index 0000000..8485050
--- /dev/null
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#include "priv.h"
+
+#include <nvhw/drf.h>
+#include <nvhw/ref/gb10b/dev_fbhub.h>
+
+static void
+gb202_fb_sysmem_flush_page_init(struct nvkm_fb *fb)
+{
+       struct nvkm_device *device = fb->subdev.device;
+       const u64 addr = fb->sysmem.flush_page_addr;
+
+       nvkm_wr32(device, NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI, upper_32_bits(addr));
+       nvkm_wr32(device, NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO, lower_32_bits(addr));
+}
+
+static const struct nvkm_fb_func
+gb202_fb = {
+       .sysmem.flush_page_init = gb202_fb_sysmem_flush_page_init,
+       .vidmem.size = ga102_fb_vidmem_size,
+};
+
+int
+gb202_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
+{
+       return r535_fb_new(&gb202_fb, device, type, inst, pfb);
+}
index 337772acdddce2ee58c6469faf69c68985dd0a79..1a9ded3a86f8e43bba54d0d2de0de6bb28ff7b85 100644 (file)
@@ -5,3 +5,4 @@
 nvkm-y += nvkm/subdev/fsp/base.o
 nvkm-y += nvkm/subdev/fsp/gh100.o
 nvkm-y += nvkm/subdev/fsp/gb100.o
+nvkm-y += nvkm/subdev/fsp/gb202.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/gb202.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fsp/gb202.c
new file mode 100644 (file)
index 0000000..3438aac
--- /dev/null
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#include "priv.h"
+
+#include <nvhw/drf.h>
+#include <nvhw/ref/gb202/dev_therm.h>
+
+static int
+gb202_fsp_wait_secure_boot(struct nvkm_fsp *fsp)
+{
+       struct nvkm_device *device = fsp->subdev.device;
+       unsigned timeout_ms = 4000;
+
+       do {
+               u32 status = NVKM_RD32(device, NV_THERM, I2CS_SCRATCH, FSP_BOOT_COMPLETE_STATUS);
+
+               if (status == NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE_STATUS_SUCCESS)
+                       return 0;
+
+               usleep_range(1000, 2000);
+       } while (timeout_ms--);
+
+       return -ETIMEDOUT;
+}
+
+static const struct nvkm_fsp_func
+gb202_fsp = {
+       .wait_secure_boot = gb202_fsp_wait_secure_boot,
+       .cot = {
+               .version = 2,
+               .size_hash = 48,
+               .size_pkey = 97,
+               .size_sig = 96,
+               .boot_gsp_fmc = gh100_fsp_boot_gsp_fmc,
+       },
+};
+
+int
+gb202_fsp_new(struct nvkm_device *device,
+             enum nvkm_subdev_type type, int inst, struct nvkm_fsp **pfsp)
+{
+       return nvkm_fsp_new_(&gb202_fsp, device, type, inst, pfsp);
+}
index 4aebea4f6a641765c8cf8444b00aa3dc4ab8a92f..e9c948b67bbdb5dff5029caed57de3b7d027e692 100644 (file)
@@ -10,5 +10,6 @@ nvkm-y += nvkm/subdev/gsp/ga102.o
 nvkm-y += nvkm/subdev/gsp/gh100.o
 nvkm-y += nvkm/subdev/gsp/ad102.o
 nvkm-y += nvkm/subdev/gsp/gb100.o
+nvkm-y += nvkm/subdev/gsp/gb202.o
 
 include $(src)/nvkm/subdev/gsp/rm/Kbuild
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gb202.c
new file mode 100644 (file)
index 0000000..c1d7181
--- /dev/null
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#include "priv.h"
+
+static const struct nvkm_gsp_func
+gb202_gsp = {
+       .flcn = &ga102_gsp_flcn,
+
+       .sig_section = ".fwsignature_gb20x",
+
+       .dtor = r535_gsp_dtor,
+       .oneinit = gh100_gsp_oneinit,
+       .init = gh100_gsp_init,
+       .fini = gh100_gsp_fini,
+
+       .rm.gpu = &gb20x_gpu,
+};
+
+static struct nvkm_gsp_fwif
+gb202_gsps[] = {
+       { 0, gh100_gsp_load, &gb202_gsp, &r570_rm_gb20x, "570.144", true },
+       {}
+};
+
+int
+gb202_gsp_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
+             struct nvkm_gsp **pgsp)
+{
+       return nvkm_gsp_new_(gb202_gsps, device, type, inst, pgsp);
+}
+
+NVKM_GSP_FIRMWARE_FMC(gb202, 570.144);
+NVKM_GSP_FIRMWARE_FMC(gb203, 570.144);
+NVKM_GSP_FIRMWARE_FMC(gb205, 570.144);
+NVKM_GSP_FIRMWARE_FMC(gb206, 570.144);
+NVKM_GSP_FIRMWARE_FMC(gb207, 570.144);
index 2efef4b694d667b51fcf3bc38d160a47c03a5914..04037394a2da1e8c4ce6b5aa23c699cf462f8028 100644 (file)
@@ -13,6 +13,7 @@ nvkm-y += nvkm/subdev/gsp/rm/ga1xx.o
 nvkm-y += nvkm/subdev/gsp/rm/ad10x.o
 nvkm-y += nvkm/subdev/gsp/rm/gh100.o
 nvkm-y += nvkm/subdev/gsp/rm/gb10x.o
+nvkm-y += nvkm/subdev/gsp/rm/gb20x.o
 
 include $(src)/nvkm/subdev/gsp/rm/r535/Kbuild
 include $(src)/nvkm/subdev/gsp/rm/r570/Kbuild
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gb20x.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/gb20x.c
new file mode 100644 (file)
index 0000000..950471d
--- /dev/null
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ */
+#include "gpu.h"
+
+#include <engine/ce/priv.h>
+#include <engine/fifo/priv.h>
+
+#include <nvif/class.h>
+
+const struct nvkm_rm_gpu
+gb20x_gpu = {
+       .disp.class = {
+               .root = GB202_DISP,
+               .caps = GB202_DISP_CAPS,
+               .core = GB202_DISP_CORE_CHANNEL_DMA,
+               .wndw = GB202_DISP_WINDOW_CHANNEL_DMA,
+               .wimm = GB202_DISP_WINDOW_IMM_CHANNEL_DMA,
+               .curs = GB202_DISP_CURSOR,
+       },
+
+       .usermode.class = BLACKWELL_USERMODE_A,
+
+       .fifo.chan = {
+               .class = BLACKWELL_CHANNEL_GPFIFO_B,
+               .doorbell_handle = gb202_chan_doorbell_handle,
+       },
+
+       .ce = {
+               .class = BLACKWELL_DMA_COPY_B,
+               .grce_mask = gb202_ce_grce_mask,
+       },
+       .gr.class = {
+               .i2m = BLACKWELL_INLINE_TO_MEMORY_A,
+               .twod = FERMI_TWOD_A,
+               .threed = BLACKWELL_B,
+               .compute = BLACKWELL_COMPUTE_B,
+       },
+       .nvdec.class = NVCFB0_VIDEO_DECODER,
+       .nvenc.class = NVCFB7_VIDEO_ENCODER,
+       .nvjpg.class = NVCFD1_VIDEO_NVJPG,
+       .ofa.class = NVCFFA_VIDEO_OFA,
+};
index 77aa7b13a3afc006cb1ee717b0ee41c3645a1007..46a6325641b70a8a90dc56b71cb4158340f019d2 100644 (file)
@@ -31,6 +31,7 @@ struct nvkm_rm_gpu {
 
        struct {
                u32 class;
+               u32 (*grce_mask)(struct nvkm_device *);
        } ce;
 
        struct {
@@ -65,4 +66,5 @@ extern const struct nvkm_rm_gpu ga1xx_gpu;
 extern const struct nvkm_rm_gpu ad10x_gpu;
 extern const struct nvkm_rm_gpu gh100_gpu;
 extern const struct nvkm_rm_gpu gb10x_gpu;
+extern const struct nvkm_rm_gpu gb20x_gpu;
 #endif
index eaba4d50860d7e3410fd3fa7d55ba6b5c571a626..1ac5628c5140e66d306a1aadce10c810886afad3 100644 (file)
@@ -507,6 +507,22 @@ r535_fifo_runl_ctor(struct nvkm_fifo *fifo)
                        continue;
                }
 
+               /* Skip SW engine - there's currently no support for NV SW classes. */
+               if (type == NVKM_ENGINE_SW)
+                       continue;
+
+               /* Skip lone GRCEs (ones not paired with GR on a runlist), as they
+                * don't appear to function as async copy engines.
+                */
+               if (type == NVKM_ENGINE_CE &&
+                    rm->gpu->ce.grce_mask &&
+                   (rm->gpu->ce.grce_mask(device) & BIT(inst)) &&
+                   !nvkm_runl_find_engn(engn, runl, engn->engine->subdev.type == NVKM_ENGINE_GR)) {
+                       RUNL_DEBUG(runl, "skip LCE %d - GRCE without GR", inst);
+                       nvkm_runl_del(runl);
+                       continue;
+               }
+
                ret = nvkm_rm_engine_new(gsp->rm, type, inst);
                if (ret) {
                        nvkm_runl_del(runl);
index 7e5b411fa54303a6146447b5b63007c7088a9139..498658d0c60c879005e043778ce4252f5f78cbef 100644 (file)
@@ -39,6 +39,16 @@ r570_wpr_libos3_gb10x = {
        .offset_set_by_acr = true,
 };
 
+static const struct nvkm_rm_wpr
+r570_wpr_libos3_gb20x = {
+       .os_carveout_size = GSP_FW_HEAP_PARAM_OS_SIZE_LIBOS3_BAREMETAL,
+       .base_size = GSP_FW_HEAP_PARAM_BASE_RM_SIZE_GH100,
+       .heap_size_min = GSP_FW_HEAP_SIZE_OVERRIDE_LIBOS3_BAREMETAL_MIN_MB,
+       .heap_size_non_wpr = 0x220000,
+       .rsvd_size_pmu = ALIGN(0x0800000 + 0x1000000 + 0x0001000, 0x20000),
+       .offset_set_by_acr = true,
+};
+
 static const struct nvkm_rm_api
 r570_api = {
        .gsp = &r570_gsp,
@@ -81,3 +91,9 @@ r570_rm_gb10x = {
        .wpr = &r570_wpr_libos3_gb10x,
        .api = &r570_api,
 };
+
+const struct nvkm_rm_impl
+r570_rm_gb20x = {
+       .wpr = &r570_wpr_libos3_gb20x,
+       .api = &r570_api,
+};
index 2e9bd74d39be090845796896c202abb87d73078e..393ea775941fae05d5bbb765e23c5b8ca789648d 100644 (file)
@@ -178,6 +178,7 @@ extern const struct nvkm_rm_impl r570_rm_tu102;
 extern const struct nvkm_rm_impl r570_rm_ga102;
 extern const struct nvkm_rm_impl r570_rm_gh100;
 extern const struct nvkm_rm_impl r570_rm_gb10x;
+extern const struct nvkm_rm_impl r570_rm_gb20x;
 extern const struct nvkm_rm_api_gsp r570_gsp;
 extern const struct nvkm_rm_api_client r570_client;
 extern const struct nvkm_rm_api_fbsr r570_fbsr;