Lines Matching +full:i2c +full:- +full:retry +full:- +full:count

8  *     http://www.apache.org/licenses/LICENSE-2.0
27 #include <phosphor-logging/lg2.hpp>
35 constexpr uint8_t MAX_RETRIES = 0x02; // Constants for retry limits
45 constexpr uint8_t BLOCK_WRITE_SIZE = 0x25; // I2C block write size
62 constexpr uint8_t CMD_BOOT_ISP = 0x02; // Boot the In-System Programming System.
81 {"I2C_INTERFACE", "I2C interface is null pointer."}}; in doUpdate()
82 // Callout PSU & I2C in doUpdate()
85 throw std::runtime_error("I2C interface error"); in doUpdate()
105 if (retryProcessTwo == (MAX_RETRIES - 1)) in doUpdate()
137 // One of the block write commands failed, retry download in doUpdate()
138 // procedure one time starting with re-writing initial ISP in doUpdate()
171 // Retry the whole download process starting with the key and in doUpdate()
173 if ((retryProcessOne < (MAX_RETRIES - 1)) && in doUpdate()
174 (retryProcessTwo < (MAX_RETRIES - 1))) in doUpdate()
198 for (int retry = 0; retry < MAX_RETRIES; ++retry) in writeIspKey() local
203 i2cInterface->write(KEY_REGISTER, unlockData.size(), in writeIspKey()
208 catch (const i2c::I2CException& e) in writeIspKey()
210 // Log failure if I2C write fails. in writeIspKey()
211 lg2::error("I2C write failed: {ERROR}", "ERROR", e); in writeIspKey()
213 {"I2C_ISP_KEY", "ISP key failed due to I2C exception"}}; in writeIspKey()
216 // PSU & I2C in writeIspKey()
238 for (int retry = 0; retry < MAX_RETRIES; ++retry) in writeIspMode() local
243 i2cInterface->write(STATUS_REGISTER, CMD_BOOT_ISP); in writeIspMode()
247 i2cInterface->read(STATUS_REGISTER, ispStatus); in writeIspMode()
257 catch (const i2c::I2CException& e) in writeIspMode()
260 // Log I2C error with each retry attempt. in writeIspMode()
261 lg2::error("I2C exception during ISP mode write/read: {ERROR}", in writeIspMode()
268 "Download firmware failed during writeIspMode due to I2C exception"}}; in writeIspMode()
269 // Callout PSU & I2C in writeIspMode()
277 // Log error with each retry attempt. in writeIspMode()
312 for (int retry = 0; retry < MAX_RETRIES; retry++) in writeIspStatusReset() local
316 i2cInterface->write(STATUS_REGISTER, in writeIspStatusReset()
318 retry = MAX_RETRIES; in writeIspStatusReset()
320 catch (const i2c::I2CException& e) in writeIspStatusReset()
324 lg2::error("I2C Write ISP reset failed: {ERROR}", "ERROR", e); in writeIspStatusReset()
329 {"I2C_ISP_RESET", "I2C exception during ISP status reset"}}; in writeIspStatusReset()
330 // Callout PSU & I2C in writeIspStatusReset()
356 for (int retry = 0; retry < MAX_RETRIES; ++retry) in writeIspStatusReset() local
360 i2cInterface->read(STATUS_REGISTER, ispStatus); in writeIspStatusReset()
367 i2cInterface->write(STATUS_REGISTER, in writeIspStatusReset()
373 catch (const i2c::I2CException& e) in writeIspStatusReset()
378 "I2C Write/Read or Write error during ISP reset: {ERROR}", in writeIspStatusReset()
385 "I2C exception during read ISP status"}}; in writeIspStatusReset()
386 // Callout PSU & I2C in writeIspStatusReset()
488 // Remove the F9 and byte count in prepareCommandBlock()
529 // Perform I2C write/read with retries in downloadPsuFirmware()
539 inputFile->close(); in downloadPsuFirmware()
567 // progress. If retry to send the first packet again reply will in performI2cWriteReadWithRetries()
585 catch (const i2c::I2CException& e) in performI2cWriteReadWithRetries()
592 "I2C exception while flashing the firmware."}}; in performI2cWriteReadWithRetries()
593 // Callout PSU & I2C in performI2cWriteReadWithRetries()
596 lg2::error("I2C exception write/read block failed: {ERROR}", in performI2cWriteReadWithRetries()
625 i2cInterface->processCall(regAddr, cmdBlockWrite.size(), in performI2cWriteRead()
640 i2cInterface->read(STATUS_REGISTER, status); in verifyDownloadFWStatus()
643 lg2::error("Firmware download failed - status: {ERR}", "ERR", in verifyDownloadFWStatus()
652 lg2::error("I2C read status register failed: {ERROR}", "ERROR", e); in verifyDownloadFWStatus()
665 i2cInterface->write(STATUS_REGISTER, CMD_BOOT_PWR); in ispReboot()
672 lg2::error("I2C write error during reboot: {ERROR}", "ERROR", e); in ispReboot()
678 for (int retry = 0; retry < MAX_RETRIES; ++retry) in ispReadRebootStatus() local
683 uint8_t data = 1; // Initialize data to a non-zero value in ispReadRebootStatus()
684 i2cInterface->read(STATUS_REGISTER, data); in ispReadRebootStatus()
693 catch (const i2c::I2CException& e) in ispReadRebootStatus()
699 "I2C exception while reading ISP reboot status"}}; in ispReadRebootStatus()
701 // Callout PSU & I2C in ispReadRebootStatus()
704 lg2::error("I2C read error during reboot attempt: {ERROR}", "ERROR", in ispReadRebootStatus()