Ye Li | 0db17f4 | 2021-08-07 16:00:41 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright 2021 NXP |
| 4 | */ |
| 5 | |
| 6 | #ifndef __S400_API_H__ |
| 7 | #define __S400_API_H__ |
| 8 | |
| 9 | #define AHAB_VERSION 0x6 |
| 10 | #define AHAB_CMD_TAG 0x17 |
| 11 | #define AHAB_RESP_TAG 0xe1 |
| 12 | |
| 13 | #define AHAB_LOG_CID 0x21 |
| 14 | #define AHAB_AUTH_OEM_CTNR_CID 0x87 |
| 15 | #define AHAB_VERIFY_IMG_CID 0x88 |
| 16 | #define AHAB_RELEASE_CTNR_CID 0x89 |
Ye Li | f80a41b | 2021-08-07 16:00:54 +0800 | [diff] [blame] | 17 | #define AHAB_WRITE_SECURE_FUSE_REQ_CID 0x91 |
Ye Li | a61f267 | 2021-08-07 16:00:52 +0800 | [diff] [blame] | 18 | #define AHAB_FWD_LIFECYCLE_UP_REQ_CID 0x95 |
Ye Li | f80a41b | 2021-08-07 16:00:54 +0800 | [diff] [blame] | 19 | #define AHAB_READ_FUSE_REQ_CID 0x97 |
Gaurav Jain | 580cc7b | 2022-05-11 14:07:55 +0530 | [diff] [blame^] | 20 | #define AHAB_GET_FW_VERSION_CID 0x9D |
Ye Li | f80a41b | 2021-08-07 16:00:54 +0800 | [diff] [blame] | 21 | #define AHAB_RELEASE_RDC_REQ_CID 0xC4 |
| 22 | #define AHAB_WRITE_FUSE_REQ_CID 0xD6 |
Clement Faure | 26386ae | 2022-04-06 14:30:19 +0800 | [diff] [blame] | 23 | #define AHAB_CAAM_RELEASE_CID 0xD7 |
Ye Li | 0db17f4 | 2021-08-07 16:00:41 +0800 | [diff] [blame] | 24 | |
Ye Li | 0a917da | 2022-04-06 14:30:20 +0800 | [diff] [blame] | 25 | #define S400_MAX_MSG 255U |
Ye Li | 0db17f4 | 2021-08-07 16:00:41 +0800 | [diff] [blame] | 26 | |
| 27 | struct imx8ulp_s400_msg { |
| 28 | u8 version; |
| 29 | u8 size; |
| 30 | u8 command; |
| 31 | u8 tag; |
| 32 | u32 data[(S400_MAX_MSG - 1U)]; |
| 33 | }; |
| 34 | |
Ye Li | acc9afe | 2021-08-07 16:00:53 +0800 | [diff] [blame] | 35 | int ahab_release_rdc(u8 core_id, bool xrdc, u32 *response); |
Ye Li | a61f267 | 2021-08-07 16:00:52 +0800 | [diff] [blame] | 36 | int ahab_auth_oem_ctnr(ulong ctnr_addr, u32 *response); |
| 37 | int ahab_release_container(u32 *response); |
| 38 | int ahab_verify_image(u32 img_id, u32 *response); |
| 39 | int ahab_forward_lifecycle(u16 life_cycle, u32 *response); |
Ye Li | f80a41b | 2021-08-07 16:00:54 +0800 | [diff] [blame] | 40 | int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response); |
| 41 | int ahab_read_common_fuse(u16 fuse_id, u32 *fuse_words, u32 fuse_num, u32 *response); |
Clement Faure | 26386ae | 2022-04-06 14:30:19 +0800 | [diff] [blame] | 42 | int ahab_release_caam(u32 core_did, u32 *response); |
Gaurav Jain | 580cc7b | 2022-05-11 14:07:55 +0530 | [diff] [blame^] | 43 | int ahab_get_fw_version(u32 *fw_version, u32 *sha1, u32 *response); |
Ye Li | 0a917da | 2022-04-06 14:30:20 +0800 | [diff] [blame] | 44 | int ahab_dump_buffer(u32 *buffer, u32 buffer_length); |
Ye Li | a61f267 | 2021-08-07 16:00:52 +0800 | [diff] [blame] | 45 | |
Ye Li | 0db17f4 | 2021-08-07 16:00:41 +0800 | [diff] [blame] | 46 | #endif |