Technical Note. Enabling On-Die ECC NAND with JFFS2. Introduction. TN-29-75: Enabling On-Die ECC NAND with JFFS2. Introduction.

Similar documents
Enabling NAND On-Die ECC for OMAP3 Using Linux/Android OS with YAFFS2

Monitoring Ready/Busy Using the READ STATUS (70h) Command

Technical Note. One-Time Programmable (OTP) Operations. Introduction. TN-29-68: 2Gb: x8, x16 NAND Flash Memory. Introduction

Enabled (both during preconditioning and measurement) 4KB for random writes, 2MB for sequential writes

Command Register Settings Description Notes

NAND Flash Performance Improvement Using Internal Data Move

NAND/MTD support under Linux

Technical Note. Design Considerations when using NOR Flash on PCBs. Introduction and Definitions

Technical Note. J3F 32Mb, 64Mb, 256Mb Parallel NOR Flash Memory Software Device Drivers. Introduction. TN-12-50: J3F Software Device Drivers

Maximum Monolithic Density Density Number of Stacks N25Q512Axxx. 512Mb 2 256Mb N25Q00AAxxx 1Gb 4 MT25Qxs01Gxxx. 1Gb 2 512Mb MT25Qxs02Gxxx 2Gb 4

How to handle the spare-byte area of Macronix 36nm NAND Flash

Technical Note. Refresh Features for Micron e.mmc Automotive 5.0 Devices. Introduction. TN-FC-54: Refresh Features for e.mmc Automotive 5.

Technical Note. Improving Random Read Performance Using Micron's SNAP READ Operation. Introduction. TN-2993: SNAP READ Operation.

How to Power On and Power Off the M29F Flash Memory Device

Overview. TN-29-08: Hamming Codes for NAND Flash Memory Devices Overview

Technical Note. SMART Command Feature Set for the eu500. Introduction. TN-FD-35: eu500 eusb SMART Commands. Introduction

Technical Note NAND Flash Performance Increase with PROGRAM PAGE CACHE MODE Command

SMART Self-Test Reference for P400e SATA SSDs

IRON FOR JFFS2. Raja Ram Yadhav Ramakrishnan, Abhinav Kumar. { rramakrishn2, ABSTRACT INTRODUCTION

Migrating from Spansion Am29F to Micron M29F NOR Flash Memories

Technical Note. ONFI 4.0 Design Guide. Introduction. TN-29-83: ONFI 4.0 Design Guide. Introduction

Technical Note. Refresh Features for Micron e.mmc Automotive 5.1 Devices. Introduction. TN-FC-60: Refresh Features for e.mmc Automotive 5.

MT29F4G08AAA, MT29F8G08BAA, MT29F8G08DAA, MT29F16G08FAA, MT29F8G08MAA, MT29F16G08QAA,

Technical Note. Migrating from Micron M25PE to Micron MT25Q 128Mb. Introduction. TN-25-36: Migrating from M25PE to MT25Q 128Mb.

Technical Note. Adding ECC to a Data Bus with DDR4 x16 Components. Introduction. TN-40-41: Adding ECC With DDR4 x16 Components.

Technical Note. Maximize SPI Flash Memory Design Flexibility With a Single Package. Introduction

Power-Up, Power-Down, and Brownout Considerations on MT25Q, MT25T, and MT35X NOR Flash Memory

Parallel NOR and PSRAM 88-Ball MCP Combination Memory

Parallel NOR and PSRAM 56-Ball MCP Combination Memory

Micron part numbers e MMC registers Multilevel cell (MLC) to single-level cell (pslc) setting flow

Technical Note. Migrating from Micron M25P to Micron MT25Q 128Mb. Introduction. TN-25-34: Migrating from M25P to MT25Q 128Mb.

Technical Note. Software Driver for M29EW NOR Flash Memory. Introduction. TN-13-12: Software Driver for M29EW NOR Flash Memory.

Technical Note. Reset Configurations for MT25Q, MT25T, and N25Q Flash Memory Devices. Introduction

Technical Note. Enabling SD/uSD Card Lock/Unlock Feature in Linux. Introduction. TN-SD-01: Enabling SD/uSD Card Lock/Unlock in Linux.

Product Brief LPDDR2-PCM and Mobile LPDDR2 121-Ball MCP

Migrating from Macronix MX29GL-G/F and MX68GL-G Devices to MT28EW NOR Flash Devices

Client vs. Enterprise SSDs

Technical Note. Migrating from Micron M29W Devices to MT28EW NOR Flash Devices. Introduction. TN-13-50: Migrating M29W to MT28EW NOR Flash Devices

Description of common NAND special features

Technical Note Designing for High-Density DDR2 Memory

User Guide. Storage Executive. Introduction. Storage Executive User Guide. Introduction

Technical Note. Client SATA SSD SMART Attribute Reference. Introduction. TN-FD-22: Client SATA SSD SMART Attribute Reference.

Technical Note. SMART Command Feature Set for the Introduction. TN-FD-34: 5100 SSD SMART Implementation. Introduction

Technical Note. Booting from Embedded MMC (e.mmc) Introduction. TN-FC-06: Booting from Embedded MMC. Introduction

Comparing Micron N25Q and Macronix MX25L Flash Devices

OMAP3530 has 256MB NAND flash in PoP (PoP: Package-On-Package implementation for Memory Stacking) configuration.

PARAMETER SYMBOL MIN MAX Address Access Time

Technical Note. SMART Command Feature Set for the M510DC. Introduction. TN-FD-33: M510DC SSD SMART Implementation. Introduction

Technical Note Using Micron Asynchronous PSRAM with the NXP LPC2292 and LPC2294 Microcontrollers

Changing the i.mx51 NAND Flash Model for Windows Embedded CE TM 6.0

NAND Design-In Notice

MLC. Mini SATA III Flash Module. HERMES-JI Series. Product Specification APRO MLC MINI SATA III FLASH MODULE

DDR2 SDRAM UDIMM MT16HTF25664AZ 2GB MT16HTF51264AZ 4GB For component data sheets, refer to Micron s Web site:

Migrating from Spansion S25FL512S to Micron N25Q 512Mb Flash Device

smxnand RTOS Innovators Flash Driver General Features

ONFI Standards and What They Mean to Designers

1. The values of t RCD and t RP for -335 modules show 18ns to align with industry specifications; actual DDR SDRAM device specifications are 15ns.

Flash File Systems Overview

Technical Note. SMART Command Feature Set for the M500DC. Introduction. TN-FD-26: M500DC SSD SMART Implimentation. Introduction

2. General Features The two devices have a different page size and block size. Feature differences are highlighted in Bold Italic type in Table 2-1.

Comparing Toshiba TC58BVG1S3HTAI0 with Macronix MX30LF2GE8AB

Anatomy of Linux flash file systems

Yaffs Tuning. Charles Manning

EMSOFT 09 Yangwook Kang Ethan L. Miller Hongik Univ UC Santa Cruz 2009/11/09 Yongseok Oh

AN4491 Application note

Datasheet. Embedded Storage Solutions. Industrial. SATA III 2.5 Solid State Drive. SED2FV Series. V Aug

Content courtesy of Wikipedia.org. David Harrison, CEO/Design Engineer for Model Sounds Inc.

LC1628-L High-Speed USB Flash Disk Controller Preliminary Data Sheet

A Survey on NAND Flash Memory Controller Using FPGA

Open Channel Solid State Drives NVMe Specification

DDR SDRAM UDIMM MT8VDDT3264A 256MB MT8VDDT6464A 512MB For component data sheets, refer to Micron s Web site:

Technical Note. Migrating from S29GL-S Devices to MT28FW NOR Flash Devices. Introduction. TN-13-41: Migrating S29GL-S to MT28FW NOR Flash Devices

DDR SDRAM UDIMM. Draft 9/ 9/ MT18VDDT6472A 512MB 1 MT18VDDT12872A 1GB For component data sheets, refer to Micron s Web site:

Setup Macronix NAND Flash on Freescale i.mx28 EVK

AN4872 Application note

Technical Note. Migrating from Cypress's FL-S and FS-S to Micron's MT25Q. Introduction

YAFFS A NAND flash filesystem

Solid-State Drive System Optimizations In Data Center Applications

Industrial mini SATA III Flash Module

User Guide. Storage Executive Command Line Interface. Introduction. Storage Executive Command Line Interface User Guide Introduction

Compressed Swap for Embedded Linux. Alexander Belyakov, Intel Corp.

DDR SDRAM UDIMM MT16VDDT6464A 512MB MT16VDDT12864A 1GB MT16VDDT25664A 2GB

Datasheet. Embedded Storage Solutions. Industrial. SATA III 2.5 Solid State Drive. SED2FIV Series CSXXXXXRC-XX09XXXX. 04 Jul 2016 V1.

NAND Flash Architecture and Specification Trends

Industrial M SATA III NGFF SSD

TEFS: A Flash File System for Use on Memory Constrained Devices

FLASH Programming in Production of VS1000 Applications

Migrating from MX60LF8G28AB to MX60LF8G18AC

Flash filesystem benchmarks

Memory Management. Mobile Hardware Resources. Address Space and Process. Memory Management Overview. Memory Management Concepts

73M1822/73M1922 MicroDAA Software Architecture December 23, 2009 Rev. 1.0 UG_1x22_057

MLC MICRO SATA III FLASH MODULE

NAND Flash Memory. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

DDR SDRAM SODIMM MT8VDDT1664H 128MB 1. MT8VDDT3264H 256MB 2 MT8VDDT6464H 512MB For component data sheets, refer to Micron s Web site:

NAND Chip Driver Optimization and Tuning. Vitaly Wool Embedded Alley Solutions Inc.

GLS86FB008G2 / 016G2 / 032G2 / 064G2 Industrial Temp msata ArmourDrive

GLS89SP032G3/064G3/128G3/256G3/512G3/001T3 Industrial Temp 2.5 SATA ArmourDrive PX Series

Technical Note. Micron N25Q to Micron MT25Q Migration. Introduction. TN-25-01: Micron N25Q to Micron MT25Q Migration. Introduction

Industrial M / PCIe NGFF SSD

Technical Note. Comparing Micron N25Q and M25P Flash Devices. Introduction. TN-12-12: Comparing N25Q and M25P Flash Devices.

Transcription:

Technical Note Enabling On-Die ECC NAND with JFFS2 Introduction Introduction Terminology The Micron NAND Flash memory with on-die ECC is specifically designed to work with application processors that have either no ECC engine or only a 1-bit ECC engine. The on-die ECC engine is capable to correct up to four errors, effectively lengthening device life span. JFFS2 is a mature, well maintained Flash file system, tightly coupled with the MTD NAND interface. The MTD NAND interface includes a common library and NAND-specific drivers to provide an abstraction layer that enables development of many NAND device types. Because of unique features in the on-die ECC NAND, both the JFFS2 and the NAND drivers require slight alterations. The alterations, described here, are a proven design using an identical board, the same Linux build, and a similar NAND device (2KB + 64-byte per page) but without the on-die ECC. While the MTD is well defined and adapted, the MTD/NAND interface layer covers all the variations across the large number of micro-architectures, NAND devices, and application designs. The on-die ECC features essentially eliminate the write OOB feature which MTD uses to provide to FS. This technical note focuses on altering the JFFS2/MTD protocol slightly, also provide guidance on the MTD/NAND layer implementation. JFFS2: Flash file system MTD: Interface module between the Flash file system and the Flash memory OOB: Spare area on each Flash memory page BBM: Bad block marker field on OOB Write-Buffer: JFFS2 feature that delays writes to NAND page size before committing to NAND Clean-Marker: JFFS2 feature that marks a block after erase. 1 Products and specifications discussed herein are subject to change by Micron without notice.

Enabling and Disabling On-Die ECC Enabling and Disabling On-Die ECC Table 1: On-Die ECC Settings Command Command Sequence Settings Description SET FEATURES (EFh) GET FEATURES (EEh) EFh - 90h - 08h 1-00h - 00h - 00h - WAIT 08h = Enabled Enables internal on-die ECC. EFh - 90h - 00h 1-00h - 00h - 00h - WAIT 00h = Disabled Disables internal on-die ECC EEh - 90h - WAIT - READ 2 - READ - READ - READ 08h/00h Reads internal on-die ECC state, executing 6-bit detection and 4-bit error correction. Determines whether on-die ECC is enabled/ disabled. Notes: 1. In the command sequence, the command code is followed by address 90h and then four data bytes, of which only the first is used to enable/disable the internal on-die ECC state. 2. When the READ operation is complete, read status bit 0 must be checked for occurrence of errors larger than four bits, after which the device must be returned to read mode by issuing the 00h command. OOB Area Layout and Limitations Table 2: OOB Area Mapping The ECC NAND Flash device internal ECC enables 5-bit detection and 4-bit error correction for 512 bytes (x8) or 256 words (x16) of the main area and 4 bytes of metadata I in the OOB area. The metadata II area, which consists of two bytes (x8), is not ECC protected. See following figure for the OOB area mapping. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Note: 1. Gray = ECC parity bytes; light blue = Metadata 2 unprotected bytes; dark blue = Metadata 1 protected bytes; White = Reserved bytes While the ECC engine provides enhanced error correction and longer product life, the benefit comes with limitations: 1) Each ECC protected area (512+4 bytes) must be written as one partial-page program; 2) The separately writable OOB area (total 4x2 bytes) is small and not ECC protected; each 2KB page allows up to four error-protected WRITE operations of (512+4) bytes each. The four WRITE operations could be combined into one, two, or three to reduce NAND cell stress and to allow extra WRITE commands to the unprotected 8 bytes. Because of these limitations, on-die ECC NAND with JFFS2 functions differently than NAND without the on-die ECC: four ECC units of (512 bytes data + 3 bytes ECC) and 2

JFFS2 Configuration Kernel Configuration File four OOB units of (8 metadata + 3 bytes ECC) per page will not work. There is not enough memory for the 12 bytes required by the Clean Marker functionality, and the available 8 bytes, which are not error-protected, are unreliable. Developed originally for NOR flash, JFFS2 is capable of operating without OOB areas. However, JFFS2 key capabilities, Write-Buffer, Summary, and No-Clean-Marker, belong to opposite configuration modes: the first two belong to NAND mode while the last one belongs to NOR mode. Plus, NAND requires bad block management that does not exist in NOR. Therefore, JFFS2 must be reconfigured to enable Write-Buffer and Summary functionality and disable Clean Marker functionality, while retaining its dependence on MTD bad block marking. Following are additional reconfiguration parameters: Using Linux Ubuntu kernel for OMAP, git tag v3.9-rc8 (See details and source code at http://omappedia.org/wiki/omap_ubuntu_main). Reconfiguration can be applied on any JFFS2 including code changes between v3.0 and v3.9-rc8. MTD nandsim module enabled to simulate 2KB + 64 bytes per page NAND device, so the architecture/board-specific NAND driver implementation can be focused on JFFS2 configuration (For details on NAND driver implementation with the on-die ECC device, refer to TN-29-56: Enabling On-Die ECC for OMAP3 on Linux/Android OS Introduction). Code changes represented loosely in patch format. Lines beginning with "-" and "+" mean "change from" and "change to", respectively. The following JFFS2 reconfiguration settings enable the Write Buffer and Summary capabilities. +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_SUMMARY=y //enable summary +CONFIG_JFFS2_FS_XATTR=y +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_FS_WRITEBUFFER=y //enable write buffer +CONFIG_JFFS2_RUBIN=y JFFS2 Configuration 3

JFFS2: fs/jffs2/os-linux.h In the Write Buffer enabled corresponding section, disable jffs2_cleanmarker_oob. Some places in code using this macro must be changed to use (c->mtd->type == MTD_NANDFLASH). #ifndef CONFIG_JFFS2_FS_WRITEBUFFER... #else... - #define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH) + #define jffs2_cleanmarker_oob(c) (0) //disable clean marker... JFFS2: fs/jffs2/erase.c Use the original jffs2_cleanmarker_oob macro, which is(c->mtd->type == MTD_NAND- FLASH). static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock... JFFS2 Configuration - if (jffs2_cleanmarker_oob(c) && (bad_offset!= (uint32_t)mtd_fail_addr_un- KNOWN)) { + if ( (c->mtd->type == MTD_NANDFLASH) && (bad_offset!= (uint32_t)mtd_fail_addr_unknown)) { //use mtd->type instead of jffs2_cleanmarker_oob(c) JFFS2: fs/jffs2/fs.c Use the original jffs2_cleanmarker_oob macro, which is(c->mtd->type == MTD_NAND- FLASH). static int jffs2_flash_setup(struct jffs2_sb_info *c) { int ret = 0; - if (jffs2_cleanmarker_oob(c)) { + if (c->mtd->type == MTD_NANDFLASH) { //use mtd->type instead of jffs2_cleanmarker_oob(c) / * NAND flash... do setup accordingly * / ret = jffs2_nand_flash_setup(c); void jffs2_flash_cleanup(struct jffs2_sb_info *c) { - if (jffs2_cleanmarker_oob(c)) { + if (c->mtd->type == MTD_NANDFLASH) { //use mtd->type instead of jffs2_cleanmarker_oob(c) 4

JFFS2: fs/jffs2/scan.c Handle the (c->mtd->type == MTD_NANDFLASH) case in a different way. static int jffs2_scan_eraseblock( ) { #if CONFIG_JFFS2_FS_WRITEBUFFER if (jffs2_cleanmarker_oob(c)) { } + else { + if (mtd_block_isbad(c->mtd, jef->offset)) + Return BLK_STATE_BADBLOCK; + } #endif JFFS2 Configuration MTD: nand_base.c No ECC needed for on-die ECC NAND. chip->ecc.mode = NAND_ECC_NONE; 5

MTD and NAND Driver Configuration Nandsim Module Changes Code changes are not required for nandsim. The following arguments are passed to the kernel to simulate 2KB+64byte per page, error free NAND, with bad blocks 1, 23 and 45: mtdoops.mtddev=0 NAND Driver Implementation MTD and NAND Driver Configuration nandsim.first_id_byte=0x2c nandsim.second_id_byte=0xa2 nandsim.third_id_byte=0x00 nandsim.fourth_id_byte=0x05 nandsim.bitflips=0 nandsim.badblocks=1,23,45 The most important requirement is to verify that the mtd_write_oob() function is never called. This is done by adding the following to the beginning of the function: while(1) printk("writing OOB!"); The configuration should use a NAND driver that works with regular NAND flash. Applicable details can be found in TN-29-56: Enabling On-Die ECC for OMAP3 on Linux/ Android OS Introduction. The critical part on the NAND driver side is to implement and verify mtd_block_isbad() and mtd_block_markbad(). Based on chip->ecc.mode = NAND_ECC_NONE and nand_base.c code, the default calling path will be: Jffs2_scan_eraseblock() à mtd_block_isbad() à nand_block_isbad() à nand_block_checkbad() à chip->block_bad() à nand_block_bad() à send commands to read BBM jffs2_write_nand_bad_block() à mtd_block_markbad() à nand_block_markbad() à nand_write_oob_std() à send commands to write BBM The above calling path uses standard functions in nand_base.c, not turning off ECC. Therefore chip->block_bad() and chip->block_markbad() need to be implemented, which involves enabling/disabling on-die ECC using the SET FEATURES command. The chip->ecc.read_oob_raw() and chip->ecc.write_oob_raw() are not needed since all operations except the bad block management are with ECC on. Implementation details of enabling/disabling on-die ECC can be found in TN-29-56: Enabling On-Die ECC for OMAP3 on Linux/Android OS Introduction. 6

Conclusion Conclusion By slightly altering JFFS2, it is possible to make it work with Micron on-die ECC NAND devices. The NAND driver for a hardware platform also needs to be modified based on existing working code. 7

Revision History Revision History Rev. A 8/13 Initial release 8000 S. Federal Way, P.O. Box 6, Boise, ID 83707-0006, Tel: 208-368-3900 www.micron.com/productsupport Customer Comment Line: 800-932-4992 Micron and the Micron logo are trademarks of Micron Technology, Inc. All other trademarks are the property of their respective owners. This data sheet contains minimum and maximum limits specified over the power supply and temperature range set forth herein. Although considered final, these specifications are subject to change, as further product development and data characterization sometimes occur. 8