1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018-2021 Beijing WangXun Technology Co., Ltd.
3 * Copyright(c) 2010-2017 Intel Corporation
11 #define NGBE_PMMBX_QSIZE 64 /* Num of dwords in range */
12 #define NGBE_PMMBX_BSIZE (NGBE_PMMBX_QSIZE * 4)
13 #define NGBE_PMMBX_DATA_SIZE (NGBE_PMMBX_BSIZE - FW_NVM_DATA_OFFSET * 4)
14 #define NGBE_HI_COMMAND_TIMEOUT 5000 /* Process HI command limit */
17 #define FW_CEM_MAX_RETRIES 3
18 #define FW_CEM_RESP_STATUS_SUCCESS 0x1
19 #define FW_READ_SHADOW_RAM_CMD 0x31
20 #define FW_READ_SHADOW_RAM_LEN 0x6
21 #define FW_WRITE_SHADOW_RAM_CMD 0x33
22 #define FW_WRITE_SHADOW_RAM_LEN 0xA /* 8 plus 1 WORD to write */
23 #define FW_DEFAULT_CHECKSUM 0xFF /* checksum always 0xFF */
24 #define FW_NVM_DATA_OFFSET 3
25 #define FW_EEPROM_CHECK_STATUS 0xE9
27 #define FW_CHECKSUM_CAP_ST_PASS 0x80658383
28 #define FW_CHECKSUM_CAP_ST_FAIL 0x70657376
30 /* Host Interface Command Structures */
41 struct ngbe_hic_hdr2_req {
48 struct ngbe_hic_hdr2_rsp {
51 u8 ret_status; /* 7-5: high bits of buf_len, 4-0: status */
56 struct ngbe_hic_hdr2_req req;
57 struct ngbe_hic_hdr2_rsp rsp;
60 /* These need to be dword aligned */
61 struct ngbe_hic_read_shadow_ram {
62 union ngbe_hic_hdr2 hdr;
70 struct ngbe_hic_write_shadow_ram {
71 union ngbe_hic_hdr2 hdr;
79 s32 ngbe_hic_sr_read(struct ngbe_hw *hw, u32 addr, u8 *buf, int len);
80 s32 ngbe_hic_sr_write(struct ngbe_hw *hw, u32 addr, u8 *buf, int len);
82 s32 ngbe_hic_check_cap(struct ngbe_hw *hw);
83 #endif /* _NGBE_MNG_H_ */