e1000_nvm.c (169248) | e1000_nvm.c (169589) |
---|---|
1/******************************************************************************* 2 3 Copyright (c) 2001-2007, Intel Corporation 4 All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without 7 modification, are permitted provided that the following conditions are met: 8 --- 16 unchanged lines hidden (view full) --- 25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 POSSIBILITY OF SUCH DAMAGE. 31 32*******************************************************************************/ | 1/******************************************************************************* 2 3 Copyright (c) 2001-2007, Intel Corporation 4 All rights reserved. 5 6 Redistribution and use in source and binary forms, with or without 7 modification, are permitted provided that the following conditions are met: 8 --- 16 unchanged lines hidden (view full) --- 25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 POSSIBILITY OF SUCH DAMAGE. 31 32*******************************************************************************/ |
33/*$FreeBSD: head/sys/dev/em/e1000_nvm.c 169589 2007-05-16 00:14:23Z jfv $*/ |
|
33 | 34 |
34#include <sys/cdefs.h> 35__FBSDID("$FreeBSD: head/sys/dev/em/e1000_nvm.c 169248 2007-05-04 13:30:44Z rwatson $"); | |
36 | 35 |
37 | 36#include "e1000_api.h" |
38#include "e1000_nvm.h" 39 40/** 41 * e1000_raise_eec_clk - Raise EEPROM clock | 37#include "e1000_nvm.h" 38 39/** 40 * e1000_raise_eec_clk - Raise EEPROM clock |
42 * @hw - pointer to the HW structure 43 * @eecd - pointer to the EEPROM | 41 * @hw: pointer to the HW structure 42 * @eecd: pointer to the EEPROM |
44 * 45 * Enable/Raise the EEPROM clock bit. 46 **/ 47static void 48e1000_raise_eec_clk(struct e1000_hw *hw, u32 *eecd) 49{ 50 *eecd = *eecd | E1000_EECD_SK; 51 E1000_WRITE_REG(hw, E1000_EECD, *eecd); 52 E1000_WRITE_FLUSH(hw); 53 usec_delay(hw->nvm.delay_usec); 54} 55 56/** 57 * e1000_lower_eec_clk - Lower EEPROM clock | 43 * 44 * Enable/Raise the EEPROM clock bit. 45 **/ 46static void 47e1000_raise_eec_clk(struct e1000_hw *hw, u32 *eecd) 48{ 49 *eecd = *eecd | E1000_EECD_SK; 50 E1000_WRITE_REG(hw, E1000_EECD, *eecd); 51 E1000_WRITE_FLUSH(hw); 52 usec_delay(hw->nvm.delay_usec); 53} 54 55/** 56 * e1000_lower_eec_clk - Lower EEPROM clock |
58 * @hw - pointer to the HW structure 59 * @eecd - pointer to the EEPROM | 57 * @hw: pointer to the HW structure 58 * @eecd: pointer to the EEPROM |
60 * 61 * Clear/Lower the EEPROM clock bit. 62 **/ 63static void 64e1000_lower_eec_clk(struct e1000_hw *hw, u32 *eecd) 65{ 66 *eecd = *eecd & ~E1000_EECD_SK; 67 E1000_WRITE_REG(hw, E1000_EECD, *eecd); 68 E1000_WRITE_FLUSH(hw); 69 usec_delay(hw->nvm.delay_usec); 70} 71 72/** 73 * e1000_shift_out_eec_bits - Shift data bits our to the EEPROM | 59 * 60 * Clear/Lower the EEPROM clock bit. 61 **/ 62static void 63e1000_lower_eec_clk(struct e1000_hw *hw, u32 *eecd) 64{ 65 *eecd = *eecd & ~E1000_EECD_SK; 66 E1000_WRITE_REG(hw, E1000_EECD, *eecd); 67 E1000_WRITE_FLUSH(hw); 68 usec_delay(hw->nvm.delay_usec); 69} 70 71/** 72 * e1000_shift_out_eec_bits - Shift data bits our to the EEPROM |
74 * @hw - pointer to the HW structure 75 * @data - data to send to the EEPROM 76 * @count - number of bits to shift out | 73 * @hw: pointer to the HW structure 74 * @data: data to send to the EEPROM 75 * @count: number of bits to shift out |
77 * 78 * We need to shift 'count' bits out to the EEPROM. So, the value in the 79 * "data" parameter will be shifted out to the EEPROM one bit at a time. 80 * In order to do this, "data" must be broken down into bits. 81 **/ 82static void 83e1000_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count) 84{ --- 27 unchanged lines hidden (view full) --- 112 } while (mask); 113 114 eecd &= ~E1000_EECD_DI; 115 E1000_WRITE_REG(hw, E1000_EECD, eecd); 116} 117 118/** 119 * e1000_shift_in_eec_bits - Shift data bits in from the EEPROM | 76 * 77 * We need to shift 'count' bits out to the EEPROM. So, the value in the 78 * "data" parameter will be shifted out to the EEPROM one bit at a time. 79 * In order to do this, "data" must be broken down into bits. 80 **/ 81static void 82e1000_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count) 83{ --- 27 unchanged lines hidden (view full) --- 111 } while (mask); 112 113 eecd &= ~E1000_EECD_DI; 114 E1000_WRITE_REG(hw, E1000_EECD, eecd); 115} 116 117/** 118 * e1000_shift_in_eec_bits - Shift data bits in from the EEPROM |
120 * @hw - pointer to the HW structure 121 * @count - number of bits to shift in | 119 * @hw: pointer to the HW structure 120 * @count: number of bits to shift in |
122 * 123 * In order to read a register from the EEPROM, we need to shift 'count' bits 124 * in from the EEPROM. Bits are "shifted in" by raising the clock input to 125 * the EEPROM (setting the SK bit), and then reading the value of the data out 126 * "DO" bit. During this "shifting in" process the data in "DI" bit should 127 * always be clear. 128 **/ 129static u16 --- 23 unchanged lines hidden (view full) --- 153 e1000_lower_eec_clk(hw, &eecd); 154 } 155 156 return data; 157} 158 159/** 160 * e1000_poll_eerd_eewr_done - Poll for EEPROM read/write completion | 121 * 122 * In order to read a register from the EEPROM, we need to shift 'count' bits 123 * in from the EEPROM. Bits are "shifted in" by raising the clock input to 124 * the EEPROM (setting the SK bit), and then reading the value of the data out 125 * "DO" bit. During this "shifting in" process the data in "DI" bit should 126 * always be clear. 127 **/ 128static u16 --- 23 unchanged lines hidden (view full) --- 152 e1000_lower_eec_clk(hw, &eecd); 153 } 154 155 return data; 156} 157 158/** 159 * e1000_poll_eerd_eewr_done - Poll for EEPROM read/write completion |
161 * @hw - pointer to the HW structure 162 * @ee_reg - EEPROM flag for polling | 160 * @hw: pointer to the HW structure 161 * @ee_reg: EEPROM flag for polling |
163 * 164 * Polls the EEPROM status bit for either read or write completion based 165 * upon the value of 'ee_reg'. 166 **/ 167s32 168e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg) 169{ 170 u32 attempts = 100000; --- 16 unchanged lines hidden (view full) --- 187 usec_delay(5); 188 } 189 190 return ret_val; 191} 192 193/** 194 * e1000_acquire_nvm_generic - Generic request for access to EEPROM | 162 * 163 * Polls the EEPROM status bit for either read or write completion based 164 * upon the value of 'ee_reg'. 165 **/ 166s32 167e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg) 168{ 169 u32 attempts = 100000; --- 16 unchanged lines hidden (view full) --- 186 usec_delay(5); 187 } 188 189 return ret_val; 190} 191 192/** 193 * e1000_acquire_nvm_generic - Generic request for access to EEPROM |
195 * @hw - pointer to the HW structure | 194 * @hw: pointer to the HW structure |
196 * 197 * Set the EEPROM access request bit and wait for EEPROM access grant bit. 198 * Return successful if access grant bit set, else clear the request for 199 * EEPROM access and return -E1000_ERR_NVM (-1). 200 **/ 201s32 202e1000_acquire_nvm_generic(struct e1000_hw *hw) 203{ --- 21 unchanged lines hidden (view full) --- 225 ret_val = -E1000_ERR_NVM; 226 } 227 228 return ret_val; 229} 230 231/** 232 * e1000_standby_nvm - Return EEPROM to standby state | 195 * 196 * Set the EEPROM access request bit and wait for EEPROM access grant bit. 197 * Return successful if access grant bit set, else clear the request for 198 * EEPROM access and return -E1000_ERR_NVM (-1). 199 **/ 200s32 201e1000_acquire_nvm_generic(struct e1000_hw *hw) 202{ --- 21 unchanged lines hidden (view full) --- 224 ret_val = -E1000_ERR_NVM; 225 } 226 227 return ret_val; 228} 229 230/** 231 * e1000_standby_nvm - Return EEPROM to standby state |
233 * @hw - pointer to the HW structure | 232 * @hw: pointer to the HW structure |
234 * 235 * Return the EEPROM to a standby state. 236 **/ 237static void 238e1000_standby_nvm(struct e1000_hw *hw) 239{ 240 struct e1000_nvm_info *nvm = &hw->nvm; 241 u32 eecd = E1000_READ_REG(hw, E1000_EECD); --- 25 unchanged lines hidden (view full) --- 267 E1000_WRITE_REG(hw, E1000_EECD, eecd); 268 E1000_WRITE_FLUSH(hw); 269 usec_delay(nvm->delay_usec); 270 } 271} 272 273/** 274 * e1000_stop_nvm - Terminate EEPROM command | 233 * 234 * Return the EEPROM to a standby state. 235 **/ 236static void 237e1000_standby_nvm(struct e1000_hw *hw) 238{ 239 struct e1000_nvm_info *nvm = &hw->nvm; 240 u32 eecd = E1000_READ_REG(hw, E1000_EECD); --- 25 unchanged lines hidden (view full) --- 266 E1000_WRITE_REG(hw, E1000_EECD, eecd); 267 E1000_WRITE_FLUSH(hw); 268 usec_delay(nvm->delay_usec); 269 } 270} 271 272/** 273 * e1000_stop_nvm - Terminate EEPROM command |
275 * @hw - pointer to the HW structure | 274 * @hw: pointer to the HW structure |
276 * 277 * Terminates the current command by inverting the EEPROM's chip select pin. 278 **/ 279void 280e1000_stop_nvm(struct e1000_hw *hw) 281{ 282 u32 eecd; 283 --- 10 unchanged lines hidden (view full) --- 294 E1000_WRITE_REG(hw, E1000_EECD, eecd); 295 e1000_raise_eec_clk(hw, &eecd); 296 e1000_lower_eec_clk(hw, &eecd); 297 } 298} 299 300/** 301 * e1000_release_nvm_generic - Release exclusive access to EEPROM | 275 * 276 * Terminates the current command by inverting the EEPROM's chip select pin. 277 **/ 278void 279e1000_stop_nvm(struct e1000_hw *hw) 280{ 281 u32 eecd; 282 --- 10 unchanged lines hidden (view full) --- 293 E1000_WRITE_REG(hw, E1000_EECD, eecd); 294 e1000_raise_eec_clk(hw, &eecd); 295 e1000_lower_eec_clk(hw, &eecd); 296 } 297} 298 299/** 300 * e1000_release_nvm_generic - Release exclusive access to EEPROM |
302 * @hw - pointer to the HW structure | 301 * @hw: pointer to the HW structure |
303 * 304 * Stop any current commands to the EEPROM and clear the EEPROM request bit. 305 **/ 306void 307e1000_release_nvm_generic(struct e1000_hw *hw) 308{ 309 u32 eecd; 310 311 DEBUGFUNC("e1000_release_nvm_generic"); 312 313 e1000_stop_nvm(hw); 314 315 eecd = E1000_READ_REG(hw, E1000_EECD); 316 eecd &= ~E1000_EECD_REQ; 317 E1000_WRITE_REG(hw, E1000_EECD, eecd); 318} 319 320/** 321 * e1000_ready_nvm_eeprom - Prepares EEPROM for read/write | 302 * 303 * Stop any current commands to the EEPROM and clear the EEPROM request bit. 304 **/ 305void 306e1000_release_nvm_generic(struct e1000_hw *hw) 307{ 308 u32 eecd; 309 310 DEBUGFUNC("e1000_release_nvm_generic"); 311 312 e1000_stop_nvm(hw); 313 314 eecd = E1000_READ_REG(hw, E1000_EECD); 315 eecd &= ~E1000_EECD_REQ; 316 E1000_WRITE_REG(hw, E1000_EECD, eecd); 317} 318 319/** 320 * e1000_ready_nvm_eeprom - Prepares EEPROM for read/write |
322 * @hw - pointer to the HW structure | 321 * @hw: pointer to the HW structure |
323 * 324 * Setups the EEPROM for reading and writing. 325 **/ 326static s32 327e1000_ready_nvm_eeprom(struct e1000_hw *hw) 328{ 329 struct e1000_nvm_info *nvm = &hw->nvm; 330 u32 eecd = E1000_READ_REG(hw, E1000_EECD); --- 41 unchanged lines hidden (view full) --- 372 } 373 374out: 375 return ret_val; 376} 377 378/** 379 * e1000_read_nvm_spi - Read EEPROM's using SPI | 322 * 323 * Setups the EEPROM for reading and writing. 324 **/ 325static s32 326e1000_ready_nvm_eeprom(struct e1000_hw *hw) 327{ 328 struct e1000_nvm_info *nvm = &hw->nvm; 329 u32 eecd = E1000_READ_REG(hw, E1000_EECD); --- 41 unchanged lines hidden (view full) --- 371 } 372 373out: 374 return ret_val; 375} 376 377/** 378 * e1000_read_nvm_spi - Read EEPROM's using SPI |
380 * @hw - pointer to the HW structure 381 * @offset - offset of word in the EEPROM to read 382 * @words - number of words to read 383 * @data - word read from the EEPROM | 379 * @hw: pointer to the HW structure 380 * @offset: offset of word in the EEPROM to read 381 * @words: number of words to read 382 * @data: word read from the EEPROM |
384 * 385 * Reads a 16 bit word from the EEPROM. 386 **/ 387s32 388e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) 389{ 390 struct e1000_nvm_info *nvm = &hw->nvm; 391 u32 i = 0; --- 41 unchanged lines hidden (view full) --- 433 e1000_release_nvm(hw); 434 435out: 436 return ret_val; 437} 438 439/** 440 * e1000_read_nvm_microwire - Reads EEPROM's using microwire | 383 * 384 * Reads a 16 bit word from the EEPROM. 385 **/ 386s32 387e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) 388{ 389 struct e1000_nvm_info *nvm = &hw->nvm; 390 u32 i = 0; --- 41 unchanged lines hidden (view full) --- 432 e1000_release_nvm(hw); 433 434out: 435 return ret_val; 436} 437 438/** 439 * e1000_read_nvm_microwire - Reads EEPROM's using microwire |
441 * @hw - pointer to the HW structure 442 * @offset - offset of word in the EEPROM to read 443 * @words - number of words to read 444 * @data - word read from the EEPROM | 440 * @hw: pointer to the HW structure 441 * @offset: offset of word in the EEPROM to read 442 * @words: number of words to read 443 * @data: word read from the EEPROM |
445 * 446 * Reads a 16 bit word from the EEPROM. 447 **/ 448s32 449e1000_read_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) 450{ 451 struct e1000_nvm_info *nvm = &hw->nvm; 452 u32 i = 0; --- 35 unchanged lines hidden (view full) --- 488 e1000_release_nvm(hw); 489 490out: 491 return ret_val; 492} 493 494/** 495 * e1000_read_nvm_eerd - Reads EEPROM using EERD register | 444 * 445 * Reads a 16 bit word from the EEPROM. 446 **/ 447s32 448e1000_read_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) 449{ 450 struct e1000_nvm_info *nvm = &hw->nvm; 451 u32 i = 0; --- 35 unchanged lines hidden (view full) --- 487 e1000_release_nvm(hw); 488 489out: 490 return ret_val; 491} 492 493/** 494 * e1000_read_nvm_eerd - Reads EEPROM using EERD register |
496 * @hw - pointer to the HW structure 497 * @offset - offset of word in the EEPROM to read 498 * @words - number of words to read 499 * @data - word read from the EEPROM | 495 * @hw: pointer to the HW structure 496 * @offset: offset of word in the EEPROM to read 497 * @words: number of words to read 498 * @data: word read from the EEPROM |
500 * 501 * Reads a 16 bit word from the EEPROM using the EERD register. 502 **/ 503s32 504e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) 505{ 506 struct e1000_nvm_info *nvm = &hw->nvm; 507 u32 i, eerd = 0; --- 23 unchanged lines hidden (view full) --- 531 } 532 533out: 534 return ret_val; 535} 536 537/** 538 * e1000_write_nvm_spi - Write to EEPROM using SPI | 499 * 500 * Reads a 16 bit word from the EEPROM using the EERD register. 501 **/ 502s32 503e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) 504{ 505 struct e1000_nvm_info *nvm = &hw->nvm; 506 u32 i, eerd = 0; --- 23 unchanged lines hidden (view full) --- 530 } 531 532out: 533 return ret_val; 534} 535 536/** 537 * e1000_write_nvm_spi - Write to EEPROM using SPI |
539 * @hw - pointer to the HW structure 540 * @offset - offset within the EEPROM to be written to 541 * @words - number of words to write 542 * @data - 16 bit word(s) to be written to the EEPROM | 538 * @hw: pointer to the HW structure 539 * @offset: offset within the EEPROM to be written to 540 * @words: number of words to write 541 * @data: 16 bit word(s) to be written to the EEPROM |
543 * 544 * Writes data to EEPROM at offset using SPI interface. 545 * 546 * If e1000_update_nvm_checksum is not called after this function , the 547 * EEPROM will most likley contain an invalid checksum. 548 **/ 549s32 550e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) --- 63 unchanged lines hidden (view full) --- 614 e1000_release_nvm(hw); 615 616out: 617 return ret_val; 618} 619 620/** 621 * e1000_write_nvm_microwire - Writes EEPROM using microwire | 542 * 543 * Writes data to EEPROM at offset using SPI interface. 544 * 545 * If e1000_update_nvm_checksum is not called after this function , the 546 * EEPROM will most likley contain an invalid checksum. 547 **/ 548s32 549e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) --- 63 unchanged lines hidden (view full) --- 613 e1000_release_nvm(hw); 614 615out: 616 return ret_val; 617} 618 619/** 620 * e1000_write_nvm_microwire - Writes EEPROM using microwire |
622 * @hw - pointer to the HW structure 623 * @offset - offset within the EEPROM to be written to 624 * @words - number of words to write 625 * @data - 16 bit word(s) to be written to the EEPROM | 621 * @hw: pointer to the HW structure 622 * @offset: offset within the EEPROM to be written to 623 * @words: number of words to write 624 * @data: 16 bit word(s) to be written to the EEPROM |
626 * 627 * Writes data to EEPROM at offset using microwire interface. 628 * 629 * If e1000_update_nvm_checksum is not called after this function , the 630 * EEPROM will most likley contain an invalid checksum. 631 **/ 632s32 633e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) --- 68 unchanged lines hidden (view full) --- 702 e1000_release_nvm(hw); 703 704out: 705 return ret_val; 706} 707 708/** 709 * e1000_read_part_num_generic - Read device part number | 625 * 626 * Writes data to EEPROM at offset using microwire interface. 627 * 628 * If e1000_update_nvm_checksum is not called after this function , the 629 * EEPROM will most likley contain an invalid checksum. 630 **/ 631s32 632e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) --- 68 unchanged lines hidden (view full) --- 701 e1000_release_nvm(hw); 702 703out: 704 return ret_val; 705} 706 707/** 708 * e1000_read_part_num_generic - Read device part number |
710 * @hw - pointer to the HW structure 711 * @part_num - pointer to device part number | 709 * @hw: pointer to the HW structure 710 * @part_num: pointer to device part number |
712 * 713 * Reads the product board assembly (PBA) number from the EEPROM and stores 714 * the value in part_num. 715 **/ 716s32 717e1000_read_part_num_generic(struct e1000_hw *hw, u32 *part_num) 718{ 719 s32 ret_val; --- 16 unchanged lines hidden (view full) --- 736 *part_num |= nvm_data; 737 738out: 739 return ret_val; 740} 741 742/** 743 * e1000_read_mac_addr_generic - Read device MAC address | 711 * 712 * Reads the product board assembly (PBA) number from the EEPROM and stores 713 * the value in part_num. 714 **/ 715s32 716e1000_read_part_num_generic(struct e1000_hw *hw, u32 *part_num) 717{ 718 s32 ret_val; --- 16 unchanged lines hidden (view full) --- 735 *part_num |= nvm_data; 736 737out: 738 return ret_val; 739} 740 741/** 742 * e1000_read_mac_addr_generic - Read device MAC address |
744 * @hw - pointer to the HW structure | 743 * @hw: pointer to the HW structure |
745 * 746 * Reads the device MAC address from the EEPROM and stores the value. 747 * Since devices with two ports use the same EEPROM, we increment the 748 * last bit in the MAC address for the second port. 749 **/ 750s32 751e1000_read_mac_addr_generic(struct e1000_hw *hw) 752{ --- 21 unchanged lines hidden (view full) --- 774 hw->mac.addr[i] = hw->mac.perm_addr[i]; 775 776out: 777 return ret_val; 778} 779 780/** 781 * e1000_validate_nvm_checksum_generic - Validate EEPROM checksum | 744 * 745 * Reads the device MAC address from the EEPROM and stores the value. 746 * Since devices with two ports use the same EEPROM, we increment the 747 * last bit in the MAC address for the second port. 748 **/ 749s32 750e1000_read_mac_addr_generic(struct e1000_hw *hw) 751{ --- 21 unchanged lines hidden (view full) --- 773 hw->mac.addr[i] = hw->mac.perm_addr[i]; 774 775out: 776 return ret_val; 777} 778 779/** 780 * e1000_validate_nvm_checksum_generic - Validate EEPROM checksum |
782 * @hw - pointer to the HW structure | 781 * @hw: pointer to the HW structure |
783 * 784 * Calculates the EEPROM checksum by reading/adding each word of the EEPROM 785 * and then verifies that the sum of the EEPROM is equal to 0xBABA. 786 **/ 787s32 788e1000_validate_nvm_checksum_generic(struct e1000_hw *hw) 789{ 790 s32 ret_val = E1000_SUCCESS; --- 18 unchanged lines hidden (view full) --- 809 } 810 811out: 812 return ret_val; 813} 814 815/** 816 * e1000_update_nvm_checksum_generic - Update EEPROM checksum | 782 * 783 * Calculates the EEPROM checksum by reading/adding each word of the EEPROM 784 * and then verifies that the sum of the EEPROM is equal to 0xBABA. 785 **/ 786s32 787e1000_validate_nvm_checksum_generic(struct e1000_hw *hw) 788{ 789 s32 ret_val = E1000_SUCCESS; --- 18 unchanged lines hidden (view full) --- 808 } 809 810out: 811 return ret_val; 812} 813 814/** 815 * e1000_update_nvm_checksum_generic - Update EEPROM checksum |
817 * @hw - pointer to the HW structure | 816 * @hw: pointer to the HW structure |
818 * 819 * Updates the EEPROM checksum by reading/adding each word of the EEPROM 820 * up to the checksum. Then calculates the EEPROM checksum and writes the 821 * value to the EEPROM. 822 **/ 823s32 824e1000_update_nvm_checksum_generic(struct e1000_hw *hw) 825{ --- 18 unchanged lines hidden (view full) --- 844 } 845 846out: 847 return ret_val; 848} 849 850/** 851 * e1000_reload_nvm_generic - Reloads EEPROM | 817 * 818 * Updates the EEPROM checksum by reading/adding each word of the EEPROM 819 * up to the checksum. Then calculates the EEPROM checksum and writes the 820 * value to the EEPROM. 821 **/ 822s32 823e1000_update_nvm_checksum_generic(struct e1000_hw *hw) 824{ --- 18 unchanged lines hidden (view full) --- 843 } 844 845out: 846 return ret_val; 847} 848 849/** 850 * e1000_reload_nvm_generic - Reloads EEPROM |
852 * @hw - pointer to the HW structure | 851 * @hw: pointer to the HW structure |
853 * 854 * Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the 855 * extended control register. 856 **/ 857void 858e1000_reload_nvm_generic(struct e1000_hw *hw) 859{ 860 u32 ctrl_ext; --- 6 unchanged lines hidden (view full) --- 867 E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); 868 E1000_WRITE_FLUSH(hw); 869} 870 871/* Function pointers local to this file and not intended for public use */ 872 873/** 874 * e1000_acquire_nvm - Acquire exclusive access to EEPROM | 852 * 853 * Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the 854 * extended control register. 855 **/ 856void 857e1000_reload_nvm_generic(struct e1000_hw *hw) 858{ 859 u32 ctrl_ext; --- 6 unchanged lines hidden (view full) --- 866 E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); 867 E1000_WRITE_FLUSH(hw); 868} 869 870/* Function pointers local to this file and not intended for public use */ 871 872/** 873 * e1000_acquire_nvm - Acquire exclusive access to EEPROM |
875 * @hw - pointer to the HW structure | 874 * @hw: pointer to the HW structure |
876 * 877 * For those silicon families which have implemented a NVM acquire function, 878 * run the defined function else return success. 879 **/ 880s32 881e1000_acquire_nvm(struct e1000_hw *hw) 882{ 883 if (hw->func.acquire_nvm != NULL) 884 return hw->func.acquire_nvm(hw); 885 else 886 return E1000_SUCCESS; 887} 888 889/** 890 * e1000_release_nvm - Release exclusive access to EEPROM | 875 * 876 * For those silicon families which have implemented a NVM acquire function, 877 * run the defined function else return success. 878 **/ 879s32 880e1000_acquire_nvm(struct e1000_hw *hw) 881{ 882 if (hw->func.acquire_nvm != NULL) 883 return hw->func.acquire_nvm(hw); 884 else 885 return E1000_SUCCESS; 886} 887 888/** 889 * e1000_release_nvm - Release exclusive access to EEPROM |
891 * @hw - pointer to the HW structure | 890 * @hw: pointer to the HW structure |
892 * 893 * For those silicon families which have implemented a NVM release function, 894 * run the defined fucntion else return success. 895 **/ 896void 897e1000_release_nvm(struct e1000_hw *hw) 898{ 899 if (hw->func.release_nvm != NULL) 900 hw->func.release_nvm(hw); 901} 902 | 891 * 892 * For those silicon families which have implemented a NVM release function, 893 * run the defined fucntion else return success. 894 **/ 895void 896e1000_release_nvm(struct e1000_hw *hw) 897{ 898 if (hw->func.release_nvm != NULL) 899 hw->func.release_nvm(hw); 900} 901 |