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

static void send_cmd ( struct mtd_info *  mtd,
u16  cmd,
bool  useirq 
) [static]

This function issues the specified command to the NAND device and waits for completion.

Parameters:
cmd command for NAND Flash
useirq True if IRQ should be used rather than polling

Definition at line 351 of file mxc_nd2.c.

References send_addr().

{
      DEBUG(MTD_DEBUG_LEVEL3, "send_cmd(0x%x, %d)\n", cmd, useirq);

#ifdef NFC_AUTO_MODE_ENABLE
      switch (cmd) {
      case NAND_CMD_READ0:
      case NAND_CMD_READOOB:
            raw_write(NAND_CMD_READ0, REG_NFC_FLASH_CMD);
            break;
      case NAND_CMD_SEQIN:
      case NAND_CMD_ERASE1:
            raw_write(cmd, REG_NFC_FLASH_CMD);
            break;
      case NAND_CMD_PAGEPROG:
      case NAND_CMD_ERASE2:
      case NAND_CMD_READSTART:
            raw_write(raw_read(REG_NFC_FLASH_CMD) | cmd << NFC_CMD_1_SHIFT,
                    REG_NFC_FLASH_CMD);
            auto_cmd_interleave(mtd, cmd);
            break;
      case NAND_CMD_READID:
            send_atomic_cmd(cmd, useirq);
            send_addr(0, false);
            break;
      case NAND_CMD_RESET:
            auto_cmd_interleave(mtd, cmd);
            break;
      case NAND_CMD_STATUS:
            send_atomic_cmd(cmd, useirq);
            break;
      default:
            break;
      }
#else
      send_atomic_cmd(cmd, useirq);
#endif
}


Generated by  Doxygen 1.6.0   Back to index