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

static void mxc_nand_write_buf ( struct mtd_info *  mtd,
const u_char *  buf,
int  len 
) [static]

This function writes data of length len from buffer buf to the NAND internal RAM buffer's MAIN area 0.

Parameters:
mtd MTD structure for the NAND Flash
buf data to be written to NAND Flash
len number of bytes to be written

Definition at line 720 of file mxc_nd2.c.

{
      u16 col = g_nandfc_info.colAddr;
      int j = mtd->writesize - col;
      int n = mtd->oobsize + j;

      n = min(n, len);

      if (j > 0) {
            if (n > j) {
                  memcpy(&data_buf[col], buf, j);
                  memcpy(&oob_buf[0], buf + j, n - j);
            } else {
                  memcpy(&data_buf[col], buf, n);
            }
      } else {
            col -= mtd->writesize;
            memcpy(&oob_buf[col], buf, len);
      }

      /* update */
      g_nandfc_info.colAddr += n;
}


Generated by  Doxygen 1.6.0   Back to index