| 3361 | } |
| 3362 | |
| 3363 | static int |
| 3364 | txgbe_check_flash_load(struct txgbe_hw *hw, u32 check_bit) |
| 3365 | { |
| 3366 | u32 reg = 0; |
| 3367 | u32 i; |
| 3368 | int err = 0; |
| 3369 | /* if there's flash existing */ |
| 3370 | if (!(rd32(hw, TXGBE_SPISTAT) & TXGBE_SPISTAT_BPFLASH)) { |
| 3371 | /* wait hw load flash done */ |
| 3372 | for (i = 0; i < 10; i++) { |
| 3373 | reg = rd32(hw, TXGBE_ILDRSTAT); |
| 3374 | if (!(reg & check_bit)) { |
| 3375 | /* done */ |
| 3376 | break; |
| 3377 | } |
| 3378 | msleep(100); |
| 3379 | } |
| 3380 | if (i == 10) |
| 3381 | err = TXGBE_ERR_FLASH_LOADING_FAILED; |
| 3382 | } |
| 3383 | return err; |
| 3384 | } |
| 3385 | |
| 3386 | static void |
| 3387 | txgbe_reset_misc(struct txgbe_hw *hw) |
no test coverage detected