source: trunk/target/linux/coldfire/patches/034-Enable-the-NFC-driver-for-soft_ecc.patch @ 31546

Last change on this file since 31546 was 31546, checked in by kaloz, 4 years ago

[coldfire]: switch to 2.6.38

File size: 1.5 KB
  • drivers/mtd/nand/Kconfig

    From 25ebef8c87221774de01d1f1de4fb615fcfc6b54 Mon Sep 17 00:00:00 2001
    From: Jason Jin <Jason.jin@freescale.com>
    Date: Thu, 4 Aug 2011 09:59:47 +0800
    Subject: [PATCH 34/52] Enable the NFC driver for soft_ecc.
    
    If enabled YAFFS2 support, soft ecc should be used for the
    nand flash driver.
    
    Signed-off-by: Jason Jin <Jason.jin@freescale.com>
    ---
     drivers/mtd/nand/Kconfig   |    6 ++++++
     drivers/mtd/nand/fsl_nfc.c |   12 +++++++++---
     2 files changed, 15 insertions(+), 3 deletions(-)
    
    a b config MTD_NAND_FSL_NFC 
    481481          Enables support for NAND Flash chips wired onto Freescale PowerPC 
    482482          processor localbus with User-Programmable Machine support. 
    483483 
     484config MTD_NAND_FSL_NFC_SWECC 
     485        bool "Software ECC" 
     486        depends on MTD_NAND_FSL_NFC 
     487        help 
     488          Use software ECC. 
     489 
    484490config MTD_NAND_MXC 
    485491        tristate "MXC NAND support" 
    486492        depends on ARCH_MX2 || ARCH_MX25 || ARCH_MX3 || ARCH_MX51 
  • drivers/mtd/nand/fsl_nfc.c

    a b fsl_nfc_command(struct mtd_info *mtd, un 
    403403        if (page != -1) 
    404404                prv->page = page; 
    405405 
    406         nfc_set_field(mtd, NFC_FLASH_CONFIG, 
    407                 CONFIG_ECC_MODE_MASK, 
    408                 CONFIG_ECC_MODE_SHIFT, ECC_45_BYTE); 
     406        if(hardware_ecc) 
     407                nfc_set_field(mtd, NFC_FLASH_CONFIG, 
     408                        CONFIG_ECC_MODE_MASK, 
     409                        CONFIG_ECC_MODE_SHIFT, ECC_45_BYTE); 
     410        else 
     411                /* set ECC BY_PASS */ 
     412                nfc_set_field(mtd, NFC_FLASH_CONFIG, 
     413                                CONFIG_ECC_MODE_MASK, 
     414                                CONFIG_ECC_MODE_SHIFT, ECC_BYPASS); 
    409415 
    410416        if (!(page%0x40)) { 
    411417                        nfc_set_field(mtd, NFC_FLASH_CONFIG, 
Note: See TracBrowser for help on using the repository browser.