Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static u16 get_dev_status ( void   )  [static]

This function requests the NFC to perform a read of the NAND device status and returns the current status.

Returns:
device status

Definition at line 497 of file mxc_nd2.c.

References NFC_STATUS, and wait_op_done().

{
#ifdef NFC_AUTO_MODE_ENABLE
      int i;
      u16 status = 0;
      for (i = 0; i < num_of_interleave; i++) {

            /* set ative cs */
            NFC_SET_NFC_ACTIVE_CS(i);

            /* FIXME, NFC Auto erase may have
             * problem, have to pollingit until
             * the nand get idle, otherwise
             * it may get error
             */
            read_dev_status(&status);
            if (status & NAND_STATUS_FAIL)
                  break;
      }

      return status;
#else
      volatile u16 *mainBuf = MAIN_AREA1;
      u8 val = 1;
      u16 ret;

      /* Set ram buffer id */
      NFC_SET_RBA(val);

      /* Read status into main buffer */
      raw_write(NFC_STATUS, REG_NFC_OPS);

      /* Wait for operation to complete */
      wait_op_done(TROP_US_DELAY, true);

      /* Status is placed in first word of main buffer */
      /* get status, then recovery area 1 data */
      ret = *mainBuf;

      return ret;
#endif
}


Generated by  Doxygen 1.6.0   Back to index