mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
drm/nouveau/gsp/r535: add support for booting GSP-RM
This commit adds the initial code needed to boot the GSP-RM firmware provided by NVIDIA, bringing with it the beginnings of Ada support. Until it's had more testing and time to bake, support is disabled by default (except on Ada). GSP-RM usage can be enabled by passing the "config=NvGspRm=1" module option. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-33-skeggsb@gmail.com
This commit is contained in:
@@ -35,6 +35,7 @@ struct nv_device_info_v0 {
|
||||
#define NV_DEVICE_INFO_V0_VOLTA 0x0b
|
||||
#define NV_DEVICE_INFO_V0_TURING 0x0c
|
||||
#define NV_DEVICE_INFO_V0_AMPERE 0x0d
|
||||
#define NV_DEVICE_INFO_V0_ADA 0x0e
|
||||
__u8 family;
|
||||
__u8 pad06[2];
|
||||
__u64 ram_size;
|
||||
|
||||
@@ -46,6 +46,7 @@ struct nvkm_device {
|
||||
GV100 = 0x140,
|
||||
TU100 = 0x160,
|
||||
GA100 = 0x170,
|
||||
AD100 = 0x190,
|
||||
} card_type;
|
||||
u32 chipset;
|
||||
u8 chiprev;
|
||||
|
||||
@@ -48,6 +48,7 @@ int nvkm_falcon_pio_rd(struct nvkm_falcon *, u8 port, enum nvkm_falcon_mem type,
|
||||
const u8 *img, u32 img_base, int len);
|
||||
int nvkm_falcon_dma_wr(struct nvkm_falcon *, const u8 *img, u64 dma_addr, u32 dma_base,
|
||||
enum nvkm_falcon_mem mem_type, u32 mem_base, int len, bool sec);
|
||||
bool nvkm_falcon_riscv_active(struct nvkm_falcon *);
|
||||
|
||||
int gm200_flcn_reset_wait_mem_scrubbing(struct nvkm_falcon *);
|
||||
int gm200_flcn_disable(struct nvkm_falcon *);
|
||||
@@ -61,10 +62,13 @@ void gm200_flcn_tracepc(struct nvkm_falcon *);
|
||||
int gp102_flcn_reset_eng(struct nvkm_falcon *);
|
||||
extern const struct nvkm_falcon_func_pio gp102_flcn_emem_pio;
|
||||
|
||||
bool tu102_flcn_riscv_active(struct nvkm_falcon *);
|
||||
|
||||
int ga102_flcn_select(struct nvkm_falcon *);
|
||||
int ga102_flcn_reset_prep(struct nvkm_falcon *);
|
||||
int ga102_flcn_reset_wait_mem_scrubbing(struct nvkm_falcon *);
|
||||
extern const struct nvkm_falcon_func_dma ga102_flcn_dma;
|
||||
bool ga102_flcn_riscv_active(struct nvkm_falcon *);
|
||||
|
||||
void nvkm_falcon_v1_load_imem(struct nvkm_falcon *,
|
||||
void *, u32, u32, u16, u8, bool);
|
||||
|
||||
@@ -87,6 +87,8 @@ struct nvkm_falcon_func {
|
||||
u32 stride;
|
||||
} cmdq, msgq;
|
||||
|
||||
bool (*riscv_active)(struct nvkm_falcon *);
|
||||
|
||||
struct {
|
||||
u32 *data;
|
||||
u32 size;
|
||||
|
||||
@@ -29,6 +29,7 @@ int nvbios_memcmp(struct nvkm_bios *, u32 addr, const char *, u32 len);
|
||||
u8 nvbios_rd08(struct nvkm_bios *, u32 addr);
|
||||
u16 nvbios_rd16(struct nvkm_bios *, u32 addr);
|
||||
u32 nvbios_rd32(struct nvkm_bios *, u32 addr);
|
||||
void *nvbios_pointer(struct nvkm_bios *, u32 addr);
|
||||
|
||||
int nvkm_bios_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_bios **);
|
||||
#endif
|
||||
|
||||
@@ -3,18 +3,186 @@
|
||||
#define nvkm_gsp(p) container_of((p), struct nvkm_gsp, subdev)
|
||||
#include <core/subdev.h>
|
||||
#include <core/falcon.h>
|
||||
#include <core/firmware.h>
|
||||
|
||||
#define GSP_PAGE_SHIFT 12
|
||||
#define GSP_PAGE_SIZE BIT(GSP_PAGE_SHIFT)
|
||||
|
||||
struct nvkm_gsp_mem {
|
||||
u32 size;
|
||||
void *data;
|
||||
dma_addr_t addr;
|
||||
};
|
||||
|
||||
struct nvkm_gsp_radix3 {
|
||||
struct nvkm_gsp_mem mem[3];
|
||||
};
|
||||
|
||||
int nvkm_gsp_sg(struct nvkm_device *, u64 size, struct sg_table *);
|
||||
void nvkm_gsp_sg_free(struct nvkm_device *, struct sg_table *);
|
||||
|
||||
typedef int (*nvkm_gsp_msg_ntfy_func)(void *priv, u32 fn, void *repv, u32 repc);
|
||||
|
||||
struct nvkm_gsp {
|
||||
const struct nvkm_gsp_func *func;
|
||||
struct nvkm_subdev subdev;
|
||||
|
||||
struct nvkm_falcon falcon;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
const struct firmware *load;
|
||||
const struct firmware *unload;
|
||||
} booter;
|
||||
const struct firmware *bl;
|
||||
const struct firmware *rm;
|
||||
} fws;
|
||||
|
||||
struct nvkm_firmware fw;
|
||||
struct nvkm_gsp_mem sig;
|
||||
struct nvkm_gsp_radix3 radix3;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
struct {
|
||||
u64 addr;
|
||||
u64 size;
|
||||
} vga_workspace;
|
||||
u64 addr;
|
||||
u64 size;
|
||||
} bios;
|
||||
struct {
|
||||
struct {
|
||||
u64 addr;
|
||||
u64 size;
|
||||
} frts, boot, elf, heap;
|
||||
u64 addr;
|
||||
u64 size;
|
||||
} wpr2;
|
||||
struct {
|
||||
u64 addr;
|
||||
u64 size;
|
||||
} heap;
|
||||
u64 addr;
|
||||
u64 size;
|
||||
} fb;
|
||||
|
||||
struct {
|
||||
struct nvkm_falcon_fw load;
|
||||
struct nvkm_falcon_fw unload;
|
||||
} booter;
|
||||
|
||||
struct {
|
||||
struct nvkm_gsp_mem fw;
|
||||
u32 code_offset;
|
||||
u32 data_offset;
|
||||
u32 manifest_offset;
|
||||
u32 app_version;
|
||||
} boot;
|
||||
|
||||
struct nvkm_gsp_mem libos;
|
||||
struct nvkm_gsp_mem loginit;
|
||||
struct nvkm_gsp_mem logintr;
|
||||
struct nvkm_gsp_mem logrm;
|
||||
struct nvkm_gsp_mem rmargs;
|
||||
|
||||
struct nvkm_gsp_mem wpr_meta;
|
||||
|
||||
struct {
|
||||
struct sg_table sgt;
|
||||
struct nvkm_gsp_radix3 radix3;
|
||||
struct nvkm_gsp_mem meta;
|
||||
} sr;
|
||||
|
||||
struct {
|
||||
struct nvkm_gsp_mem mem;
|
||||
|
||||
struct {
|
||||
int nr;
|
||||
u32 size;
|
||||
u64 *ptr;
|
||||
} ptes;
|
||||
|
||||
struct {
|
||||
u32 size;
|
||||
void *ptr;
|
||||
} cmdq, msgq;
|
||||
} shm;
|
||||
|
||||
struct nvkm_gsp_cmdq {
|
||||
struct mutex mutex;
|
||||
u32 cnt;
|
||||
u32 seq;
|
||||
u32 *wptr;
|
||||
u32 *rptr;
|
||||
} cmdq;
|
||||
|
||||
struct nvkm_gsp_msgq {
|
||||
struct mutex mutex;
|
||||
u32 cnt;
|
||||
u32 *wptr;
|
||||
u32 *rptr;
|
||||
struct nvkm_gsp_msgq_ntfy {
|
||||
u32 fn;
|
||||
nvkm_gsp_msg_ntfy_func func;
|
||||
void *priv;
|
||||
} ntfy[16];
|
||||
int ntfy_nr;
|
||||
} msgq;
|
||||
|
||||
bool running;
|
||||
|
||||
const struct nvkm_gsp_rm {
|
||||
void *(*rpc_get)(struct nvkm_gsp *, u32 fn, u32 argc);
|
||||
void *(*rpc_push)(struct nvkm_gsp *, void *argv, bool wait, u32 repc);
|
||||
void (*rpc_done)(struct nvkm_gsp *gsp, void *repv);
|
||||
} *rm;
|
||||
};
|
||||
|
||||
static inline bool
|
||||
nvkm_gsp_rm(struct nvkm_gsp *gsp)
|
||||
{
|
||||
return false;
|
||||
return gsp && (gsp->fws.rm || gsp->fw.img);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
nvkm_gsp_rpc_get(struct nvkm_gsp *gsp, u32 fn, u32 argc)
|
||||
{
|
||||
return gsp->rm->rpc_get(gsp, fn, argc);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
nvkm_gsp_rpc_push(struct nvkm_gsp *gsp, void *argv, bool wait, u32 repc)
|
||||
{
|
||||
return gsp->rm->rpc_push(gsp, argv, wait, repc);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
nvkm_gsp_rpc_rd(struct nvkm_gsp *gsp, u32 fn, u32 argc)
|
||||
{
|
||||
void *argv = nvkm_gsp_rpc_get(gsp, fn, argc);
|
||||
|
||||
if (IS_ERR_OR_NULL(argv))
|
||||
return argv;
|
||||
|
||||
return nvkm_gsp_rpc_push(gsp, argv, true, argc);
|
||||
}
|
||||
|
||||
static inline int
|
||||
nvkm_gsp_rpc_wr(struct nvkm_gsp *gsp, void *argv, bool wait)
|
||||
{
|
||||
void *repv = nvkm_gsp_rpc_push(gsp, argv, wait, 0);
|
||||
|
||||
if (IS_ERR(repv))
|
||||
return PTR_ERR(repv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
nvkm_gsp_rpc_done(struct nvkm_gsp *gsp, void *repv)
|
||||
{
|
||||
gsp->rm->rpc_done(gsp, repv);
|
||||
}
|
||||
|
||||
int gv100_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
|
||||
@@ -22,4 +190,5 @@ int tu102_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_
|
||||
int tu116_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
|
||||
int ga100_gsp_new(struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_gsp **);
|
||||
int ga102_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 **);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef __src_common_sdk_nvidia_inc_ctrl_ctrl0073_ctrl0073system_h__
|
||||
#define __src_common_sdk_nvidia_inc_ctrl_ctrl0073_ctrl0073system_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2005-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define NV0073_CTRL_SYSTEM_ACPI_ID_MAP_MAX_DISPLAYS (16U)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef __src_common_sdk_nvidia_inc_ctrl_ctrl2080_ctrl2080gpu_h__
|
||||
#define __src_common_sdk_nvidia_inc_ctrl_ctrl2080_ctrl2080gpu_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2006-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define NV2080_CTRL_GPU_SET_POWER_STATE_GPU_LEVEL_0 (0x00000000U)
|
||||
|
||||
#define NV2080_CTRL_GPU_SET_POWER_STATE_GPU_LEVEL_3 (0x00000003U)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef __src_common_shared_msgq_inc_msgq_msgq_priv_h__
|
||||
#define __src_common_shared_msgq_inc_msgq_msgq_priv_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2018-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 version; // queue version
|
||||
NvU32 size; // bytes, page aligned
|
||||
NvU32 msgSize; // entry size, bytes, must be power-of-2, 16 is minimum
|
||||
NvU32 msgCount; // number of entries in queue
|
||||
NvU32 writePtr; // message id of next slot
|
||||
NvU32 flags; // if set it means "i want to swap RX"
|
||||
NvU32 rxHdrOff; // Offset of msgqRxHeader from start of backing store.
|
||||
NvU32 entryOff; // Offset of entries from start of backing store.
|
||||
} msgqTxHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 readPtr; // message id of last message read
|
||||
} msgqRxHeader;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
#ifndef __src_common_uproc_os_common_include_libos_init_args_h__
|
||||
#define __src_common_uproc_os_common_include_libos_init_args_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2018-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef NvU64 LibosAddress;
|
||||
|
||||
typedef enum {
|
||||
LIBOS_MEMORY_REGION_NONE,
|
||||
LIBOS_MEMORY_REGION_CONTIGUOUS,
|
||||
LIBOS_MEMORY_REGION_RADIX3
|
||||
} LibosMemoryRegionKind;
|
||||
|
||||
typedef enum {
|
||||
LIBOS_MEMORY_REGION_LOC_NONE,
|
||||
LIBOS_MEMORY_REGION_LOC_SYSMEM,
|
||||
LIBOS_MEMORY_REGION_LOC_FB
|
||||
} LibosMemoryRegionLoc;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LibosAddress id8; // Id tag.
|
||||
LibosAddress pa; // Physical address.
|
||||
LibosAddress size; // Size of memory area.
|
||||
NvU8 kind; // See LibosMemoryRegionKind above.
|
||||
NvU8 loc; // See LibosMemoryRegionLoc above.
|
||||
} LibosMemoryRegionInitArgument;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
#ifndef __src_nvidia_arch_nvalloc_common_inc_gsp_gsp_fw_sr_meta_h__
|
||||
#define __src_nvidia_arch_nvalloc_common_inc_gsp_gsp_fw_sr_meta_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define GSP_FW_SR_META_MAGIC 0x8a3bb9e6c6c39d93ULL
|
||||
#define GSP_FW_SR_META_REVISION 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
//
|
||||
// Magic
|
||||
// Use for verification by Booter
|
||||
//
|
||||
NvU64 magic; // = GSP_FW_SR_META_MAGIC;
|
||||
|
||||
//
|
||||
// Revision number
|
||||
// Bumped up when we change this interface so it is not backward compatible.
|
||||
// Bumped up when we revoke GSP-RM ucode
|
||||
//
|
||||
NvU64 revision; // = GSP_FW_SR_META_MAGIC_REVISION;
|
||||
|
||||
//
|
||||
// ---- Members regarding data in SYSMEM ----------------------------
|
||||
// Consumed by Booter for DMA
|
||||
//
|
||||
NvU64 sysmemAddrOfSuspendResumeData;
|
||||
NvU64 sizeOfSuspendResumeData;
|
||||
|
||||
// ---- Members for crypto ops across S/R ---------------------------
|
||||
|
||||
//
|
||||
// HMAC over the entire GspFwSRMeta structure (including padding)
|
||||
// with the hmac field itself zeroed.
|
||||
//
|
||||
NvU8 hmac[32];
|
||||
|
||||
// Hash over GspFwWprMeta structure
|
||||
NvU8 wprMetaHash[32];
|
||||
|
||||
// Hash over GspFwHeapFreeList structure. All zeros signifies no free list.
|
||||
NvU8 heapFreeListHash[32];
|
||||
|
||||
// Hash over data in WPR2 (skipping over free heap chunks; see Booter for details)
|
||||
NvU8 dataHash[32];
|
||||
|
||||
//
|
||||
// Pad structure to exactly 256 bytes (1 DMA chunk).
|
||||
// Padding initialized to zero.
|
||||
//
|
||||
NvU32 padding[24];
|
||||
|
||||
} GspFwSRMeta;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,149 @@
|
||||
#ifndef __src_nvidia_arch_nvalloc_common_inc_gsp_gsp_fw_wpr_meta_h__
|
||||
#define __src_nvidia_arch_nvalloc_common_inc_gsp_gsp_fw_wpr_meta_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Magic
|
||||
// BL to use for verification (i.e. Booter locked it in WPR2)
|
||||
NvU64 magic; // = 0xdc3aae21371a60b3;
|
||||
|
||||
// Revision number of Booter-BL-Sequencer handoff interface
|
||||
// Bumped up when we change this interface so it is not backward compatible.
|
||||
// Bumped up when we revoke GSP-RM ucode
|
||||
NvU64 revision; // = 1;
|
||||
|
||||
// ---- Members regarding data in SYSMEM ----------------------------
|
||||
// Consumed by Booter for DMA
|
||||
|
||||
NvU64 sysmemAddrOfRadix3Elf;
|
||||
NvU64 sizeOfRadix3Elf;
|
||||
|
||||
NvU64 sysmemAddrOfBootloader;
|
||||
NvU64 sizeOfBootloader;
|
||||
|
||||
// Offsets inside bootloader image needed by Booter
|
||||
NvU64 bootloaderCodeOffset;
|
||||
NvU64 bootloaderDataOffset;
|
||||
NvU64 bootloaderManifestOffset;
|
||||
|
||||
union
|
||||
{
|
||||
// Used only at initial boot
|
||||
struct
|
||||
{
|
||||
NvU64 sysmemAddrOfSignature;
|
||||
NvU64 sizeOfSignature;
|
||||
};
|
||||
|
||||
//
|
||||
// Used at suspend/resume to read GspFwHeapFreeList
|
||||
// Offset relative to GspFwWprMeta FBMEM PA (gspFwWprStart)
|
||||
//
|
||||
struct
|
||||
{
|
||||
NvU32 gspFwHeapFreeListWprOffset;
|
||||
NvU32 unused0;
|
||||
NvU64 unused1;
|
||||
};
|
||||
};
|
||||
|
||||
// ---- Members describing FB layout --------------------------------
|
||||
NvU64 gspFwRsvdStart;
|
||||
|
||||
NvU64 nonWprHeapOffset;
|
||||
NvU64 nonWprHeapSize;
|
||||
|
||||
NvU64 gspFwWprStart;
|
||||
|
||||
// GSP-RM to use to setup heap.
|
||||
NvU64 gspFwHeapOffset;
|
||||
NvU64 gspFwHeapSize;
|
||||
|
||||
// BL to use to find ELF for jump
|
||||
NvU64 gspFwOffset;
|
||||
// Size is sizeOfRadix3Elf above.
|
||||
|
||||
NvU64 bootBinOffset;
|
||||
// Size is sizeOfBootloader above.
|
||||
|
||||
NvU64 frtsOffset;
|
||||
NvU64 frtsSize;
|
||||
|
||||
NvU64 gspFwWprEnd;
|
||||
|
||||
// GSP-RM to use for fbRegionInfo?
|
||||
NvU64 fbSize;
|
||||
|
||||
// ---- Other members -----------------------------------------------
|
||||
|
||||
// GSP-RM to use for fbRegionInfo?
|
||||
NvU64 vgaWorkspaceOffset;
|
||||
NvU64 vgaWorkspaceSize;
|
||||
|
||||
// Boot count. Used to determine whether to load the firmware image.
|
||||
NvU64 bootCount;
|
||||
|
||||
// TODO: the partitionRpc* fields below do not really belong in this
|
||||
// structure. The values are patched in by the partition bootstrapper
|
||||
// when GSP-RM is booted in a partition, and this structure was a
|
||||
// convenient place for the bootstrapper to access them. These should
|
||||
// be moved to a different comm. mechanism between the bootstrapper
|
||||
// and the GSP-RM tasks.
|
||||
|
||||
// Shared partition RPC memory (physical address)
|
||||
NvU64 partitionRpcAddr;
|
||||
|
||||
// Offsets relative to partitionRpcAddr
|
||||
NvU16 partitionRpcRequestOffset;
|
||||
NvU16 partitionRpcReplyOffset;
|
||||
|
||||
// Code section and dataSection offset and size.
|
||||
NvU32 elfCodeOffset;
|
||||
NvU32 elfDataOffset;
|
||||
NvU32 elfCodeSize;
|
||||
NvU32 elfDataSize;
|
||||
|
||||
// Used during GSP-RM resume to check for revocation
|
||||
NvU32 lsUcodeVersion;
|
||||
|
||||
// Number of VF partitions allocating sub-heaps from the WPR heap
|
||||
// Used during boot to ensure the heap is adequately sized
|
||||
NvU8 gspFwHeapVfPartitionCount;
|
||||
|
||||
// Pad structure to exactly 256 bytes. Can replace padding with additional
|
||||
// fields without incrementing revision. Padding initialized to 0.
|
||||
NvU8 padding[7];
|
||||
|
||||
// BL to use for verification (i.e. Booter says OK to boot)
|
||||
NvU64 verified; // 0x0 -> unverified, 0xa0a0a0a0a0a0a0a0 -> verified
|
||||
} GspFwWprMeta;
|
||||
|
||||
#define GSP_FW_WPR_META_REVISION 1
|
||||
#define GSP_FW_WPR_META_MAGIC 0xdc3aae21371a60b3ULL
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,82 @@
|
||||
#ifndef __src_nvidia_arch_nvalloc_common_inc_rmRiscvUcode_h__
|
||||
#define __src_nvidia_arch_nvalloc_common_inc_rmRiscvUcode_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2018-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
//
|
||||
// Version 1
|
||||
// Version 2
|
||||
// Version 3 = for Partition boot
|
||||
// Version 4 = for eb riscv boot
|
||||
// Version 5 = Support signing entire RISC-V image as "code" in code section for hopper and later.
|
||||
//
|
||||
NvU32 version; // structure version
|
||||
NvU32 bootloaderOffset;
|
||||
NvU32 bootloaderSize;
|
||||
NvU32 bootloaderParamOffset;
|
||||
NvU32 bootloaderParamSize;
|
||||
NvU32 riscvElfOffset;
|
||||
NvU32 riscvElfSize;
|
||||
NvU32 appVersion; // Changelist number associated with the image
|
||||
//
|
||||
// Manifest contains information about Monitor and it is
|
||||
// input to BR
|
||||
//
|
||||
NvU32 manifestOffset;
|
||||
NvU32 manifestSize;
|
||||
//
|
||||
// Monitor Data offset within RISCV image and size
|
||||
//
|
||||
NvU32 monitorDataOffset;
|
||||
NvU32 monitorDataSize;
|
||||
//
|
||||
// Monitor Code offset withtin RISCV image and size
|
||||
//
|
||||
NvU32 monitorCodeOffset;
|
||||
NvU32 monitorCodeSize;
|
||||
NvU32 bIsMonitorEnabled;
|
||||
//
|
||||
// Swbrom Code offset within RISCV image and size
|
||||
//
|
||||
NvU32 swbromCodeOffset;
|
||||
NvU32 swbromCodeSize;
|
||||
//
|
||||
// Swbrom Data offset within RISCV image and size
|
||||
//
|
||||
NvU32 swbromDataOffset;
|
||||
NvU32 swbromDataSize;
|
||||
//
|
||||
// Total size of FB carveout (image and reserved space).
|
||||
//
|
||||
NvU32 fbReservedSize;
|
||||
//
|
||||
// Indicates whether the entire RISC-V image is signed as "code" in code section.
|
||||
//
|
||||
NvU32 bSignedAsCode;
|
||||
} RM_RISCV_UCODE_DESC;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,100 @@
|
||||
#ifndef __src_nvidia_arch_nvalloc_common_inc_rmgspseq_h__
|
||||
#define __src_nvidia_arch_nvalloc_common_inc_rmgspseq_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2019-2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef enum GSP_SEQ_BUF_OPCODE
|
||||
{
|
||||
GSP_SEQ_BUF_OPCODE_REG_WRITE = 0,
|
||||
GSP_SEQ_BUF_OPCODE_REG_MODIFY,
|
||||
GSP_SEQ_BUF_OPCODE_REG_POLL,
|
||||
GSP_SEQ_BUF_OPCODE_DELAY_US,
|
||||
GSP_SEQ_BUF_OPCODE_REG_STORE,
|
||||
GSP_SEQ_BUF_OPCODE_CORE_RESET,
|
||||
GSP_SEQ_BUF_OPCODE_CORE_START,
|
||||
GSP_SEQ_BUF_OPCODE_CORE_WAIT_FOR_HALT,
|
||||
GSP_SEQ_BUF_OPCODE_CORE_RESUME,
|
||||
} GSP_SEQ_BUF_OPCODE;
|
||||
|
||||
#define GSP_SEQUENCER_PAYLOAD_SIZE_DWORDS(opcode) \
|
||||
((opcode == GSP_SEQ_BUF_OPCODE_REG_WRITE) ? (sizeof(GSP_SEQ_BUF_PAYLOAD_REG_WRITE) / sizeof(NvU32)) : \
|
||||
(opcode == GSP_SEQ_BUF_OPCODE_REG_MODIFY) ? (sizeof(GSP_SEQ_BUF_PAYLOAD_REG_MODIFY) / sizeof(NvU32)) : \
|
||||
(opcode == GSP_SEQ_BUF_OPCODE_REG_POLL) ? (sizeof(GSP_SEQ_BUF_PAYLOAD_REG_POLL) / sizeof(NvU32)) : \
|
||||
(opcode == GSP_SEQ_BUF_OPCODE_DELAY_US) ? (sizeof(GSP_SEQ_BUF_PAYLOAD_DELAY_US) / sizeof(NvU32)) : \
|
||||
(opcode == GSP_SEQ_BUF_OPCODE_REG_STORE) ? (sizeof(GSP_SEQ_BUF_PAYLOAD_REG_STORE) / sizeof(NvU32)) : \
|
||||
/* GSP_SEQ_BUF_OPCODE_CORE_RESET */ \
|
||||
/* GSP_SEQ_BUF_OPCODE_CORE_START */ \
|
||||
/* GSP_SEQ_BUF_OPCODE_CORE_WAIT_FOR_HALT */ \
|
||||
/* GSP_SEQ_BUF_OPCODE_CORE_RESUME */ \
|
||||
0)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 addr;
|
||||
NvU32 val;
|
||||
} GSP_SEQ_BUF_PAYLOAD_REG_WRITE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 addr;
|
||||
NvU32 mask;
|
||||
NvU32 val;
|
||||
} GSP_SEQ_BUF_PAYLOAD_REG_MODIFY;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 addr;
|
||||
NvU32 mask;
|
||||
NvU32 val;
|
||||
NvU32 timeout;
|
||||
NvU32 error;
|
||||
} GSP_SEQ_BUF_PAYLOAD_REG_POLL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 val;
|
||||
} GSP_SEQ_BUF_PAYLOAD_DELAY_US;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU32 addr;
|
||||
NvU32 index;
|
||||
} GSP_SEQ_BUF_PAYLOAD_REG_STORE;
|
||||
|
||||
typedef struct GSP_SEQUENCER_BUFFER_CMD
|
||||
{
|
||||
GSP_SEQ_BUF_OPCODE opCode;
|
||||
union
|
||||
{
|
||||
GSP_SEQ_BUF_PAYLOAD_REG_WRITE regWrite;
|
||||
GSP_SEQ_BUF_PAYLOAD_REG_MODIFY regModify;
|
||||
GSP_SEQ_BUF_PAYLOAD_REG_POLL regPoll;
|
||||
GSP_SEQ_BUF_PAYLOAD_DELAY_US delayUs;
|
||||
GSP_SEQ_BUF_PAYLOAD_REG_STORE regStore;
|
||||
} payload;
|
||||
} GSP_SEQUENCER_BUFFER_CMD;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef __src_nvidia_generated_g_chipset_nvoc_h__
|
||||
#define __src_nvidia_generated_g_chipset_nvoc_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NvU16 deviceID; // deviceID
|
||||
NvU16 vendorID; // vendorID
|
||||
NvU16 subdeviceID; // subsystem deviceID
|
||||
NvU16 subvendorID; // subsystem vendorID
|
||||
NvU8 revisionID; // revision ID
|
||||
} BUSINFO;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef __src_nvidia_generated_g_os_nvoc_h__
|
||||
#define __src_nvidia_generated_g_os_nvoc_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct PACKED_REGISTRY_ENTRY
|
||||
{
|
||||
NvU32 nameOffset;
|
||||
NvU8 type;
|
||||
NvU32 data;
|
||||
NvU32 length;
|
||||
} PACKED_REGISTRY_ENTRY;
|
||||
|
||||
typedef struct PACKED_REGISTRY_TABLE
|
||||
{
|
||||
NvU32 size;
|
||||
NvU32 numEntries;
|
||||
PACKED_REGISTRY_ENTRY entries[0];
|
||||
} PACKED_REGISTRY_TABLE;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
#ifndef __src_nvidia_generated_g_rpc_structures_h__
|
||||
#define __src_nvidia_generated_g_rpc_structures_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2008-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct rpc_unloading_guest_driver_v1F_07
|
||||
{
|
||||
NvBool bInPMTransition;
|
||||
NvBool bGc6Entering;
|
||||
NvU32 newLevel;
|
||||
} rpc_unloading_guest_driver_v1F_07;
|
||||
|
||||
typedef struct rpc_run_cpu_sequencer_v17_00
|
||||
{
|
||||
NvU32 bufferSizeDWord;
|
||||
NvU32 cmdIndex;
|
||||
NvU32 regSaveArea[8];
|
||||
NvU32 commandBuffer[];
|
||||
} rpc_run_cpu_sequencer_v17_00;
|
||||
|
||||
typedef struct rpc_os_error_log_v17_00
|
||||
{
|
||||
NvU32 exceptType;
|
||||
NvU32 runlistId;
|
||||
NvU32 chid;
|
||||
char errString[0x100];
|
||||
} rpc_os_error_log_v17_00;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef __src_nvidia_inc_kernel_gpu_gpu_acpi_data_h__
|
||||
#define __src_nvidia_inc_kernel_gpu_gpu_acpi_data_h__
|
||||
#include <nvrm/535.54.03/common/sdk/nvidia/inc/ctrl/ctrl0073/ctrl0073system.h>
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct DOD_METHOD_DATA
|
||||
{
|
||||
NV_STATUS status;
|
||||
NvU32 acpiIdListLen;
|
||||
NvU32 acpiIdList[NV0073_CTRL_SYSTEM_ACPI_ID_MAP_MAX_DISPLAYS];
|
||||
} DOD_METHOD_DATA;
|
||||
|
||||
typedef struct JT_METHOD_DATA
|
||||
{
|
||||
NV_STATUS status;
|
||||
NvU32 jtCaps;
|
||||
NvU16 jtRevId;
|
||||
NvBool bSBIOSCaps;
|
||||
} JT_METHOD_DATA;
|
||||
|
||||
typedef struct MUX_METHOD_DATA_ELEMENT
|
||||
{
|
||||
NvU32 acpiId;
|
||||
NvU32 mode;
|
||||
NV_STATUS status;
|
||||
} MUX_METHOD_DATA_ELEMENT;
|
||||
|
||||
typedef struct MUX_METHOD_DATA
|
||||
{
|
||||
NvU32 tableLen;
|
||||
MUX_METHOD_DATA_ELEMENT acpiIdMuxModeTable[NV0073_CTRL_SYSTEM_ACPI_ID_MAP_MAX_DISPLAYS];
|
||||
MUX_METHOD_DATA_ELEMENT acpiIdMuxPartTable[NV0073_CTRL_SYSTEM_ACPI_ID_MAP_MAX_DISPLAYS];
|
||||
} MUX_METHOD_DATA;
|
||||
|
||||
typedef struct CAPS_METHOD_DATA
|
||||
{
|
||||
NV_STATUS status;
|
||||
NvU32 optimusCaps;
|
||||
} CAPS_METHOD_DATA;
|
||||
|
||||
typedef struct ACPI_METHOD_DATA
|
||||
{
|
||||
NvBool bValid;
|
||||
DOD_METHOD_DATA dodMethodData;
|
||||
JT_METHOD_DATA jtMethodData;
|
||||
MUX_METHOD_DATA muxMethodData;
|
||||
CAPS_METHOD_DATA capsMethodData;
|
||||
} ACPI_METHOD_DATA;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef __src_nvidia_inc_kernel_gpu_gsp_gsp_fw_heap_h__
|
||||
#define __src_nvidia_inc_kernel_gpu_gsp_gsp_fw_heap_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define GSP_FW_HEAP_PARAM_SIZE_PER_GB_FB (96 << 10) // All architectures
|
||||
|
||||
#define GSP_FW_HEAP_PARAM_CLIENT_ALLOC_SIZE ((48 << 10) * 2048) // Support 2048 channels
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef __src_nvidia_inc_kernel_gpu_gsp_gsp_init_args_h__
|
||||
#define __src_nvidia_inc_kernel_gpu_gsp_gsp_init_args_h__
|
||||
|
||||
/* Excerpt of RM headers from https://github.com/NVIDIA/open-gpu-kernel-modules/tree/535.54.03 */
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
RmPhysAddr sharedMemPhysAddr;
|
||||
NvU32 pageTableEntryCount;
|
||||
NvLength cmdQueueOffset;
|
||||
NvLength statQueueOffset;
|
||||
NvLength locklessCmdQueueOffset;
|
||||
NvLength locklessStatQueueOffset;
|
||||
} MESSAGE_QUEUE_INIT_ARGUMENTS;
|
||||
|
||||
typedef struct {
|
||||
NvU32 oldLevel;
|
||||
NvU32 flags;
|
||||
NvBool bInPMTransition;
|
||||
} GSP_SR_INIT_ARGUMENTS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MESSAGE_QUEUE_INIT_ARGUMENTS messageQueueInitArguments;
|
||||
GSP_SR_INIT_ARGUMENTS srInitArguments;
|
||||
NvU32 gpuInstance;
|
||||
|
||||
struct
|
||||
{
|
||||
NvU64 pa;
|
||||
NvU64 size;
|
||||
} profilerArgs;
|
||||
} GSP_ARGUMENTS_CACHED;
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user