package/boot/uboot-oxnas/src/drivers/block/plxsata_ide.c
/**
 * Possible that ATA status will not become not-busy, so must have timeout
 */
Possible that ATA status will not become not-busy, so must have timeout
Possible that ATA status will not become not - busy so must have timeout
static unsigned int wait_not_busy(int device, unsigned long timeout_secs)
{
	int busy = 1;
	unsigned long loops = (timeout_secs * 1000) / 50;
	do {
		if (!((*(sata_regs_base[device] + SATA_ORB2_OFF)
			>> SATA_COMMAND_BIT) & (1UL << ATA_STATUS_BSY_BIT))) {
			busy = 0;
			break;
		}
		udelay(50000);
	} while (--loops);
	return busy;
}
static unsigned int wait_not_busy ( int device , unsigned long timeout_secs ) { int busy = 1 ; unsigned long loops = ( timeout_secs * 1000 ) / 50 ; do { if ( ! ( ( * ( sata_regs_base [ device ] + SATA_ORB2_OFF ) >> SATA_COMMAND_BIT ) & ( 1UL << ATA_STATUS_BSY_BIT ) ) ) { busy = 0 ; break ; } udelay ( 50000 ) ; } while ( -- loops ) ; return busy ; }
Possible that ATA status will not become not-busy, so must have timeout
Possible that ATA status will not become not - busy so must have timeout
// Test the ATA status register BUSY flag /* Not busy, so stop polling */ // Wait for 50mS before sampling ATA status register again