From 9c68af58a9d2542e33ced54bdabc35b18f589475 Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Tue, 14 Feb 2017 22:47:29 +0530 Subject: gpu: nvgpu: ACR interface headers reorganization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Moved ACR interface headers from acr_gm20b.h/acr_gp106.h to Its specific header files under “drivers/gpu/nvgpu/include/nvgpu/acr/” Folder. - nvgpu_acr.h - Top-level header-file which include ACR interfaces headers & defines required to communicate with ACR, including this header file is good to get access into ACR interface & made changes accordingly, -Deleted acr.h & acr_t18x.h as not required anymore & removed its include from dependent files. Jira NVGPU-19 Change-Id: Ie404043cfe1ab32404eb63a43831f470d8436324 Signed-off-by: Mahantesh Kumbar Reviewed-on: http://git-master/r/1304748 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gm20b/acr_gm20b.h | 370 +----------------------------------- 1 file changed, 1 insertion(+), 369 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/acr_gm20b.h') diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.h b/drivers/gpu/nvgpu/gm20b/acr_gm20b.h index fb61e366..84478611 100644 --- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.h @@ -1,7 +1,7 @@ /* * GM20B ACR * - * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -15,15 +15,6 @@ #ifndef __ACR_GM20B_H_ #define __ACR_GM20B_H_ -#include "gk20a/gk20a.h" -#include "mm_gm20b.h" - -/*Defines*/ -#define ACR_COMPLETION_TIMEOUT_MS 10000 /*in msec */ - -/*chip specific defines*/ -#define MAX_SUPPORTED_LSFM 3 /*PMU, FECS, GPCCS*/ -#define LSF_UCODE_DATA_ALIGNMENT 4096 #define GM20B_PMU_UCODE_IMAGE "gpmu_ucode_image.bin" #define GM20B_PMU_UCODE_DESC "gpmu_ucode_desc.bin" @@ -33,365 +24,6 @@ #define GM20B_FECS_UCODE_SIG "fecs_sig.bin" #define T18x_GPCCS_UCODE_SIG "gpccs_sig.bin" -#define LSFM_DISABLE_MASK_NONE (0x00000000) /*Disable all LS falcons*/ -#define LSFM_DISABLE_MASK_ALL (0xFFFFFFFF) /*Enable all LS falcons*/ - -#define PMU_SECURE_MODE (0x1) -#define PMU_LSFM_MANAGED (0x2) - -/*ACR load related*/ -/*! - * Supporting maximum of 2 regions. - * This is needed to pre-allocate space in DMEM - */ -#define T210_FLCN_ACR_MAX_REGIONS (2) -#define LSF_BOOTSTRAP_OWNER_RESERVED_DMEM_SIZE (0x200) - -/*! - * Falcon Id Defines - * Defines a common Light Secure Falcon identifier. - */ -#define LSF_FALCON_ID_PMU (0) -#define LSF_FALCON_ID_RESERVED (1) -#define LSF_FALCON_ID_FECS (2) -#define LSF_FALCON_ID_GPCCS (3) -#define LSF_FALCON_ID_END (11) -#define LSF_FALCON_ID_INVALID (0xFFFFFFFF) - -/*! - * Bootstrap Owner Defines - */ -#define LSF_BOOTSTRAP_OWNER_DEFAULT (LSF_FALCON_ID_PMU) - -/*! - * Image Status Defines - */ -#define LSF_IMAGE_STATUS_NONE (0) -#define LSF_IMAGE_STATUS_COPY (1) -#define LSF_IMAGE_STATUS_VALIDATION_CODE_FAILED (2) -#define LSF_IMAGE_STATUS_VALIDATION_DATA_FAILED (3) -#define LSF_IMAGE_STATUS_VALIDATION_DONE (4) -#define LSF_IMAGE_STATUS_VALIDATION_SKIPPED (5) -#define LSF_IMAGE_STATUS_BOOTSTRAP_READY (6) - -/*LSB header related defines*/ -#define NV_FLCN_ACR_LSF_FLAG_LOAD_CODE_AT_0_FALSE 0 -#define NV_FLCN_ACR_LSF_FLAG_LOAD_CODE_AT_0_TRUE 1 -#define NV_FLCN_ACR_LSF_FLAG_DMACTL_REQ_CTX_FALSE 0 -#define NV_FLCN_ACR_LSF_FLAG_DMACTL_REQ_CTX_TRUE 4 -#define NV_FLCN_ACR_LSF_FLAG_FORCE_PRIV_LOAD_TRUE 8 -#define NV_FLCN_ACR_LSF_FLAG_FORCE_PRIV_LOAD_FALSE 0 - -/*! - * Light Secure WPR Content Alignments - */ -#define LSF_LSB_HEADER_ALIGNMENT 256 -#define LSF_BL_DATA_ALIGNMENT 256 -#define LSF_BL_DATA_SIZE_ALIGNMENT 256 -#define LSF_BL_CODE_SIZE_ALIGNMENT 256 - -/*! - * Falcon UCODE header index. - */ -#define FLCN_NL_UCODE_HDR_OS_CODE_OFF_IND (0) -#define FLCN_NL_UCODE_HDR_OS_CODE_SIZE_IND (1) -#define FLCN_NL_UCODE_HDR_OS_DATA_OFF_IND (2) -#define FLCN_NL_UCODE_HDR_OS_DATA_SIZE_IND (3) -#define FLCN_NL_UCODE_HDR_NUM_APPS_IND (4) -/*! - * There are total N number of Apps with code and offset defined in UCODE header - * This macro provides the CODE and DATA offset and size of Ath application. - */ -#define FLCN_NL_UCODE_HDR_APP_CODE_START_IND (5) -#define FLCN_NL_UCODE_HDR_APP_CODE_OFF_IND(N, A) \ - (FLCN_NL_UCODE_HDR_APP_CODE_START_IND + (A*2)) -#define FLCN_NL_UCODE_HDR_APP_CODE_SIZE_IND(N, A) \ - (FLCN_NL_UCODE_HDR_APP_CODE_START_IND + (A*2) + 1) -#define FLCN_NL_UCODE_HDR_APP_CODE_END_IND(N) \ - (FLCN_NL_UCODE_HDR_APP_CODE_START_IND + (N*2) - 1) - -#define FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) \ - (FLCN_NL_UCODE_HDR_APP_CODE_END_IND(N) + 1) -#define FLCN_NL_UCODE_HDR_APP_DATA_OFF_IND(N, A) \ - (FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) + (A*2)) -#define FLCN_NL_UCODE_HDR_APP_DATA_SIZE_IND(N, A) \ - (FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) + (A*2) + 1) -#define FLCN_NL_UCODE_HDR_APP_DATA_END_IND(N) \ - (FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) + (N*2) - 1) - -#define FLCN_NL_UCODE_HDR_OS_OVL_OFF_IND(N) \ - (FLCN_NL_UCODE_HDR_APP_DATA_END_IND(N) + 1) -#define FLCN_NL_UCODE_HDR_OS_OVL_SIZE_IND(N) \ - (FLCN_NL_UCODE_HDR_APP_DATA_END_IND(N) + 2) - -enum acr_capabilities { - ACR_LRF_TEX_LTC_DRAM_PRIV_MASK_ENABLE_LS_OVERRIDE = (0x00000001), -}; - -/*Externs*/ - -/*Structs*/ - -/*! - * Light Secure Falcon Ucode Description Defines - * This stucture is prelim and may change as the ucode signing flow evolves. - */ -struct lsf_ucode_desc { - u8 prd_keys[2][16]; - u8 dbg_keys[2][16]; - u32 b_prd_present; - u32 b_dbg_present; - u32 falcon_id; -}; - -/*! - * Light Secure WPR Header - * Defines state allowing Light Secure Falcon bootstrapping. - * - * falcon_id - LS falcon ID - * lsb_offset - Offset into WPR region holding LSB header - * bootstrap_owner - Bootstrap OWNER (either PMU or SEC2) - * lazy_bootstrap - Skip bootstrapping by ACR - * status - Bootstrapping status - */ -struct lsf_wpr_header { - u32 falcon_id; - u32 lsb_offset; - u32 bootstrap_owner; - u32 lazy_bootstrap; - u32 status; -}; - -struct lsf_lsb_header { - struct lsf_ucode_desc signature; - u32 ucode_off; - u32 ucode_size; - u32 data_size; - u32 bl_code_size; - u32 bl_imem_off; - u32 bl_data_off; - u32 bl_data_size; - u32 app_code_off; - u32 app_code_size; - u32 app_data_off; - u32 app_data_size; - u32 flags; -}; - -/*! - * Structure used by the boot-loader to load the rest of the code. This has - * to be filled by host and copied into DMEM at offset provided in the - * hsflcn_bl_desc.bl_desc_dmem_load_off. - * - * signature - 16B signature for secure code. 0s if no secure code - * ctx_dma - CtxDma to be used by BL while loading code/data - * code_dma_base - 256B aligned Physical FB Address where code is located - * non_sec_code_off - Offset from code_dma_base where the nonSecure code is - * located. The offset must be multiple of 256 to help perf - * non_sec_code_size - The size of the nonSecure code part. - * sec_code_size - Offset from code_dma_base where the secure code is - * located. The offset must be multiple of 256 to help perf - * code_entry_point - Code entry point which will be invoked by BL after - * code is loaded. - * data_dma_base - 256B aligned Physical FB Address where data is located. - * data_size - Size of data block. Should be multiple of 256B - */ -struct flcn_bl_dmem_desc { - u32 reserved[4]; /*Should be the first element..*/ - u32 signature[4]; /*Should be the first element..*/ - u32 ctx_dma; - u32 code_dma_base; - u32 non_sec_code_off; - u32 non_sec_code_size; - u32 sec_code_off; - u32 sec_code_size; - u32 code_entry_point; - u32 data_dma_base; - u32 data_size; - u32 code_dma_base1; - u32 data_dma_base1; -}; - -/*! - * Legacy structure used by the current PMU/DPU bootloader. - */ -struct loader_config { - u32 dma_idx; - u32 code_dma_base; /*