mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
This change adds the support for programming streamids to allow tsec fw on t264 to access PA at a low privilege level. It also includes the synchronization logic to communicate with the fw regarding completion of stream id programming so that the fw can go ahead and initialize itself. In addition to this, the mailbox used for communicating init done from tsec fw to ccplex is changed from NV_PTSEC_FALCON_MAILBOX0 to NV_PTSEC_MAILBOX1 since CCPLEX does not have access to the former from t26x onwards. Hence falcon based mailboxes are used for tsec-psc comms and non-falcon ones for tsec-ccplex comms (stream id comms and init done). Jira TSEC-14 Change-Id: I2871a52222cd69786a8cc3f53162a80486611bb5 Signed-off-by: Sahil Patki <spatki@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3366343 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> (cherry picked from commit db54fde9c4d786b22b7f8694753de3ec80649b17) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3400219
94 lines
1.9 KiB
C
94 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
*
|
|
* Tegra TSEC Module Support
|
|
*/
|
|
|
|
#ifndef TSEC_H
|
|
#define TSEC_H
|
|
|
|
#include "tsec_regs.h"
|
|
/*
|
|
* TSEC Device Data Structure
|
|
*/
|
|
|
|
#define TSEC_CLK_NAME "tsec"
|
|
#define TSEC_CLK_INDEX (0)
|
|
#define EFUSE_CLK_NAME "efuse"
|
|
#define EFUSE_CLK_INDEX (1)
|
|
#define TSEC_PKA_CLK_NAME "tsec_pka"
|
|
#define TSEC_PKA_CLK_INDEX (2)
|
|
#define TSEC_NUM_OF_CLKS (3)
|
|
|
|
enum tsec_soc {
|
|
TSEC_ON_T23x = 0,
|
|
TSEC_ON_T239,
|
|
TSEC_ON_T26x,
|
|
TSEC_ON_INVALID,
|
|
};
|
|
|
|
struct tsec_device_data {
|
|
void __iomem *reg_aperture;
|
|
struct device_dma_parameters dma_parms;
|
|
|
|
int irq;
|
|
/* spin lock for module irq */
|
|
spinlock_t mirq_lock;
|
|
|
|
/* If module is powered on */
|
|
bool power_on;
|
|
|
|
struct clk *clk[TSEC_NUM_OF_CLKS];
|
|
long rate[TSEC_NUM_OF_CLKS];
|
|
/* private platform data */
|
|
void *private_data;
|
|
/* owner platform_device */
|
|
struct platform_device *pdev;
|
|
|
|
/* reset control for this device */
|
|
struct reset_control *reset_control;
|
|
|
|
/* store the risc-v info */
|
|
void *riscv_data;
|
|
/* name of riscv descriptor binary */
|
|
char *riscv_desc_bin;
|
|
/* name of riscv image binary */
|
|
char *riscv_image_bin;
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
struct dentry *debug_root;
|
|
#endif /* CONFIG_DEBUG_FS */
|
|
|
|
/* Number of bits for DMA mask - IOVA/PA number of bits */
|
|
u8 dma_mask_bits;
|
|
/* Which SOC Tsec is running on */
|
|
enum tsec_soc soc;
|
|
|
|
/* store the register offsets */
|
|
struct tsec_reg_offsets_t *tsec_reg_offsets;
|
|
};
|
|
|
|
/*
|
|
* TSEC Register Access APIs
|
|
*/
|
|
|
|
void tsec_writel(struct tsec_device_data *pdata, u32 r, u32 v);
|
|
u32 tsec_readl(struct tsec_device_data *pdata, u32 r);
|
|
|
|
|
|
/*
|
|
* TSEC power on/off APIs
|
|
*/
|
|
|
|
int tsec_poweron(struct device *dev);
|
|
int tsec_poweroff(struct device *dev);
|
|
|
|
/*
|
|
* TSEC StreamID Register Programming Operation
|
|
*/
|
|
void tsec_set_streamid_regs(struct device *dev,
|
|
struct tsec_device_data *pdata);
|
|
|
|
#endif /* TSEC_H */
|