Embedded Storage Management

Anil Kumar Pugalia
Anil Kumar PugaliaLinux Geek and Open Source Hardware & Software Freak, Corporate Trainer, Entrepreneur in Automation
Embedded Storage
  Management



© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>
               All Rights Reserved.
What to Expect?
W's of Memory Technology Devices
MTD Subsystem
MTD related Drivers
Flash File Systems
Flash Tools




        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   2
                       All Rights Reserved.
Storage Timeline
Traditionally (for most of past 20+ years)
  ROM – For read-only storage
  NVRAM – For read-write storage
Equating with today's technology
  Low-density
  Costlier
Latest trend is flash technology devices
  More commonly referred as MTD
  Comes as NOR, NAND, some exotic varieties
  Best suited for Embedded Systems
             © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   3
                            All Rights Reserved.
What are
Memory Technology Devices?
Embedded Flash Memory
Contains Large Erase Blocks
  32KB to 128KB
Maintains three main Operations
  Read, Write, Erase from Erase Block
Bad Erase Blocks to be dealt by software
Erase Blocks get worn out after some
erase cycles
         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   4
                        All Rights Reserved.
NOR Flash
Reading like RAM
 Random Access
 Execute Code (XIP)
 Could be replacement for ROM (but slower)
Manufacturers
 Intel, AMD, Fujitsu and Toshiba
Capacity
 Typically from a few KBs to 64MB

        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   5
                       All Rights Reserved.
NAND Flash
Reading like Hard Disk
  Multiples of 512 bytes at a time
  No XIP
Higher Density & Cheaper than NOR
Highly prone to errors at the bit level
  Needs software to handle bad blocks
Manufacturers: Samsung and Toshiba
Capacity: Typically from 8MB to 1024MB. Today,
even more
           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   6
                          All Rights Reserved.
Writing into Flash
Same for both NOR and NAND Flash
Sequence of Steps needed
Almost always involve an erase cycle
As Writing of Data means
  Flipping a bit to "0" or leaving it as a "1"
  Flipping a bit to "1" needs an erase cycle




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   7
                        All Rights Reserved.
MTD Subsystem
                  File I/O                        Raw I/O, MTD Utils
                                                                 User Space
                VFS Layer                                        Kernel Space



Individual File Systems


  mtdblock, FTL, NFTL           mtdchar            JFFS2    YAFFS2


                                MTD Core                                 MTD Layer
NAND Chip
 Drivers
                 NOR Chip Drivers
                                                   Map Drivers
                   (CFI, JEDEC)
                             Probe
                                                                 Hardware Space
                                            I/O
  NAND                   NOR
            © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>                        8
                           All Rights Reserved.
Map Drivers
Drivers to Map
  Flash Memory Range for CPU access
  Mark the Storage Partitions in the Kernel
       As no partition table on flash
       Shows up as /dev/mtd*
Example
  Browse the drivers/mtd/maps/ folder
Data Structures
  struct mtd_partition (Header: <linux/mtd/partitions.h>)
  struct map_info (Header: <linux/mtd/map.h>)
Header: <linux/mtd/mtd.h>
APIs
  int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
  int del_mtd_partitions(struct mtd_info *);
                     © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>            9
                                    All Rights Reserved.
NOR Chip Drivers
NOR Chip Drivers
  CFI specification
  JEDEC specification
CFI Command Sets
  0x01 – Intel & Sharp flash chips
  0x02 – AMD & Fujitsu flash chips
  0x03 – ST flash chips
All three are configurable in kernel

         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   10
                        All Rights Reserved.
NAND Chip Drivers
Drivers for NAND Controller to access NAND
Sources: drivers/mtd/nand/
A NAND Drive should do the following
  Add an entry to nand_flash_ids[] in drivers/mtd/nand/nand_ids.c
  Entries being
    Id Name, Device Id, Page Size, Erase Block Size, Chip Size, Options like
    Bus Width, …
  As, no automatic configuration support
  Specify its out-of-band (OOB) spare area layout through the
  “struct nand_ecclayout” (Header: <mtd/mtd-abi.h>)
    For ECCs, to implement error correction & detection
  Enable Error Management, in case NAND Controller doesn't do it
    Software ECC is implemented in drivers/mtd/nand/nand_ecc.c
               © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>               11
                              All Rights Reserved.
Kernel Configurations for MTD
CONFIG_MTD should be enabled
And whatever required under it, should be
enabled, e.g.
  Required NAND Driver, Or
  Required NOR Protocol
  etc




        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   12
                       All Rights Reserved.
File Systems for Flash
Typical Requirements
  Flash wear-levelling
  Less Writes / Erases
  Protect Data during Erase Cycles
  Bad Block Management (esp for NAND)
  Possibly compression (though preferred on read-only
  file systems only)
File Systems handling these
  JFFS2 (log-structured design & garbage collection)
  YAFFS2 (specifically designed for NAND constraints)

           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   13
                          All Rights Reserved.
Flash Tools
Useful tools to work with MTD layer
  flash_erase, flash_eraseall
  flash_lock, flash_unlock
  nanddump, nandwrite
  sumtool
  ...
Download from ftp://ftp.infradead.org/pub/mtd-utils
Tool to construct a JFFS2 file system image
  mkfs.jffs2

            © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   14
                           All Rights Reserved.
What all have we learnt?
W's of Memory Technology Devices
  About NOR & NAND
MTD Subsystem
MTD related Drivers
  Map, NOR Chip, NAND Chip
Flash File Systems
Flash Tools

        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   15
                       All Rights Reserved.
Any Queries?




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   16
               All Rights Reserved.
1 of 16

Recommended

Architecture Porting by
Architecture PortingArchitecture Porting
Architecture PortingAnil Kumar Pugalia
5K views12 slides
Introduction to Linux by
Introduction to LinuxIntroduction to Linux
Introduction to LinuxAnil Kumar Pugalia
4K views33 slides
BeagleBone Black Bootloaders by
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black BootloadersSysPlay eLearning Academy for You
4K views27 slides
Embedded Software Design by
Embedded Software DesignEmbedded Software Design
Embedded Software DesignAnil Kumar Pugalia
7K views29 slides
Linux Kernel Overview by
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel OverviewAnil Kumar Pugalia
26.7K views20 slides
Character Drivers by
Character DriversCharacter Drivers
Character DriversAnil Kumar Pugalia
56.7K views22 slides

More Related Content

What's hot

Kernel Debugging & Profiling by
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & ProfilingAnil Kumar Pugalia
6K views14 slides
Introduction to Linux by
Introduction to LinuxIntroduction to Linux
Introduction to LinuxAnil Kumar Pugalia
11.2K views32 slides
Block Drivers by
Block DriversBlock Drivers
Block DriversAnil Kumar Pugalia
38.4K views21 slides
BeagleBoard-xM Booting Process by
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessSysPlay eLearning Academy for You
3.8K views25 slides
Real Time Systems by
Real Time SystemsReal Time Systems
Real Time SystemsAnil Kumar Pugalia
17.7K views41 slides
Linux Porting by
Linux PortingLinux Porting
Linux PortingAnil Kumar Pugalia
17.5K views29 slides

What's hot(20)

Viewers also liked

Embedded I/O Management by
Embedded I/O ManagementEmbedded I/O Management
Embedded I/O ManagementAnil Kumar Pugalia
5.1K views22 slides
Interrupts by
InterruptsInterrupts
InterruptsAnil Kumar Pugalia
47.7K views18 slides
File Systems by
File SystemsFile Systems
File SystemsAnil Kumar Pugalia
18K views22 slides
Embedded Applications by
Embedded ApplicationsEmbedded Applications
Embedded ApplicationsAnil Kumar Pugalia
8.1K views19 slides
Timers by
TimersTimers
TimersAnil Kumar Pugalia
6.5K views7 slides
Processes by
ProcessesProcesses
ProcessesAnil Kumar Pugalia
7.5K views29 slides

Similar to Embedded Storage Management

建構嵌入式Linux系統於SD Card by
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card艾鍗科技
5.9K views39 slides
Presentation sparc m6 m5-32 server technical overview by
Presentation   sparc m6 m5-32 server technical overviewPresentation   sparc m6 m5-32 server technical overview
Presentation sparc m6 m5-32 server technical overviewsolarisyougood
2.4K views232 slides
Towards Software Defined Persistent Memory by
Towards Software Defined Persistent MemoryTowards Software Defined Persistent Memory
Towards Software Defined Persistent MemorySwaminathan Sundararaman
1.2K views21 slides
Memory Management in Android by
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
937 views30 slides
Memory Management in Android by
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
973 views27 slides
Mobile Hacking using Linux Drivers by
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversAnil Kumar Pugalia
6K views33 slides

Similar to Embedded Storage Management(20)

建構嵌入式Linux系統於SD Card by 艾鍗科技
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
艾鍗科技5.9K views
Presentation sparc m6 m5-32 server technical overview by solarisyougood
Presentation   sparc m6 m5-32 server technical overviewPresentation   sparc m6 m5-32 server technical overview
Presentation sparc m6 m5-32 server technical overview
solarisyougood2.4K views
Memory Management in Android by Opersys inc.
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.937 views
Memory Management in Android by Opersys inc.
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.973 views
LCE13: Android Graphics Upstreaming by Linaro
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
Linaro7.3K views
Memory Management in Android by Opersys inc.
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.1.3K views
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль... by Ingria. Technopark St. Petersburg
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Memory Management in Android by Opersys inc.
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.1.9K views
What Is The Memory Consumption, Look On Convolution Layers... by Heidi King
What Is The Memory Consumption, Look On Convolution Layers...What Is The Memory Consumption, Look On Convolution Layers...
What Is The Memory Consumption, Look On Convolution Layers...
Heidi King2 views
linux trim by bergwolf
linux trimlinux trim
linux trim
bergwolf667 views
Memory Management in TIZEN - Samsung SW Platform Team by Ryo Jin
Memory Management in TIZEN - Samsung SW Platform TeamMemory Management in TIZEN - Samsung SW Platform Team
Memory Management in TIZEN - Samsung SW Platform Team
Ryo Jin6.5K views
Comp 129 final exam 100% correct answers by ProfessorLance
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
ProfessorLance81 views
my Windows 7 info by isky guard
my Windows 7 infomy Windows 7 info
my Windows 7 info
isky guard2.1K views
Comp 129 final exam 100% correct answers by ProfessorLance
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
ProfessorLance72 views

More from Anil Kumar Pugalia

Processes by
ProcessesProcesses
ProcessesAnil Kumar Pugalia
7K views33 slides
System Calls by
System CallsSystem Calls
System CallsAnil Kumar Pugalia
4.2K views17 slides
Playing with R L C Circuits by
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C CircuitsAnil Kumar Pugalia
2.8K views17 slides
Shell Scripting by
Shell ScriptingShell Scripting
Shell ScriptingAnil Kumar Pugalia
6.2K views27 slides
References by
ReferencesReferences
ReferencesAnil Kumar Pugalia
21.8K views8 slides
Functional Programming with LISP by
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISPAnil Kumar Pugalia
6.1K views23 slides

Recently uploaded

How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...Vadym Kazulkin
70 views64 slides
handbook for web 3 adoption.pdf by
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdfLiveplex
19 views16 slides
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze by
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeDigital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeNUS-ISS
19 views47 slides
How the World's Leading Independent Automotive Distributor is Reinventing Its... by
How the World's Leading Independent Automotive Distributor is Reinventing Its...How the World's Leading Independent Automotive Distributor is Reinventing Its...
How the World's Leading Independent Automotive Distributor is Reinventing Its...NUS-ISS
15 views25 slides
PharoJS - Zürich Smalltalk Group Meetup November 2023 by
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023Noury Bouraqadi
113 views17 slides
Roadmap to Become Experts.pptx by
Roadmap to Become Experts.pptxRoadmap to Become Experts.pptx
Roadmap to Become Experts.pptxdscwidyatamanew
11 views45 slides

Recently uploaded(20)

How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin70 views
handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex19 views
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze by NUS-ISS
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeDigital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
NUS-ISS19 views
How the World's Leading Independent Automotive Distributor is Reinventing Its... by NUS-ISS
How the World's Leading Independent Automotive Distributor is Reinventing Its...How the World's Leading Independent Automotive Distributor is Reinventing Its...
How the World's Leading Independent Automotive Distributor is Reinventing Its...
NUS-ISS15 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi113 views
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu... by NUS-ISS
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
NUS-ISS32 views
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 views
RADIUS-Omnichannel Interaction System by RADIUS
RADIUS-Omnichannel Interaction SystemRADIUS-Omnichannel Interaction System
RADIUS-Omnichannel Interaction System
RADIUS14 views
Web Dev - 1 PPT.pdf by gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet52 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10165 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab11 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst449 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software91 views
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV by Splunk
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
Splunk86 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price12 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291614 views

Embedded Storage Management

  • 1. Embedded Storage Management © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
  • 2. What to Expect? W's of Memory Technology Devices MTD Subsystem MTD related Drivers Flash File Systems Flash Tools © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
  • 3. Storage Timeline Traditionally (for most of past 20+ years) ROM – For read-only storage NVRAM – For read-write storage Equating with today's technology Low-density Costlier Latest trend is flash technology devices More commonly referred as MTD Comes as NOR, NAND, some exotic varieties Best suited for Embedded Systems © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
  • 4. What are Memory Technology Devices? Embedded Flash Memory Contains Large Erase Blocks 32KB to 128KB Maintains three main Operations Read, Write, Erase from Erase Block Bad Erase Blocks to be dealt by software Erase Blocks get worn out after some erase cycles © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
  • 5. NOR Flash Reading like RAM Random Access Execute Code (XIP) Could be replacement for ROM (but slower) Manufacturers Intel, AMD, Fujitsu and Toshiba Capacity Typically from a few KBs to 64MB © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
  • 6. NAND Flash Reading like Hard Disk Multiples of 512 bytes at a time No XIP Higher Density & Cheaper than NOR Highly prone to errors at the bit level Needs software to handle bad blocks Manufacturers: Samsung and Toshiba Capacity: Typically from 8MB to 1024MB. Today, even more © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
  • 7. Writing into Flash Same for both NOR and NAND Flash Sequence of Steps needed Almost always involve an erase cycle As Writing of Data means Flipping a bit to "0" or leaving it as a "1" Flipping a bit to "1" needs an erase cycle © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
  • 8. MTD Subsystem File I/O Raw I/O, MTD Utils User Space VFS Layer Kernel Space Individual File Systems mtdblock, FTL, NFTL mtdchar JFFS2 YAFFS2 MTD Core MTD Layer NAND Chip Drivers NOR Chip Drivers Map Drivers (CFI, JEDEC) Probe Hardware Space I/O NAND NOR © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
  • 9. Map Drivers Drivers to Map Flash Memory Range for CPU access Mark the Storage Partitions in the Kernel As no partition table on flash Shows up as /dev/mtd* Example Browse the drivers/mtd/maps/ folder Data Structures struct mtd_partition (Header: <linux/mtd/partitions.h>) struct map_info (Header: <linux/mtd/map.h>) Header: <linux/mtd/mtd.h> APIs int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); int del_mtd_partitions(struct mtd_info *); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
  • 10. NOR Chip Drivers NOR Chip Drivers CFI specification JEDEC specification CFI Command Sets 0x01 – Intel & Sharp flash chips 0x02 – AMD & Fujitsu flash chips 0x03 – ST flash chips All three are configurable in kernel © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
  • 11. NAND Chip Drivers Drivers for NAND Controller to access NAND Sources: drivers/mtd/nand/ A NAND Drive should do the following Add an entry to nand_flash_ids[] in drivers/mtd/nand/nand_ids.c Entries being Id Name, Device Id, Page Size, Erase Block Size, Chip Size, Options like Bus Width, … As, no automatic configuration support Specify its out-of-band (OOB) spare area layout through the “struct nand_ecclayout” (Header: <mtd/mtd-abi.h>) For ECCs, to implement error correction & detection Enable Error Management, in case NAND Controller doesn't do it Software ECC is implemented in drivers/mtd/nand/nand_ecc.c © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.
  • 12. Kernel Configurations for MTD CONFIG_MTD should be enabled And whatever required under it, should be enabled, e.g. Required NAND Driver, Or Required NOR Protocol etc © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 12 All Rights Reserved.
  • 13. File Systems for Flash Typical Requirements Flash wear-levelling Less Writes / Erases Protect Data during Erase Cycles Bad Block Management (esp for NAND) Possibly compression (though preferred on read-only file systems only) File Systems handling these JFFS2 (log-structured design & garbage collection) YAFFS2 (specifically designed for NAND constraints) © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 13 All Rights Reserved.
  • 14. Flash Tools Useful tools to work with MTD layer flash_erase, flash_eraseall flash_lock, flash_unlock nanddump, nandwrite sumtool ... Download from ftp://ftp.infradead.org/pub/mtd-utils Tool to construct a JFFS2 file system image mkfs.jffs2 © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 14 All Rights Reserved.
  • 15. What all have we learnt? W's of Memory Technology Devices About NOR & NAND MTD Subsystem MTD related Drivers Map, NOR Chip, NAND Chip Flash File Systems Flash Tools © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 15 All Rights Reserved.
  • 16. Any Queries? © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 16 All Rights Reserved.