blob: 89fa373d06ff9bcde8a9c3230db47b41d955778d [file] [log] [blame]
Ye Li0db17f42021-08-07 16:00:41 +08001/* 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 Lif80a41b2021-08-07 16:00:54 +080017#define AHAB_WRITE_SECURE_FUSE_REQ_CID 0x91
Ye Lia61f2672021-08-07 16:00:52 +080018#define AHAB_FWD_LIFECYCLE_UP_REQ_CID 0x95
Ye Lif80a41b2021-08-07 16:00:54 +080019#define AHAB_READ_FUSE_REQ_CID 0x97
Gaurav Jain580cc7b2022-05-11 14:07:55 +053020#define AHAB_GET_FW_VERSION_CID 0x9D
Ye Lif80a41b2021-08-07 16:00:54 +080021#define AHAB_RELEASE_RDC_REQ_CID 0xC4
Peng Fancffe2b92022-07-26 16:40:52 +080022#define AHAB_GET_FW_STATUS_CID 0xC5
Ye Lif80a41b2021-08-07 16:00:54 +080023#define AHAB_WRITE_FUSE_REQ_CID 0xD6
Clement Faure26386ae2022-04-06 14:30:19 +080024#define AHAB_CAAM_RELEASE_CID 0xD7
Peng Fancffe2b92022-07-26 16:40:52 +080025#define AHAB_GET_INFO_CID 0xDA
Ye Li0db17f42021-08-07 16:00:41 +080026
Ye Li0a917da2022-04-06 14:30:20 +080027#define S400_MAX_MSG 255U
Ye Li0db17f42021-08-07 16:00:41 +080028
Ye Lic843d5e2022-07-26 16:40:57 +080029struct sentinel_msg {
Ye Li0db17f42021-08-07 16:00:41 +080030 u8 version;
31 u8 size;
32 u8 command;
33 u8 tag;
34 u32 data[(S400_MAX_MSG - 1U)];
35};
36
Peng Fancffe2b92022-07-26 16:40:52 +080037struct sentinel_get_info_data {
38 u32 hdr;
39 u32 soc;
40 u32 lc;
41 u32 uid[4];
42 u32 sha256_rom_patch[8];
43 u32 sha_fw[8];
44};
45
Ye Lid4b3ba32022-07-26 16:40:51 +080046int ahab_release_rdc(u8 core_id, u8 xrdc, u32 *response);
Ye Lia61f2672021-08-07 16:00:52 +080047int ahab_auth_oem_ctnr(ulong ctnr_addr, u32 *response);
48int ahab_release_container(u32 *response);
49int ahab_verify_image(u32 img_id, u32 *response);
50int ahab_forward_lifecycle(u16 life_cycle, u32 *response);
Ye Lif80a41b2021-08-07 16:00:54 +080051int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response);
52int ahab_read_common_fuse(u16 fuse_id, u32 *fuse_words, u32 fuse_num, u32 *response);
Clement Faure26386ae2022-04-06 14:30:19 +080053int ahab_release_caam(u32 core_did, u32 *response);
Gaurav Jain580cc7b2022-05-11 14:07:55 +053054int ahab_get_fw_version(u32 *fw_version, u32 *sha1, u32 *response);
Ye Li0a917da2022-04-06 14:30:20 +080055int ahab_dump_buffer(u32 *buffer, u32 buffer_length);
Peng Fancffe2b92022-07-26 16:40:52 +080056int ahab_get_info(struct sentinel_get_info_data *info, u32 *response);
57int ahab_get_fw_status(u32 *status, u32 *response);
Peng Fanf6ff1402022-07-26 16:40:53 +080058int ahab_release_m33_trout(void);
Ye Lia61f2672021-08-07 16:00:52 +080059
Ye Li0db17f42021-08-07 16:00:41 +080060#endif