xref: /freebsd/sys/dev/igc/igc_nvm.h (revision 3750ccefb8629a08890bfbae894dd6bc6a7483b4)
1 /*-
2  * Copyright 2021 Intel Corp
3  * Copyright 2021 Rubicon Communications, LLC (Netgate)
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _IGC_NVM_H_
8 #define _IGC_NVM_H_
9 
10 struct igc_fw_version {
11 	u32 etrack_id;
12 	u16 eep_major;
13 	u16 eep_minor;
14 	u16 eep_build;
15 
16 	u8 invm_major;
17 	u8 invm_minor;
18 	u8 invm_img_type;
19 
20 	bool or_valid;
21 	u16 or_major;
22 	u16 or_build;
23 	u16 or_patch;
24 };
25 
26 void igc_init_nvm_ops_generic(struct igc_hw *hw);
27 s32  igc_null_read_nvm(struct igc_hw *hw, u16 a, u16 b, u16 *c);
28 void igc_null_nvm_generic(struct igc_hw *hw);
29 s32  igc_null_led_default(struct igc_hw *hw, u16 *data);
30 s32  igc_null_write_nvm(struct igc_hw *hw, u16 a, u16 b, u16 *c);
31 s32  igc_acquire_nvm_generic(struct igc_hw *hw);
32 
33 s32  igc_poll_eerd_eewr_done(struct igc_hw *hw, int ee_reg);
34 s32  igc_read_mac_addr_generic(struct igc_hw *hw);
35 s32  igc_read_pba_string_generic(struct igc_hw *hw, u8 *pba_num,
36 				   u32 pba_num_size);
37 s32  igc_read_nvm_eerd(struct igc_hw *hw, u16 offset, u16 words,
38 			 u16 *data);
39 s32  igc_valid_led_default_generic(struct igc_hw *hw, u16 *data);
40 s32  igc_validate_nvm_checksum_generic(struct igc_hw *hw);
41 s32  igc_write_nvm_spi(struct igc_hw *hw, u16 offset, u16 words,
42 			 u16 *data);
43 s32  igc_update_nvm_checksum_generic(struct igc_hw *hw);
44 void igc_release_nvm_generic(struct igc_hw *hw);
45 void igc_get_fw_version(struct igc_hw *hw,
46 			  struct igc_fw_version *fw_vers);
47 
48 #endif
49