Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2020 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  */
0023 
0024 #ifndef _TA_RAP_IF_H
0025 #define _TA_RAP_IF_H
0026 
0027 /* Responses have bit 31 set */
0028 #define RSP_ID_MASK (1U << 31)
0029 #define RSP_ID(cmdId) (((uint32_t)(cmdId)) | RSP_ID_MASK)
0030 
0031 enum ta_rap_status {
0032     TA_RAP_STATUS__SUCCESS                              = 1,
0033     TA_RAP_STATUS__ERROR_GENERIC_FAILURE                = 2,
0034     TA_RAP_STATUS__ERROR_CMD_NOT_SUPPORTED              = 3,
0035     TA_RAP_STATUS__ERROR_INVALID_VALIDATION_METHOD      = 4,
0036     TA_RAP_STATUS__ERROR_NULL_POINTER                   = 5,
0037     TA_RAP_STATUS__ERROR_NOT_INITIALIZED                = 6,
0038     TA_RAP_STATUS__ERROR_VALIDATION_FAILED              = 7,
0039     TA_RAP_STATUS__ERROR_ASIC_NOT_SUPPORTED             = 8,
0040     TA_RAP_STATUS__ERROR_OPERATION_NOT_PERMISSABLE      = 9,
0041     TA_RAP_STATUS__ERROR_ALREADY_INIT                   = 10,
0042 };
0043 
0044 enum ta_rap_cmd {
0045     TA_CMD_RAP__INITIALIZE              = 1,
0046     TA_CMD_RAP__VALIDATE_L0             = 2,
0047 };
0048 
0049 enum ta_rap_validation_method {
0050     METHOD_A           = 1,
0051 };
0052 
0053 struct ta_rap_cmd_input_data {
0054     uint8_t reserved[8];
0055 };
0056 
0057 struct ta_rap_cmd_output_data {
0058     uint32_t    last_subsection;
0059     uint32_t    num_total_validate;
0060     uint32_t    num_valid;
0061     uint32_t    last_validate_addr;
0062     uint32_t    last_validate_val;
0063     uint32_t    last_validate_val_exptd;
0064 };
0065 
0066 union ta_rap_cmd_input {
0067     struct ta_rap_cmd_input_data input;
0068 };
0069 
0070 union ta_rap_cmd_output {
0071     struct ta_rap_cmd_output_data output;
0072 };
0073 
0074 struct ta_rap_shared_memory {
0075     uint32_t                    cmd_id;
0076     uint32_t                    validation_method_id;
0077     uint32_t                    resp_id;
0078     enum ta_rap_status          rap_status;
0079     union ta_rap_cmd_input      rap_in_message;
0080     union ta_rap_cmd_output     rap_out_message;
0081     uint8_t                     reserved[64];
0082 };
0083 
0084 #endif  // #define _TA_RAP_IF_H