NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

TI81XX PSP NAND Driver User Guide

From Texas Instruments Wiki
Jump to: navigation, search
TIBanner.png
Linux PSP NAND Driver Guide
Linux PSP
IMPORTANT

TI81XX refers to TI816X, TI814X and TI813X.

Introduction[edit]

The general-purpose memory controller (GPMC) is an unified memory controller dedicated to interfacing external memory devices:

  • Asynchronous SRAM-like memories and application-specific integrated circuit (ASIC) devices
  • Asynchronous, synchronous, and page mode (only available in non-multiplexed mode) burst NOR flash devices
  • NAND Flash
  • Pseudo-SRAM devices


Features[edit]

Hardware Features[edit]

The GPMC can access various external devices through the L3 Slow Interconnect. The flexible programming model allows a wide range of attached device types and access schemes.

The GPMC consists of six blocks:

  • Interconnect port interface
  • Address decoder, GPMC configuration, and chip-select configuration register file
  • Access engine
  • Prefetch and write-posting engine
  • Error correction code engine (ECC)
  • External device/memory port interface

AM335x Memory subsystem.jpg


Software Features[edit]

  • Nand Types
    8-bit NAND
    16-bit NAND
  • ECC Schemes
    1-bit Hamming S/W
    1-bit Hamming H/W
    BCH-8 (default)
    BCH-4 (not supported)

Note: Due to constrain of metadata layout in OOB area, only '1-bit Hamming H/W' or '1-bit Hamming S/W' ECC schemes can be used with JFFS2 File-system

  • Transfer Modes
    Polled
    Prefetch Polled (default)
    Prefetch IRQ


ECC schemes usage table[edit]

ECC scheme used by different components:

ECC schemes usage table
Component Default ECC scheme used by the component ECC scheme to be used to flash the component ECC schemes supported by the component
ROM
BCH8 NA
BCH8
U-boot BCH8
BCH8 BCH8 (default) / 1-bit HW
Linux BCH8 BCH8 BCH8 (default) / 1-bit HW
File System NA BCH8 NA
Environment variables NA BCH8 NA


Driver Configuration[edit]

To enable/disable NAND support, start the Linux Kernel Configuration tool:


host$ make menuconfig 


Select Device Drivers from the main menu.

    ...
    ...
    [ ] Networking support --->
    Device Drivers --->
    File systems --->
    ...
    ...
  • Enable below Configs to enable MTD Support along with MTD nand driver support
Device Drivers  ---> 
  <*> Memory Technology Device (MTD) support  --->
            [*]   Command line partition table parsing
            <*>   Direct char device access to MTD devices
            <*>   Caching block device access to MTD devices
            <*>   NAND Device Support  --->
                        <*>    NAND Flash device on OMAP2 and OMAP3
            <*>   Enable UBI - Unsorted block images  --->

Module Build[edit]

Module build for the NAND driver is supported. To do this, make the changes as below

Device Drivers  ---> 
  <*> Memory Technology Device (MTD) support  --->
            [*]   Command line partition table parsing
            <*>   Direct char device access to MTD devices
            <*>   Caching block device access to MTD devices
            <M>   NAND Device Support  --->
                        <M>    NAND Flash device on OMAP2 and OMAP3
            <*>   Enable UBI - Unsorted block images  --->

For loading modules follow the steps below

      target$ insmod drivers/mtd/nand/nand_ecc.ko 
     target$ insmod drivers/mtd/nand/nand_ids.ko
     target$ insmod drivers/mtd/nand/nand.ko
     target$ insmod drivers/mtd/devices/omap2_elm.ko
     target$ insmod drivers/mtd/nand/omap2.ko

Device Interface[edit]

You always need a pair mtdx/mtdblockx of device nodes to access your flash file system. The mtdx is used to access the raw flash device, the mtdblockx is used to access the disk/block established in the raw flash.

Use MTD-Utils user space tools to access NAND partition from Linux console

Below are some of the examples for accessing NAND partitions

  • Erase the nand partition (assume partition 3)
    target$ flash_eraseall /dev/mtd3
  • write a file to nand partition (assume partition 4)
    target$ nandwrite -p /dev/mtd4 u-boot.img
  • Mount nand partition from U-Boot as Root file system partition for Linux
    u-boot> setenv bootargs 'console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=<partion_id>,2048 noinitrd rootfstype=ubifs mem=256M rootwait=1'


The value of PARTITION_ID depends on MTD device which holds the root filesystem. The below example assumes UBIFS file system is flashed on MTD partition 7 and respective device is enabled on the board.

    u-boot> setenv bootargs 'console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 noinitrd rootfstype=ubifs mem=256M rootwait=1'



Proc Interface[edit]

The /proc/mtd kernel interface is a status interface. A lot of useful information about the nand system can be found in the /proc/mtd file.

  • Use /proc/mtd to get information on how many partitions are currently configured by the kernels flash driver.
    target$ cat /proc/mtd

You should see output similar to:

    target$ cat /proc/mtd
  dev:    size   erasesize  name
  mtd0: 00020000 00020000 "SPL"
  mtd1: 00020000 00020000 "SPL.backup1"
  mtd2: 00020000 00020000 "SPL.backup2"
  mtd3: 00020000 00020000 "SPL.backup3"
  mtd4: 001e0000 00020000 "U-Boot"
  mtd5: 00020000 00020000 "U-Boot Env"
  mtd6: 00500000 00020000 "Kernel"
  mtd7: 0f880000 00020000 "File System"



E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article TI81XX PSP NAND Driver User Guide here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article TI81XX PSP NAND Driver User Guide here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article TI81XX PSP NAND Driver User Guide here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article TI81XX PSP NAND Driver User Guide here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article TI81XX PSP NAND Driver User Guide here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article TI81XX PSP NAND Driver User Guide here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article TI81XX PSP NAND Driver User Guide here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article TI81XX PSP NAND Driver User Guide here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article TI81XX PSP NAND Driver User Guide here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity