Beispiel #1
0
static int32_t flash_is_busy(flash_info_t * info, cfiptr_t cptr, cfiword_t * cword)
{
    int32_t retval;

    switch (info->vendor) {
    case CFI_CMDSET_INTEL_STANDARD:
    case CFI_CMDSET_INTEL_EXTENDED:
        retval = !flash_isset(info, cptr, FLASH_STATUS_DONE);
        break;
    case CFI_CMDSET_AMD_STANDARD:
    case CFI_CMDSET_AMD_EXTENDED:
#ifdef POLLING_AMD_DQ7
        retval = Data_Polling_Check(info, cptr, cword); /* data polling for D7 */
#else
        retval = flash_toggle(info, cptr, AMD_STATUS_TOGGLE);
#endif
        break;
    default:
        retval = 0;
    }
    return retval;
}
/*
 * flash_is_busy - check to see if the flash is busy
 * This routine checks the status of the chip and returns true if the chip is busy
 */
static int amd_flash_is_busy(struct flash_info *info, flash_sect_t sect)
{
	return flash_toggle (info, sect, 0, AMD_STATUS_TOGGLE);
}