source: trunk/target/linux/xburst/patches-3.2/0005-NAND-Optimize-reading-the-eec-data-for-the-JZ4740.patch @ 31218

Last change on this file since 31218 was 31218, checked in by mirko, 4 years ago

[target/xburst] level up target xburst to linux kernel version 3.2.1

Thanks to the qi-hardware project - especially to Lars, Maarten and Xiangfu

File size: 2.2 KB
  • drivers/mtd/nand/nand_base.c

    From 4f28237a750afd1112b6f1266d36f8b718efe89c Mon Sep 17 00:00:00 2001
    From: Xiangfu Liu <xiangfu@sharism.cc>
    Date: Tue, 6 Mar 2012 11:19:26 +0800
    Subject: [PATCH 05/21] NAND-Optimize-reading-the-eec-data-for-the-JZ4740
    
    ---
     drivers/mtd/nand/nand_base.c |   14 ++++----------
     1 files changed, 4 insertions(+), 10 deletions(-)
    
    diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
    index 0131e84..74b8cce 100644
    a b static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd, 
    12951295 
    12961296        /* Read the OOB area first */ 
    12971297        if (mtd->writesize > 512) { 
    1298                 chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); 
    1299                 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 
     1298                chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page); 
     1299                chip->read_buf(mtd, ecc_code, chip->ecc.total); 
    13001300                chip->cmdfunc(mtd, NAND_CMD_RNDOUT, 0, -1); 
    13011301        } else { 
    13021302                chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); 
    static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd, 
    13041304                chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page); 
    13051305        } 
    13061306 
    1307         for (i = 0; i < chip->ecc.total; i++) 
    1308                 ecc_code[i] = chip->oob_poi[eccpos[i]]; 
    1309  
    13101307        for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { 
    13111308                int stat; 
    13121309 
    static int nand_read_subpage_hwecc_oob_first(struct mtd_info *mtd, struct nand_c 
    13611358 
    13621359        /* Read the OOB area first */ 
    13631360        if (mtd->writesize > 512) { 
    1364                 chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); 
    1365                 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 
     1361                chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize + eccpos[0], page); 
     1362                chip->read_buf(mtd, ecc_code, chip->ecc.total); 
    13661363                chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_col_addr, -1); 
    13671364        } else { 
    13681365                chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); 
    static int nand_read_subpage_hwecc_oob_first(struct mtd_info *mtd, struct nand_c 
    13701367                chip->cmdfunc(mtd, NAND_CMD_READ0, data_col_addr, page); 
    13711368        } 
    13721369 
    1373         for (i = 0; i < chip->ecc.total; i++) 
    1374                 ecc_code[i] = chip->oob_poi[eccpos[i]]; 
    1375  
    13761370        p = bufpoi + data_col_addr; 
    13771371 
    13781372        for (i = eccbytes * start_step; num_steps; num_steps--, i += eccbytes, p += eccsize) { 
Note: See TracBrowser for help on using the repository browser.