Skip to content

Commit 284ad70

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau: add support for GB20x
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 <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Timur Tabi <[email protected]> Tested-by: Timur Tabi <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 56c36f5 commit 284ad70

File tree

32 files changed

+393
-4
lines changed

32 files changed

+393
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
4+
*/
5+
#ifndef __gb10b_dev_fb_h__
6+
#define __gb10b_dev_fb_h__
7+
8+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO 0x008a1d58 /* RW-4R */
9+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO_ADR 31:0 /* RWIVF */
10+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO_ADR_INIT 0x00000000 /* RWI-V */
11+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_LO_ADR_MASK 0xffffff00 /* RW--V */
12+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI 0x008a1d5c /* RW-4R */
13+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI_ADR 31:0 /* RWIVF */
14+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI_ADR_INIT 0x00000000 /* RWI-V */
15+
#define NV_PFB_FBHUB0_PCIE_FLUSH_SYSMEM_ADDR_HI_ADR_MASK 0x000fffff /* RW--V */
16+
17+
#endif // __gb10b_dev_fb_h__
18+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
4+
*/
5+
#ifndef __gb202_dev_ce_h__
6+
#define __gb202_dev_ce_h__
7+
8+
#define NV_CE_GRCE_MASK 0x001040d8 /* C--4R */
9+
#define NV_CE_GRCE_MASK_VALUE 9:0 /* C--VF */
10+
#define NV_CE_GRCE_MASK_VALUE_INIT 0x00f /* C---V */
11+
12+
#endif // __gb202_dev_ce_h__
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* SPDX-License-Identifier: MIT
2+
*
3+
* Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
4+
*/
5+
#ifndef __gb202_dev_therm_h__
6+
#define __gb202_dev_therm_h__
7+
8+
#define NV_THERM_I2CS_SCRATCH 0x00ad00bc /* RW-4R */
9+
#define NV_THERM_I2CS_SCRATCH_DATA 31:0 /* RWIVF */
10+
#define NV_THERM_I2CS_SCRATCH_DATA_INIT 0x00000000 /* RWI-V */
11+
#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE NV_THERM_I2CS_SCRATCH
12+
#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE_STATUS 31:0
13+
#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE_STATUS_SUCCESS 0x000000FF
14+
#define NV_THERM_I2CS_SCRATCH_FSP_BOOT_COMPLETE_STATUS_FAILED 0x00000000
15+
16+
#endif // __gb202_dev_therm_h__
17+

drivers/gpu/drm/nouveau/include/nvif/class.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#define TURING_USERMODE_A 0x0000c461
6666
#define AMPERE_USERMODE_A 0x0000c561
6767
#define HOPPER_USERMODE_A 0x0000c661
68+
#define BLACKWELL_USERMODE_A 0x0000c761
6869

6970
#define MAXWELL_FAULT_BUFFER_A /* clb069.h */ 0x0000b069
7071
#define VOLTA_FAULT_BUFFER_A /* clb069.h */ 0x0000c369
@@ -89,6 +90,7 @@
8990
#define AMPERE_CHANNEL_GPFIFO_B /* if0020.h */ 0x0000c76f
9091
#define HOPPER_CHANNEL_GPFIFO_A 0x0000c86f
9192
#define BLACKWELL_CHANNEL_GPFIFO_A 0x0000c96f
93+
#define BLACKWELL_CHANNEL_GPFIFO_B 0x0000ca6f
9294

9395
#define NV50_DISP /* if0010.h */ 0x00005070
9496
#define G82_DISP /* if0010.h */ 0x00008270
@@ -106,8 +108,10 @@
106108
#define TU102_DISP /* if0010.h */ 0x0000c570
107109
#define GA102_DISP /* if0010.h */ 0x0000c670
108110
#define AD102_DISP /* if0010.h */ 0x0000c770
111+
#define GB202_DISP 0x0000ca70
109112

110113
#define GV100_DISP_CAPS 0x0000c373
114+
#define GB202_DISP_CAPS 0x0000ca73
111115

112116
#define NV31_MPEG 0x00003174
113117
#define G82_MPEG 0x00008274
@@ -122,6 +126,7 @@
122126
#define GV100_DISP_CURSOR /* if0014.h */ 0x0000c37a
123127
#define TU102_DISP_CURSOR /* if0014.h */ 0x0000c57a
124128
#define GA102_DISP_CURSOR /* if0014.h */ 0x0000c67a
129+
#define GB202_DISP_CURSOR 0x0000ca7a
125130

126131
#define NV50_DISP_OVERLAY /* if0014.h */ 0x0000507b
127132
#define G82_DISP_OVERLAY /* if0014.h */ 0x0000827b
@@ -132,6 +137,7 @@
132137
#define GV100_DISP_WINDOW_IMM_CHANNEL_DMA /* if0014.h */ 0x0000c37b
133138
#define TU102_DISP_WINDOW_IMM_CHANNEL_DMA /* if0014.h */ 0x0000c57b
134139
#define GA102_DISP_WINDOW_IMM_CHANNEL_DMA /* if0014.h */ 0x0000c67b
140+
#define GB202_DISP_WINDOW_IMM_CHANNEL_DMA 0x0000ca7b
135141

136142
#define NV50_DISP_BASE_CHANNEL_DMA /* if0014.h */ 0x0000507c
137143
#define G82_DISP_BASE_CHANNEL_DMA /* if0014.h */ 0x0000827c
@@ -157,6 +163,7 @@
157163
#define TU102_DISP_CORE_CHANNEL_DMA /* if0014.h */ 0x0000c57d
158164
#define GA102_DISP_CORE_CHANNEL_DMA /* if0014.h */ 0x0000c67d
159165
#define AD102_DISP_CORE_CHANNEL_DMA /* if0014.h */ 0x0000c77d
166+
#define GB202_DISP_CORE_CHANNEL_DMA 0x0000ca7d
160167

161168
#define NV50_DISP_OVERLAY_CHANNEL_DMA /* if0014.h */ 0x0000507e
162169
#define G82_DISP_OVERLAY_CHANNEL_DMA /* if0014.h */ 0x0000827e
@@ -168,6 +175,7 @@
168175
#define GV100_DISP_WINDOW_CHANNEL_DMA /* if0014.h */ 0x0000c37e
169176
#define TU102_DISP_WINDOW_CHANNEL_DMA /* if0014.h */ 0x0000c57e
170177
#define GA102_DISP_WINDOW_CHANNEL_DMA /* if0014.h */ 0x0000c67e
178+
#define GB202_DISP_WINDOW_CHANNEL_DMA 0x0000ca7e
171179

172180
#define NV50_TESLA 0x00005097
173181
#define G82_TESLA 0x00008297
@@ -201,6 +209,7 @@
201209
#define HOPPER_A 0x0000cb97
202210

203211
#define BLACKWELL_A 0x0000cd97
212+
#define BLACKWELL_B 0x0000ce97
204213

205214
#define NV74_BSP 0x000074b0
206215

@@ -210,6 +219,7 @@
210219
#define NVC7B0_VIDEO_DECODER 0x0000c7b0
211220
#define NVC9B0_VIDEO_DECODER 0x0000c9b0
212221
#define NVCDB0_VIDEO_DECODER 0x0000cdb0
222+
#define NVCFB0_VIDEO_DECODER 0x0000cfb0
213223

214224
#define GT212_MSVLD 0x000085b1
215225
#define IGT21A_MSVLD 0x000086b1
@@ -240,10 +250,12 @@
240250
#define AMPERE_DMA_COPY_B 0x0000c7b5
241251
#define HOPPER_DMA_COPY_A 0x0000c8b5
242252
#define BLACKWELL_DMA_COPY_A 0x0000c9b5
253+
#define BLACKWELL_DMA_COPY_B 0x0000cab5
243254

244255
#define NVC4B7_VIDEO_ENCODER 0x0000c4b7
245256
#define NVC7B7_VIDEO_ENCODER 0x0000c7b7
246257
#define NVC9B7_VIDEO_ENCODER 0x0000c9b7
258+
#define NVCFB7_VIDEO_ENCODER 0x0000cfb7
247259

248260
#define FERMI_DECOMPRESS 0x000090b8
249261

@@ -264,17 +276,20 @@
264276
#define ADA_COMPUTE_A 0x0000c9c0
265277
#define HOPPER_COMPUTE_A 0x0000cbc0
266278
#define BLACKWELL_COMPUTE_A 0x0000cdc0
279+
#define BLACKWELL_COMPUTE_B 0x0000cec0
267280

268281
#define NV74_CIPHER 0x000074c1
269282

270283
#define NVB8D1_VIDEO_NVJPG 0x0000b8d1
271284
#define NVC4D1_VIDEO_NVJPG 0x0000c4d1
272285
#define NVC9D1_VIDEO_NVJPG 0x0000c9d1
273286
#define NVCDD1_VIDEO_NVJPG 0x0000cdd1
287+
#define NVCFD1_VIDEO_NVJPG 0x0000cfd1
274288

275289
#define NVB8FA_VIDEO_OFA 0x0000b8fa
276290
#define NVC6FA_VIDEO_OFA 0x0000c6fa
277291
#define NVC7FA_VIDEO_OFA 0x0000c7fa
278292
#define NVC9FA_VIDEO_OFA 0x0000c9fa
279293
#define NVCDFA_VIDEO_OFA 0x0000cdfa
294+
#define NVCFFA_VIDEO_OFA 0x0000cffa
280295
#endif

drivers/gpu/drm/nouveau/include/nvkm/core/device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct nvkm_device {
4949
GH100 = 0x180,
5050
AD100 = 0x190,
5151
GB10x = 0x1a0,
52+
GB20x = 0x1b0,
5253
} card_type;
5354
u32 chipset;
5455
u8 chiprev;

drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ int ga100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct n
104104
int ga102_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
105105
int gh100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
106106
int gb100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
107+
int gb202_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
107108

108109
#include <subdev/bios.h>
109110
#include <subdev/bios/ramcfg.h>

drivers/gpu/drm/nouveau/include/nvkm/subdev/fsp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ int nvkm_fsp_boot_gsp_fmc(struct nvkm_fsp *, u64 args_addr, u32 rsvd_size, bool
2020

2121
int gh100_fsp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fsp **);
2222
int gb100_fsp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fsp **);
23+
int gb202_fsp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fsp **);
2324
#endif

drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,4 +493,5 @@ int ga102_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_
493493
int gh100_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
494494
int ad102_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
495495
int gb100_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
496+
int gb202_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
496497
#endif

drivers/gpu/drm/nouveau/nouveau_bo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ nouveau_bo_move_init(struct nouveau_drm *drm)
10001000
struct ttm_resource *, struct ttm_resource *);
10011001
int (*init)(struct nouveau_channel *, u32 handle);
10021002
} _methods[] = {
1003+
{ "COPY", 4, 0xcab5, nve0_bo_move_copy, nve0_bo_move_init },
10031004
{ "COPY", 4, 0xc9b5, nve0_bo_move_copy, nve0_bo_move_init },
10041005
{ "COPY", 4, 0xc8b5, nve0_bo_move_copy, nve0_bo_move_init },
10051006
{ "COPY", 4, 0xc7b5, nve0_bo_move_copy, nve0_bo_move_init },

drivers/gpu/drm/nouveau/nouveau_chan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ nouveau_channel_ctor(struct nouveau_cli *cli, bool priv, u64 runm,
249249
struct nouveau_channel **pchan)
250250
{
251251
const struct nvif_mclass hosts[] = {
252+
{ BLACKWELL_CHANNEL_GPFIFO_B, 0 },
252253
{ BLACKWELL_CHANNEL_GPFIFO_A, 0 },
253254
{ HOPPER_CHANNEL_GPFIFO_A, 0 },
254255
{ AMPERE_CHANNEL_GPFIFO_B, 0 },

0 commit comments

Comments
 (0)