Files
linux-nv-oot/drivers/platform/tegra/dce/include/interface/dce-admin-cmds.h
Mahesh Kumar a23d954e3e platform: dce: Add bootsrap2 command
Add support to the bootstrap command over the admin channel,
which will be called when a client registers. This command will
perform steps that must be performed only after the client is ready.

TODO: This bootstrap-2 command will be replaced by the existing
bootstrap command which we call during DCE-FW bootstrapping once
we split admin bootstrapping and RM bootstrapping in the DCE-KMD.

Jira TDS-17135

Change-Id: I55330b9ce73e1acf20e2a80d392d7984c91ed65f
Signed-off-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3274949
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:17 +00:00

222 lines
6.8 KiB
C

/* SPDX-License-Identifier: MIT */
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* 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.
*/
#ifndef DCE_ADMIN_CMDS_H
#define DCE_ADMIN_CMDS_H
#include <interface/dce-types.h>
#include <interface/dce-admin-perf-stats.h>
/*
* Version of the ADMIN command interface.
*
* This MUST be updated any time any changes are made to the ADMIN
* commands.
*
* To keep things simple, this value should be incremented by 1 each
* time changes are made.
*/
#define DCE_ADMIN_VERSION 4
#define DCE_ADMIN_CMD_SIZE sizeof(struct dce_admin_ipc_cmd)
#define DCE_ADMIN_RESP_SIZE sizeof(struct dce_admin_ipc_resp)
#define DCE_ADMIN_CMD_CHAN_FSIZE max(DCE_ADMIN_CMD_SIZE, \
DCE_ADMIN_RESP_SIZE)
#define DCE_ADMIN_CMD_MAX_NFRAMES 4
#define DCE_ADMIN_CMD_VERSION 0x00U // returns version of interface
#define DCE_ADMIN_CMD_HOST_VERSION 0x01U // host supplied version
#define DCE_ADMIN_CMD_GET_FW_VERSION 0x02U // return FW version info
#define DCE_ADMIN_CMD_ECHO 0x03U // echo data back to CCPLEX
#define DCE_ADMIN_CMD_MEM_MAP 0x04U // map a region of memory
#define DCE_ADMIN_CMD_MEM_INFO 0x05U // return info about a region
#define DCE_ADMIN_CMD_IPC_INFO 0x06U // return IPC chan info
#define DCE_ADMIN_CMD_IPC_CREATE 0x07U // create an IPC channel
#define DCE_ADMIN_CMD_PREPARE_SC7 0x08U // prepare to enter SC7
#define DCE_ADMIN_CMD_ENTER_SC7 0x09U // enter SC7
#define DCE_ADMIN_CMD_SET_LOGGING 0x0AU // set logging level
#define DCE_ADMIN_CMD_GET_LOG_INFO 0x0BU // get current log info
#define DCE_ADMIN_CMD_LOCK_CHANGES 0x0CU // lock creating new channels
// and changing memory areas
#define DCE_ADMIN_CMD_CODE_COVERAGE_START 0x0DU // start collecting code
// coverage data
#define DCE_ADMIN_CMD_CODE_COVERAGE_STOP 0x0EU // stop collecting code
// coverage data
#define DCE_ADMIN_CMD_PERF_START 0x0FU // start collecting perf data
#define DCE_ADMIN_CMD_PERF_STOP 0x10U // stop collecting perf data
#define DCE_ADMIN_CMD_INT_TEST_START 0x11U // start internal tests
#define DCE_ADMIN_CMD_INT_TEST_STOP 0x12U // stop internal tests and return status
#define DCE_ADMIN_CMD_EXT_TEST 0x13U // run external test (blocking call)
#define DCE_ADMIN_CMD_DEBUG 0x14U // debug command
#define DCE_ADMIN_CMD_RM_BOOTSTRAP 0x15U // tell RM to "bootstrap"
#define DCE_ADMIN_CMD_PERF_RESULTS 0x16U // copy out the perf results
#define DCE_ADMIN_CMD_PERF_GET_EVENTS 0x17U // get perf events
#define DCE_ADMIN_CMD_PERF_CLEAR_EVENTS 0x18U // clear perf events
#define DCE_ADMIN_CMD_RM_BOOTSTRAP2 0x19U // tell RM to "bootstrap" display-server
#define DCE_ADMIN_CMD_NEXT 0x1AU // must be last command ID + 1
struct dce_admin_version_info {
uint32_t version;
};
struct dce_admin_fw_version_info {
uint32_t bootstrap_interface;
uint32_t admin_interface;
uint32_t driver_headers;
uint32_t core_interface;
uint8_t fw_version[4];
uint32_t gcid_revision;
uint8_t safertos_major;
uint8_t safertos_minor;
};
struct dce_admin_echo {
uint32_t data;
};
#define DCE_ADMIN_EXT_TEST_ALU 0U
#define DCE_ADMIN_EXT_TEST_DMA 1U
struct dce_admin_ext_test_args {
uint32_t test_cmd;
};
/** Flags used for various set log ops */
#define DCE_ADMIN_LOG_FL_CLEAR_BUFFER 1U
#define DCE_ADMIN_LOG_FL_SET_IOVA_ADDR 2U
#define DCE_ADMIN_LOG_FL_SET_LOG_LVL 4U
struct dce_admin_set_log_info {
/** Flag with bits indicating below various ops to perform
* in set log call:
*
* - Clear log buffer
* - Set IOVA addr
* - Set log level
*/
uint32_t flags;
/** IOVA of DRAM region to be mapped */
dce_iova iova;
/** Size of complete buffer */
uint32_t buff_size;
/** Log level value to set */
uint32_t log_level;
/** Stream-id to be used by the region */
uint32_t stream_id;
};
struct dce_admin_get_log_info {
/** Number of bytes written */
uint64_t bytes_written;
/** Offset from where circular region of buffer is starting */
uint32_t offset;
};
struct dce_admin_log_args {
/**
* Struct containing info used by set admin cmd call for
* setting up logging buffer.
*/
struct dce_admin_set_log_info set_log_info;
/**
* Struct containing info used by get admin cmd call to
* retrieve data from logging buffer.
*/
struct dce_admin_get_log_info get_log_info;
};
struct dce_admin_mem_args {
uint32_t region;
dce_iova iova;
uint32_t length;
uint32_t sid;
};
struct dce_admin_ipc_info_args {
uint32_t type;
};
struct dce_admin_ipc_signal {
uint32_t signal_type;
union {
uint32_t mailbox;
struct {
uint32_t doorbell_num;
uint32_t doorbell_bit_num;
} doorbell;
} signal;
uint32_t semaphore;
uint32_t semaphore_bit_num;
};
struct dce_admin_ipc_info {
uint32_t type;
uint32_t flags;
uint32_t mem_region;
dce_iova rd_iova;
dce_iova wr_iova;
uint32_t fsize;
uint32_t n_frames;
struct dce_admin_ipc_signal signal_from_dce;
struct dce_admin_ipc_signal signal_to_dce;
};
struct dce_admin_ipc_create_args {
uint32_t type;
dce_iova rd_iova;
dce_iova wr_iova;
uint32_t fsize;
uint32_t n_frames;
};
struct dce_admin_ipc_cmd {
uint32_t cmd;
union {
struct dce_admin_version_info version;
struct dce_admin_echo echo;
struct dce_admin_ext_test_args ext_test;
struct dce_admin_log_args log;
struct dce_admin_ipc_info_args ipc_info;
struct dce_admin_mem_args mem_map;
struct dce_admin_ipc_create_args ipc_create;
struct dce_admin_perf_args perf;
} args;
};
struct dce_admin_ipc_resp {
uint32_t error;
union {
struct dce_admin_version_info version;
struct dce_admin_echo echo;
struct dce_admin_log_args log;
struct dce_admin_ipc_info ipc;
struct dce_admin_mem_args mem_info;
struct dce_admin_fw_version_info fw_version;
struct dce_admin_perf_stats_info perf;
} args;
};
#endif