Chinaunix

标题: 坏块判断 [打印本页]

作者: myfaxmail    时间: 2011-12-23 03:25
标题: 坏块判断
  1. static u_size8 is_bad_block(u_size32 addr)
  2. {
  3.       u_size32 i;
  4.       u_size8 tmp;
  5.       EN_NANDFLASH;
  6.       WCMD(READ1);
  7.         rNFADDR = 2048 & 0xff;
  8.         rNFADDR = (2048 >> 8) & 0xf;
  9.         rNFADDR = (addr >> 12) & 0xff;
  10.         rNFADDR = (addr >> 20) & 0xff;
  11.         rNFADDR = (addr >> 28) & 0x1;
  12.       WCMD(READ2);
  13.       delay(10);
  14.       noBUSY;
  15.       tmp = rNFDATA;
  16.         if(tmp != 0xff){
  17.           DIS_NANDFLASH;
  18.           return 1;
  19.     }
  20.       DIS_NANDFLASH;
  21.       return 0;
  22. }





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2