src/dpdk/drivers/net/ixgbe/base/ixgbe_x540.c
s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw)
{
	u32 flup;
	s32 status;

	DEBUGFUNC("ixgbe_update_flash_X540");

	status = ixgbe_poll_flash_update_done_X540(hw);
	if (status == IXGBE_ERR_EEPROM) {
		DEBUGOUT("Flash update time out\n");
		goto out;
	}

	flup = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw)) | IXGBE_EEC_FLUP;
	IXGBE_WRITE_REG(hw, IXGBE_EEC_BY_MAC(hw), flup);

	status = ixgbe_poll_flash_update_done_X540(hw);
	if (status == IXGBE_SUCCESS)
		DEBUGOUT("Flash update complete\n");
	else
		DEBUGOUT("Flash update time out\n");

	if (hw->mac.type == ixgbe_mac_X540 && hw->revision_id == 0) {
		flup = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw));

		if (flup & IXGBE_EEC_SEC1VAL) {
			flup |= IXGBE_EEC_FLUP;
			IXGBE_WRITE_REG(hw, IXGBE_EEC_BY_MAC(hw), flup);
		}

		status = ixgbe_poll_flash_update_done_X540(hw);
		if (status == IXGBE_SUCCESS)
			DEBUGOUT("Flash update complete\n");
		else
			DEBUGOUT("Flash update time out\n");
	}
out:
	return status;
}
/**
 * ixgbe_update_flash_X540 - Instruct HW to copy EEPROM to Flash device
 * @hw: pointer to hardware structure
 *
 * Set FLUP (bit 23) of the EEC register to instruct Hardware to copy
 * EEPROM from shadow RAM to the flash device.
 **/
Instruct HW to copy EEPROM to Flash device
@hw: pointer to hardware structure

Set FLUP (bit 23) of the EEC register to instruct Hardware to copy
EEPROM from shadow RAM to the flash device.
Instruct HW to copy EEPROM to Flash device @hw : pointer to hardware structure Set FLUP ( bit 23 ) of the EEC register to instruct Hardware to copy EEPROM from shadow RAM to the flash device .
s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw)
{
	u32 flup;
	s32 status;
	DEBUGFUNC("ixgbe_update_flash_X540");
	status = ixgbe_poll_flash_update_done_X540(hw);
	if (status == IXGBE_ERR_EEPROM) {
		DEBUGOUT("Flash update time out\n");
		goto out;
	}
	flup = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw)) | IXGBE_EEC_FLUP;
	IXGBE_WRITE_REG(hw, IXGBE_EEC_BY_MAC(hw), flup);
	status = ixgbe_poll_flash_update_done_X540(hw);
	if (status == IXGBE_SUCCESS)
		DEBUGOUT("Flash update complete\n");
	else
		DEBUGOUT("Flash update time out\n");
	if (hw->mac.type == ixgbe_mac_X540 && hw->revision_id == 0) {
		flup = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw));
		if (flup & IXGBE_EEC_SEC1VAL) {
			flup |= IXGBE_EEC_FLUP;
			IXGBE_WRITE_REG(hw, IXGBE_EEC_BY_MAC(hw), flup);
		}
		status = ixgbe_poll_flash_update_done_X540(hw);
		if (status == IXGBE_SUCCESS)
			DEBUGOUT("Flash update complete\n");
		else
			DEBUGOUT("Flash update time out\n");
	}
out:
	return status;
}
s32 ixgbe_update_flash_X540 ( struct ixgbe_hw * hw ) { u32 flup ; s32 status ; DEBUGFUNC ( " " ) ; status = ixgbe_poll_flash_update_done_X540 ( hw ) ; if ( status == IXGBE_ERR_EEPROM ) { DEBUGOUT ( " \n " ) ; goto out ; } flup = IXGBE_READ_REG ( hw , IXGBE_EEC_BY_MAC ( hw ) ) | IXGBE_EEC_FLUP ; IXGBE_WRITE_REG ( hw , IXGBE_EEC_BY_MAC ( hw ) , flup ) ; status = ixgbe_poll_flash_update_done_X540 ( hw ) ; if ( status == IXGBE_SUCCESS ) DEBUGOUT ( " \n " ) ; else DEBUGOUT ( " \n " ) ; if ( hw -> mac . type == ixgbe_mac_X540 && hw -> revision_id == 0 ) { flup = IXGBE_READ_REG ( hw , IXGBE_EEC_BY_MAC ( hw ) ) ; if ( flup & IXGBE_EEC_SEC1VAL ) { flup |= IXGBE_EEC_FLUP ; IXGBE_WRITE_REG ( hw , IXGBE_EEC_BY_MAC ( hw ) , flup ) ; } status = ixgbe_poll_flash_update_done_X540 ( hw ) ; if ( status == IXGBE_SUCCESS ) DEBUGOUT ( " \n " ) ; else DEBUGOUT ( " \n " ) ; } out : return status ; }
ixgbe_update_flash_X540 - Instruct HW to copy EEPROM to Flash device
 @hw: pointer to hardware structure
ixgbe_update_flash_X540 - Instruct HW to copy EEPROM to Flash device @hw : pointer to hardware structure