1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright 2019 Broadcom.
4  */
5 
6 #ifndef BNXT_H
7 #define BNXT_H
8 
9 #include <compiler.h>
10 #include <io.h>
11 #include <mm/core_memprot.h>
12 #include <util.h>
13 
14 #define BNXT_SUCCESS       0
15 #define BNXT_FAILURE       (!BNXT_SUCCESS)
16 
17 uint32_t bnxt_write32_multiple(uintptr_t dst,
18 			       uintptr_t src,
19 			       uint32_t num_entries,
20 			       int src_4byte_increment);
21 void bnxt_handshake_clear(void);
22 void bnxt_chimp_halt(void);
23 void bnxt_kong_halt(void);
24 int bnxt_fastboot(uintptr_t addr);
25 uint32_t bnxt_wait_handshake(uint32_t timeout);
26 uint32_t bnxt_health_status(void);
27 TEE_Result bnxt_load_fw(int chip_type);
28 TEE_Result bnxt_copy_crash_dump(uint8_t *d, uint32_t offset, uint32_t len);
29 
30 struct bnxt_images_info {
31 	vaddr_t bnxt_fw_vaddr;
32 	uint32_t bnxt_fw_len;
33 	vaddr_t bnxt_cfg_vaddr;
34 	uint32_t bnxt_cfg_len;
35 	vaddr_t bnxt_bspd_cfg_vaddr;
36 	uint32_t bnxt_bspd_cfg_len;
37 };
38 
39 /* Reserve 1K for BSPD data */
40 #define BNXT_IMG_SECMEM_OFFSET	0x400
41 
42 int get_bnxt_images_info(struct bnxt_images_info *bnxt_info,
43 			 int chip_type, vaddr_t ddr_dest);
44 
45 #endif
46