This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to modify External Memory timing setup for DDR2 at 240MHz

Other Parts Discussed in Thread: AM1810, OMAPL138, AM1808, OMAP-L138

  // External Memory Timing Setup
  if (status == E_PASS)
  {
    #if defined(AM1810)
      // Timings for DDR2 at 150 MHz
      status |= DEVICE_ExternalMemInit(0x00000047, 0x08934832, 0x204929C9, 0x0C12C722, 0x00000406, 0x00000000);
    #elif defined(OMAPL138_LCDK)
      // Timings for DDR2 at 150 MHz
      status |= DEVICE_ExternalMemInit(0x000000C5, 0x00134832, 0x264A3209, 0x3C14C722, 0x00000492, 0x00000000);
    #elif defined(C6748_LCDK)
      // Timings for DDR2 at 150 MHz
      status |= DEVICE_ExternalMemInit(0x000000C5, 0x00134832, 0x264A3209, 0x3C14C722, 0x00000492, 0x00000000);
    #else
      // Timings for mDDR at 150 MHz
      status |= DEVICE_ExternalMemInit(0x000000C4, 0x0A034622, 0x1C912A08, 0x3811C700, 0x00000494, 0x00000000);
    #endif
  }
#endif

  • And also what does this mean ?

    #define DEVICE_UART_PERIPHNUM         (2)

  • Hi,

    #define DEVICE_UART_PERIPHNUM         (2)

    This definition for selecting as "UART2"

    If you are using UART0 for serial flash utility then you need to change like this,

    #define DEVICE_UART_PERIPHNUM         (0)

        #if defined(AM1810)
          // Timings for DDR2 at 150 MHz
          status |= DEVICE_ExternalMemInit(0x00000047, 0x08934832, 0x204929C9, 0x0C12C722, 0x00000406, 0x00000000);

    If you are using "targetType" as "AM1810" then you need to change DDR/mDDR register (SDCR, SDTIMR etc.,) settings in this API   "DEVICE_ExternalMemInit"

    Refer the below location in serial flash utility source code.

    OMAPL138/Common/include/device.h

    extern __FAR__ Uint32  DEVICE_ExternalMemInit(Uint32 ddrphycr, Uint32 sdcr, Uint32 sdtimr, Uint32 sdtimr2, Uint32 sdrcr, Uint32 sdcr2);

  • My Target Device is AM1808 not AM1810.

  • Can you tell me step by step procedure to Modify the files?

    • DDR Configuration
      • OMAP-L138/Common/src/device.c: Modify the parameters passed to the function DEVICE_ExternalMemInit to match the DDR timing requirements for the custom board
    • UART Settings UART 2 is required
      • OMAP-L138/Common/include/device_uart.h: Modify the #define DEVICE_UART_PERIPHNUM to set which UART is connected to the host PC.
      • Note that flow control is not used, so only the RX and TX lines need to be connected for boot and flashing purposes.
    • NAND Settings 8bit width
      • OMAP-L138/Common/include/device_async_mem.h: Modify the #define DEVICE_ASYNC_MEM_NANDBOOT_BUSWIDTH to match the bus width of your NAND
    • PLL Settings: 24HZ frequency

    For DDR Configuration

        #if defined(AM1810)
          // Timings for DDR2 at 150 MHz
          status |= DEVICE_ExternalMemInit(0x00000047, 0x08934832, 0x204929C9, 0x0C12C722, 0x00000406, 0x00000000);
        
    #elif defined(OMAPL138_LCDK) // Timings for DDR2 at 150 MHz status |= DEVICE_ExternalMemInit(0x000000C5, 0x00134832, 0x264A3209, 0x3C14C722, 0x00000492, 0x00000000);
    #elif defined(C6748_LCDK) // Timings for DDR2 at 150 MHz status |= DEVICE_ExternalMemInit(0x000000C5, 0x00134832, 0x264A3209, 0x3C14C722, 0x00000492, 0x00000000);
    #else // Timings for mDDR at 150 MHz status |= DEVICE_ExternalMemInit(0x000000C4, 0x0A034622, 0x1C912A08, 0x3811C700, 0x00000494, 0x00000000);

    Since my device is AM1808, so where can  i find the address to modify it here?


  • Hi,

    UART Settings UART 2 is required

    NAND Settings 8bit width

    PLL Settings: 24HZ frequency


    It seems to you no need to change anything because by default it exist for your requirement such as UART2, 24MHz ref freq, 16 bit bus data width for OMAPL138_LCDK board and others(AM18xx) 8 bit , etc.

    You have to match the DDR parameters for your board.

  • Where can i find my DDR parameters ?

  • Hi,

    Refer the below location in serial flash utility source code.

    OMAPL138/Common/include/device.h

    extern __FAR__ Uint32  DEVICE_ExternalMemInit(Uint32 ddrphycr, Uint32 sdcr, Uint32 sdtimr, Uint32 sdtimr2, Uint32 sdrcr, Uint32 sdcr2);

    Refer your DDR data sheet and modify DDR parameters (registers such as SDRCR, SDCR,SDCR2,SDTIMR,SDTIMR2)  in below mentioned sections (shaded color for your AM1808 processor.)

      // External Memory Timing Setup
      if (status == E_PASS)
      {
        #if defined(AM1810)
          // Timings for DDR2 at 150 MHz
          status |= DEVICE_ExternalMemInit(0x00000047, 0x08934832, 0x204929C9, 0x0C12C722, 0x00000406, 0x00000000);
        #elif defined(OMAPL138_LCDK)
          // Timings for DDR2 at 150 MHz
          status |= DEVICE_ExternalMemInit(0x000000C5, 0x00134832, 0x264A3209, 0x3C14C722, 0x00000492, 0x00000000);
        #elif defined(C6748_LCDK)
          // Timings for DDR2 at 150 MHz
          status |= DEVICE_ExternalMemInit(0x000000C5, 0x00134832, 0x264A3209, 0x3C14C722, 0x00000492, 0x00000000);
        #else
          // Timings for mDDR at 150 MHz
          status |= DEVICE_ExternalMemInit(0x000000C4, 0x0A034622, 0x1C912A08, 0x3811C700, 0x00000494, 0x00000000);
        #endif
      }
    #endif

  • Is this ok ?

    // Timings for mDDR at 150 MHz
          status |= DEVICE_ExternalMemInit(0x000000C6, 0x00130A32, 0x3CDB5389, 0x3C21C722, 0x00000750, 0x00000000);