quoted
quoted
+ /* if there's flash existing */
+ if (!(rd32(hw, TXGBE_SPI_STATUS) &
+ TXGBE_SPI_STATUS_FLASH_BYPASS)) {
+ /* wait hw load flash done */
+ for (i = 0; i < TXGBE_MAX_FLASH_LOAD_POLL_TIME; i++) {
+ reg = rd32(hw, TXGBE_SPI_ILDR_STATUS);
+ if (!(reg & check_bit)) {
+ /* done */
+ break;
+ }
+ msleep(200);
+ }
This is what iopoll.h is for. Any sort of loop waiting for something to
happen
quoted
should use one of the helpers in there.
The description of functions in iopoll.h states that maximum sleep time
should be less than 20ms, is it okay to call it here for 200ms.
Should be fine.
You could always reduce the sleep and just poll 10 times more. What
you are doing, reading one register, is cheap.
Andrew