mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
Use SPDX license GPL-V2.0 format and change Nvidia copyright year to include 2023. Bug 4078035 Change-Id: If13a0a9309c76e1e7b53d6967eada9ed321b8e93 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890633 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
83 lines
1.9 KiB
C
83 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* Tegra TSEC Module Support
|
|
*/
|
|
|
|
#ifndef TSEC_BOOT_H
|
|
#define TSEC_BOOT_H
|
|
|
|
#define RISCV_IDLE_TIMEOUT_DEFAULT 100000 /* 100 milliseconds */
|
|
#define RISCV_IDLE_TIMEOUT_LONG 2000000 /* 2 seconds */
|
|
#define RISCV_IDLE_CHECK_PERIOD 10 /* 10 usec */
|
|
#define RISCV_IDLE_CHECK_PERIOD_LONG 1000 /* 1 milliseconds */
|
|
|
|
/* Image descriptor format */
|
|
struct RM_RISCV_UCODE_DESC {
|
|
/*
|
|
* Version 1
|
|
* Version 2
|
|
* Vesrion 3 = for Partition boot
|
|
* Vesrion 4 = for eb riscv boot
|
|
*/
|
|
u32 version; /* structure version */
|
|
u32 bootloaderOffset;
|
|
u32 bootloaderSize;
|
|
u32 bootloaderParamOffset;
|
|
u32 bootloaderParamSize;
|
|
u32 riscvElfOffset;
|
|
u32 riscvElfSize;
|
|
u32 appVersion; /* Changelist number associated with the image */
|
|
/*
|
|
* Manifest contains information about Monitor and it is
|
|
* input to BR
|
|
*/
|
|
u32 manifestOffset;
|
|
u32 manifestSize;
|
|
/*
|
|
* Monitor Data offset within RISCV image and size
|
|
*/
|
|
u32 monitorDataOffset;
|
|
u32 monitorDataSize;
|
|
/*
|
|
* Monitor Code offset withtin RISCV image and size
|
|
*/
|
|
u32 monitorCodeOffset;
|
|
u32 monitorCodeSize;
|
|
u32 bIsMonitorEnabled;
|
|
/*
|
|
* Swbrom Code offset within RISCV image and size
|
|
*/
|
|
u32 swbromCodeOffset;
|
|
u32 swbromCodeSize;
|
|
/*
|
|
* Swbrom Data offset within RISCV image and size
|
|
*/
|
|
u32 swbromDataOffset;
|
|
u32 swbromDataSize;
|
|
};
|
|
|
|
struct riscv_image_desc {
|
|
u32 manifest_offset;
|
|
u32 manifest_size;
|
|
u32 data_offset;
|
|
u32 data_size;
|
|
u32 code_offset;
|
|
u32 code_size;
|
|
};
|
|
|
|
struct riscv_data {
|
|
bool valid;
|
|
struct riscv_image_desc desc;
|
|
dma_addr_t backdoor_img_iova;
|
|
u32 *backdoor_img_va;
|
|
size_t backdoor_img_size;
|
|
};
|
|
|
|
int tsec_kickoff_boot(struct platform_device *pdev);
|
|
int tsec_finalize_poweron(struct platform_device *dev);
|
|
int tsec_prepare_poweroff(struct platform_device *dev);
|
|
|
|
#endif /* TSEC_BOOT_H */
|