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.

StarterWare GPMC

From Texas Instruments Wiki
Jump to: navigation, search

TIBanner.png

Introduction[edit]

GPMC(General Purpose Memory Controller)is an unified memory controller to interface external memory devices like NAND, NOR, Asynchronous SRAM etc. By configuring the bit fields in the GPMC registers, the application can be able to access the entioned type of device through GPMC.GPMC has the Error correction code(ECC) engine which can be used to calculate the ECC for writing and reading from the NAND.GPMC supports diffrent ECC algorithms like Hamming code, BCH 4, 8 and 16 Bit. To increase NAND read/write speed, GPMC has Prefetch and write posting engine which can be used read from or write to in a buffered manner. GPMC has on DMA event which can be used along with prefetch and write posting engine to increase the NAND read/write performance.

Programming[edit]

Following sections explains the progrmming sequence to be followed to access diffrent devicess from GPMC.

Programming the GPMC for NAND[edit]

GPMC For Read/Write Access[edit]

Following are the STPES to configure the GPMC for NAND access ---

  • Pin multiplexing registers to enable the NAND pins and a standard configuration is provided as part of the function NANDPinMuxSetup() in platform directory.
  • The GPMC is placed in local reset state using GPMCModuleSoftReset() and waited till the modele is out of reset using GPMCModuleResetStatusGet().
  • Enable/Disable the interrupt using GPMCIntDisable() and GPMCIntEnable().
  • Select the waitpin using GPMCWaitPinSelect().
  • Select the waitpin polarity using GPMCWaitPinPolaritySelect().
  • Select the write protect pin polarity using GPMCWriteProtectPinLevelCtrl().
  • Enable the limited address device support using GPMCLimitedAddrDevSupportConfig().
  • Disable the chip select (on which device is interface) before configuring using GPMCCSConfig().
  • Select the Signals timing latencies scalar factor using GPMCTimeParaGranularitySelect().
  • Select the attached device type to NAND flash like using GPMCDevTypeSelect().
  • Select the device size( i.e 8 Bit or 16 Bit) using GPMCDevSizeSelect().
  • Select the Address and data multiplexed protocol to non-multiplexed using GPMCAddrDataMuxProtocolSelect().
  • Select the write and read type to async using GPMCWriteTypeSelect().
  • Select the write and read access type to async using GPMCAccessTypeSelect().
  • Set the chip select base address using GPMCBaseAddrSet().
  • Set the Chip-select mask address or CS region size using GPMCMaskAddrSet().
  • Set the timing values for CS using GPMC_CS_TIMING_CONFIG macro and GPMCCSTimingConfig().
  • Set the timing values for ADV using GPMC_ADV_TIMING_CONFIG macro and GPMCADVTimingConfig().
  • Set the timing values for WE and OE using GPMC_WE_OE_TIMING_CONFIG macro and GPMCWEAndOETimingConfig().
  • Set the read access time and read/write cycle time using GPMC_RDACCESS_CYCLETIME_TIMING_CONFIG and GPMCRdAccessAndCycleTimeTimingConfig().
  • Set the bus turn around time and cycle to cycle time using GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG macro and GPMCycle2CycleAndTurnArndTimeTimingConfig().
  • Set the write access time and Data on ADMux timing using GPMCWrAccessAndWrDataOnADMUXBusTimingConfig().
  • Enable the chip select (on which device is interface) using GPMCCSConfig().

With Above initialization application can access the NAND for read/write by sending the command, address and data using GPMCSNANDCmdWrite(), GPMCNANDAddrWrite(), GPMCNANDDataWrite() and GPMCNANDDataRead().

GPMC for NAND ECC[edit]

To use the ECC for read/write, need to initialize the GPMC for ECC. Following are the steps to initialize the GPMC for ECC ---

  • Select the ECC algorithm using GPMCECCAlgoSelect().
  • Depending on the ECC algorithm, GPMC initialization steps will vary.
  • If algorithm is Hamming code, then
    • Select the columns(on which ECC has to calculate) as ECC columns using GPMCECCColumnSelect().
    • Select the chip select where ECC is computed using GPMCECCCSSelect().
    • Disable the ECC calculation using GPMCECCDisable().
    • Select the ECC result register using GPMCECCResultRegSelect().
    • Clear the ECC result register using GPMCECCResultRegClear().
    • Set the ECC size 0 and size 1 value to 0xFF using GPMCECCSizeValSet().
    • Select the ECC size for the ECC result register using GPMCECCResultSizeSelect()
  • If algorithm is BCH, then
    • Set the ECC error correction capability using GPMCECCBCHErrCorrectionCapSelect().
    • Select the columns(on which ECC has to calculate) as ECC columns using GPMCECCColumnSelect().
    • Select the chip select where ECC is computed using GPMCECCCSSelect().
    • Select the number of sectors to process with the BCH algo as 512 bytes using GPMCECCBCHNumOfSectorsSelect().
    • Disable the ECC calculation using GPMCECCDisable().
    • Select the ECC result register using GPMCECCResultRegSelect().
    • Clear the ECC result register using GPMCECCResultRegClear().
    • Set the ECC size 0 and size 1 value to 0xFF using GPMCECCSizeValSet().
    • Select the ECC size for the ECC result register using GPMCECCResultSizeSelect()

GPMC for prefetch and write post engine for read/write access[edit]

  • Ensure that engine is stopped using GPMCPrefetchEngineStatusGet().
  • Select the chip select associated with NAND using GPMCPrefetchCSSelect().
  • Select the access mode (read/write) using GPMCPrefetchAccessModeSelect().
  • Select the FIFO thershold value for DMA or interrupt using GPMCPrefetchFifoThrldValSet().
  • Select the transfer count value using GPMCPrefetchTrnsCntValSet().
  • Select the syncmode(when the engine starts the access to CS) using GPMCPrefetchSyncModeConfig().
  • Disable the cycle optimization for prefetcfh engine using GPMCPrefetchAccessCycleOptConfig().
  • Select the synchronization type(i.e DMA or interrupt) using GPMCPrefetchSyncTypeSelect().
  • If DMA sync type is select, Do the DMA related initializations and enble the DMA channel for transfer.
  • Enable the engine using GPMCPrefetchEngineEnable().
  • Start the engine using GPMCPrefetchEngineStart().
  • After engine is started, If sync type is DMA, then DMA event is generated and data is tranffered using DMA. If sync type is interrupt, interupt is generated.
  • After the transfer, stop the engine using GPMCPrefetchEngineStop().
  • Disable the engine using GPMCPrefetchEngineDisable().
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 StarterWare GPMC 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 StarterWare GPMC here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article StarterWare GPMC here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article StarterWare GPMC here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article StarterWare GPMC here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare GPMC here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article StarterWare GPMC here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article StarterWare GPMC here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article StarterWare GPMC 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