diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 76 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/instmem/r535.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mmu/r535.c | 6 |
9 files changed, 68 insertions, 52 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c index 461fb8daf596..4135690326f4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c @@ -28,9 +28,9 @@ #include <subdev/mmu/vmm.h> #include <nvrm/nvtypes.h> -#include <nvrm/535.54.03/nvidia/generated/g_rpc-structures.h> -#include <nvrm/535.54.03/nvidia/kernel/inc/vgpu/rpc_global_enums.h> -#include <nvrm/535.54.03/nvidia/kernel/inc/vgpu/rpc_headers.h> +#include <nvrm/535.113.01/nvidia/generated/g_rpc-structures.h> +#include <nvrm/535.113.01/nvidia/kernel/inc/vgpu/rpc_global_enums.h> +#include <nvrm/535.113.01/nvidia/kernel/inc/vgpu/rpc_headers.h> static void r535_bar_flush(struct nvkm_bar *bar) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c index 0ca6c397de96..c849c6299c52 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c @@ -22,7 +22,7 @@ #include "priv.h" static const struct nvkm_gsp_func -ad102_gsp_r535_54_03 = { +ad102_gsp_r535_113_01 = { .flcn = &ga102_gsp_flcn, .fwsec = &ga102_gsp_fwsec, @@ -45,7 +45,7 @@ ad102_gsp_r535_54_03 = { static struct nvkm_gsp_fwif ad102_gsps[] = { - { 0, r535_gsp_load, &ad102_gsp_r535_54_03, "535.54.03", true }, + { 0, r535_gsp_load, &ad102_gsp_r535_113_01, "535.113.01", true }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c index 8a2c7347f64e..223f68b532ef 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c @@ -39,7 +39,7 @@ ga100_gsp_flcn = { }; static const struct nvkm_gsp_func -ga100_gsp_r535_54_03 = { +ga100_gsp_r535_113_01 = { .flcn = &ga100_gsp_flcn, .fwsec = &tu102_gsp_fwsec, @@ -61,7 +61,7 @@ ga100_gsp_r535_54_03 = { static struct nvkm_gsp_fwif ga100_gsps[] = { - { 0, r535_gsp_load, &ga100_gsp_r535_54_03, "535.54.03" }, + { 0, r535_gsp_load, &ga100_gsp_r535_113_01, "535.113.01" }, { -1, gv100_gsp_nofw, &gv100_gsp }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c index 1c41e77d607f..4c4b4168a266 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c @@ -150,7 +150,7 @@ ga102_gsp_flcn = { }; static const struct nvkm_gsp_func -ga102_gsp_r535_54_03 = { +ga102_gsp_r535_113_01 = { .flcn = &ga102_gsp_flcn, .fwsec = &ga102_gsp_fwsec, @@ -178,7 +178,7 @@ ga102_gsp = { static struct nvkm_gsp_fwif ga102_gsps[] = { - { 0, r535_gsp_load, &ga102_gsp_r535_54_03, "535.54.03" }, + { 0, r535_gsp_load, &ga102_gsp_r535_113_01, "535.113.01" }, { -1, gv100_gsp_nofw, &ga102_gsp }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c index c24693f265e8..47138d797748 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c @@ -30,37 +30,46 @@ #include <nvfw/fw.h> #include <nvrm/nvtypes.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/class/cl0000.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/class/cl0005.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/class/cl0080.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/class/cl2080.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080event.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080gpu.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080internal.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/nvos.h> -#include <nvrm/535.54.03/common/shared/msgq/inc/msgq/msgq_priv.h> -#include <nvrm/535.54.03/common/uproc/os/common/include/libos_init_args.h> -#include <nvrm/535.54.03/nvidia/arch/nvalloc/common/inc/gsp/gsp_fw_sr_meta.h> -#include <nvrm/535.54.03/nvidia/arch/nvalloc/common/inc/gsp/gsp_fw_wpr_meta.h> -#include <nvrm/535.54.03/nvidia/arch/nvalloc/common/inc/rmRiscvUcode.h> -#include <nvrm/535.54.03/nvidia/arch/nvalloc/common/inc/rmgspseq.h> -#include <nvrm/535.54.03/nvidia/generated/g_allclasses.h> -#include <nvrm/535.54.03/nvidia/generated/g_os_nvoc.h> -#include <nvrm/535.54.03/nvidia/generated/g_rpc-structures.h> -#include <nvrm/535.54.03/nvidia/inc/kernel/gpu/gsp/gsp_fw_heap.h> -#include <nvrm/535.54.03/nvidia/inc/kernel/gpu/gsp/gsp_init_args.h> -#include <nvrm/535.54.03/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h> -#include <nvrm/535.54.03/nvidia/inc/kernel/gpu/intr/engine_idx.h> -#include <nvrm/535.54.03/nvidia/kernel/inc/vgpu/rpc_global_enums.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/class/cl0000.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/class/cl0005.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/class/cl0080.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/class/cl2080.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080event.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080gpu.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080internal.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/nvos.h> +#include <nvrm/535.113.01/common/shared/msgq/inc/msgq/msgq_priv.h> +#include <nvrm/535.113.01/common/uproc/os/common/include/libos_init_args.h> +#include <nvrm/535.113.01/nvidia/arch/nvalloc/common/inc/gsp/gsp_fw_sr_meta.h> +#include <nvrm/535.113.01/nvidia/arch/nvalloc/common/inc/gsp/gsp_fw_wpr_meta.h> +#include <nvrm/535.113.01/nvidia/arch/nvalloc/common/inc/rmRiscvUcode.h> +#include <nvrm/535.113.01/nvidia/arch/nvalloc/common/inc/rmgspseq.h> +#include <nvrm/535.113.01/nvidia/generated/g_allclasses.h> +#include <nvrm/535.113.01/nvidia/generated/g_os_nvoc.h> +#include <nvrm/535.113.01/nvidia/generated/g_rpc-structures.h> +#include <nvrm/535.113.01/nvidia/inc/kernel/gpu/gsp/gsp_fw_heap.h> +#include <nvrm/535.113.01/nvidia/inc/kernel/gpu/gsp/gsp_init_args.h> +#include <nvrm/535.113.01/nvidia/inc/kernel/gpu/gsp/gsp_static_config.h> +#include <nvrm/535.113.01/nvidia/inc/kernel/gpu/intr/engine_idx.h> +#include <nvrm/535.113.01/nvidia/kernel/inc/vgpu/rpc_global_enums.h> #include <linux/acpi.h> +#define GSP_MSG_MIN_SIZE GSP_PAGE_SIZE +#define GSP_MSG_MAX_SIZE GSP_PAGE_MIN_SIZE * 16 + struct r535_gsp_msg { + u8 auth_tag_buffer[16]; + u8 aad_buffer[16]; u32 checksum; u32 sequence; + u32 elem_count; + u32 pad; u8 data[]; }; +#define GSP_MSG_HDR_SIZE offsetof(struct r535_gsp_msg, data) + static void * r535_gsp_msgq_wait(struct nvkm_gsp *gsp, u32 repc, u32 *prepc, int *ptime) { @@ -70,7 +79,7 @@ r535_gsp_msgq_wait(struct nvkm_gsp *gsp, u32 repc, u32 *prepc, int *ptime) u8 *msg; u32 len; - size = DIV_ROUND_UP(sizeof(*mqe) + repc, GSP_PAGE_SIZE); + size = DIV_ROUND_UP(GSP_MSG_HDR_SIZE + repc, GSP_PAGE_SIZE); if (WARN_ON(!size || size >= gsp->msgq.cnt)) return ERR_PTR(-EINVAL); @@ -135,20 +144,25 @@ r535_gsp_cmdq_push(struct nvkm_gsp *gsp, void *argv) struct r535_gsp_msg *cqe; u32 argc = cmd->checksum; u64 *ptr = (void *)cmd; - u64 *end = (void *)cmd->data + argc; + u64 *end; u64 csum = 0; int free, time = 1000000; u32 wptr, size; u32 off = 0; + argc = ALIGN(GSP_MSG_HDR_SIZE + argc, GSP_PAGE_SIZE); + + end = (u64 *)((char *)ptr + argc); + cmd->pad = 0; cmd->checksum = 0; cmd->sequence = gsp->cmdq.seq++; + cmd->elem_count = DIV_ROUND_UP(argc, 0x1000); + while (ptr < end) csum ^= *ptr++; cmd->checksum = upper_32_bits(csum) ^ lower_32_bits(csum); - argc = sizeof(*cmd) + argc; wptr = *gsp->cmdq.wptr; do { do { @@ -193,8 +207,10 @@ static void * r535_gsp_cmdq_get(struct nvkm_gsp *gsp, u32 argc) { struct r535_gsp_msg *cmd; + u32 size = GSP_MSG_HDR_SIZE + argc; - cmd = kvzalloc(sizeof(*cmd) + argc, GFP_KERNEL); + size = ALIGN(size, GSP_MSG_MIN_SIZE); + cmd = kvzalloc(size, GFP_KERNEL); if (!cmd) return ERR_PTR(-ENOMEM); @@ -2168,10 +2184,10 @@ r535_gsp_load(struct nvkm_gsp *gsp, int ver, const struct nvkm_gsp_fwif *fwif) } #define NVKM_GSP_FIRMWARE(chip) \ -MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_load-535.54.03.bin"); \ -MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_unload-535.54.03.bin"); \ -MODULE_FIRMWARE("nvidia/"#chip"/gsp/bootloader-535.54.03.bin"); \ -MODULE_FIRMWARE("nvidia/"#chip"/gsp/gsp-535.54.03.bin") +MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_load-535.113.01.bin"); \ +MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_unload-535.113.01.bin"); \ +MODULE_FIRMWARE("nvidia/"#chip"/gsp/bootloader-535.113.01.bin"); \ +MODULE_FIRMWARE("nvidia/"#chip"/gsp/gsp-535.113.01.bin") NVKM_GSP_FIRMWARE(tu102); NVKM_GSP_FIRMWARE(tu104); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c index 999150aa6721..59c5f2b9172a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c @@ -163,7 +163,7 @@ tu102_gsp_flcn = { }; static const struct nvkm_gsp_func -tu102_gsp_r535_54_03 = { +tu102_gsp_r535_113_01 = { .flcn = &tu102_gsp_flcn, .fwsec = &tu102_gsp_fwsec, @@ -185,7 +185,7 @@ tu102_gsp_r535_54_03 = { static struct nvkm_gsp_fwif tu102_gsps[] = { - { 0, r535_gsp_load, &tu102_gsp_r535_54_03, "535.54.03" }, + { 0, r535_gsp_load, &tu102_gsp_r535_113_01, "535.113.01" }, { -1, gv100_gsp_nofw, &gv100_gsp }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c index e9f0605abbfd..04fbd9ed28b1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu116.c @@ -22,7 +22,7 @@ #include "priv.h" static const struct nvkm_gsp_func -tu116_gsp_r535_54_03 = { +tu116_gsp_r535_113_01 = { .flcn = &tu102_gsp_flcn, .fwsec = &tu102_gsp_fwsec, @@ -44,7 +44,7 @@ tu116_gsp_r535_54_03 = { static struct nvkm_gsp_fwif tu116_gsps[] = { - { 0, r535_gsp_load, &tu116_gsp_r535_54_03, "535.54.03" }, + { 0, r535_gsp_load, &tu116_gsp_r535_113_01, "535.113.01" }, { -1, gv100_gsp_nofw, &gv100_gsp }, {} }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/r535.c index fc6e54e436d0..5f3c9c02a4c0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/r535.c @@ -26,12 +26,12 @@ #include <nvhw/drf.h> #include <nvrm/nvtypes.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/class/cl84a0.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080internal.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/nvos.h> -#include <nvrm/535.54.03/nvidia/generated/g_fbsr_nvoc.h> -#include <nvrm/535.54.03/nvidia/generated/g_rpc-structures.h> -#include <nvrm/535.54.03/nvidia/kernel/inc/vgpu/rpc_global_enums.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/class/cl84a0.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080internal.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/nvos.h> +#include <nvrm/535.113.01/nvidia/generated/g_fbsr_nvoc.h> +#include <nvrm/535.113.01/nvidia/generated/g_rpc-structures.h> +#include <nvrm/535.113.01/nvidia/kernel/inc/vgpu/rpc_global_enums.h> struct fbsr_item { const char *type; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/r535.c index 9cdea8842923..d3e95453f25d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/r535.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/r535.c @@ -22,9 +22,9 @@ #include "vmm.h" #include <nvrm/nvtypes.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/class/cl90f1.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/ctrl/ctrl90f1.h> -#include <nvrm/535.54.03/common/sdk/nvidia/inc/nvos.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/class/cl90f1.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/ctrl/ctrl90f1.h> +#include <nvrm/535.113.01/common/sdk/nvidia/inc/nvos.h> static int r535_mmu_promote_vmm(struct nvkm_vmm *vmm) |