The DDR driver provides API to configure the DDR module.
Features Supported
- Ability to enable/disable DDR support in your application
- Ability to specify the DDR config generated using the "DDR SUBSYSTEM REGISTER CONFIGURATION" tool
- Ability to enable/disable inline ECC (1b and 2b) in the application
- Add regions for enabling inline ECC
SysConfig Features
- Note
- It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
- Ability to specify the DDR config generated using the "DDR SUBSYSTEM REGISTER CONFIGURATION" tool
- Enables DDR, EMIF module clock when DDR module is selected
- Toggle inline ECC functionality
- Add regions for which inline ECC needs to be enabled
Features not Supported
NA
Creating your own DDR config file
Step 1: Generate a DDR config file for your EVM
- Goto https://dev.ti.com/sysconfig
- Select "Software Product" as "DDR SUBSYSTEM REGISTER CONFIGURATION"
- Select "Device" of interest, AM64X in this case.
DDR SUBSYSTEM REGISTER CONFIGURATION Tool
- Configure the DDR parameters using the tool
- Save the generated
board_ddrReginit.h
in your project workspace or work area
Configure and save the generated file
Step 2: Add the generated DDR config file to your project
Add DDR via SysConfig
- Specify the path to the generated
board_ddrReginit.h
file including the filename in the sysconfig text box as shown above
- Make sure to use forward slash "/" in the file path so that this will work with linux as well as windows build
- Make sure that path to this is file set in your application include path, as needed.
- Save the sysconfig project and build your application
Creating your own LPDDR config file
Step 1: Generate a LPDDR config file for your EVM
- Goto https://dev.ti.com/sysconfig
- Select "Software Product" as "DDR SUBSYSTEM REGISTER CONFIGURATION"
- Select "Device" of interest, AM64X in this case.
DDR SUBSYSTEM REGISTER CONFIGURATION Tool
- Configure the LPDDR parameters using the tool
- Save the generated
board_ddrReginit.h
in your project workspace or work area. Rename the file as "board_lpddrReginit.h".
Configure and save the generated file
Step 2: Add the generated LPDDR config file to your project
Add DDR via SysConfig
- Specify the path to the generated
board_lpddrReginit.h
file including the filename in the sysconfig text box as shown above
- Make sure to use forward slash "/" in the file path so that this will work with linux as well as windows build
- Make sure that path to this is file set in your application include path, as needed.
- Save the sysconfig project and build your application
Important Usage Guidelines
- Please read the application note https://www.ti.com/lit/pdf/spracu1 for projects having own board design with DDR.
- Ideally DDR should be enabled in the bootloader application and the SDK bootloader by default enables DDR by default.
Usage Overview
Include the below file to access the APIs
#include <stdio.h>
#include "drivers/ddr/v0/soc/am64x_am243x/board_ddrReginit.h"
{
.clk2Freq = DDRSS_PLL_FREQUENCY_2,
.ddrssCtlReg = DDRSS_ctlReg,
.ddrssPhyIndepReg = DDRSS_phyIndepReg,
.ddrssPhyReg = DDRSS_phyReg,
.ddrssCtlRegNum = DDRSS_ctlRegNum,
.ddrssPhyIndepRegNum = DDRSS_phyIndepRegNum,
.ddrssPhyRegNum = DDRSS_phyRegNum,
.ddrssCtlRegCount = DDRSS_CTL_REG_INIT_COUNT,
.ddrssPhyIndepRegCount = DDRSS_PHY_INDEP_REG_INIT_COUNT,
.ddrssPhyRegCount = DDRSS_PHY_REG_INIT_COUNT,
.fshcount = DDRSS_PLL_FHS_CNT,
.enableEccFlag = 0,
.eccRegion = NULL,
};
Initialize DDR
Example Usage
NA
API
APIs for DDR