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.

Linux: my beagle bone spl boot-loader not able to load uboot and kernel

Tool/software: Linux

Hi All,

Facing a problem while using micron ram with beagle bone black(am33xx), using DDR3micron ram(MT41K256M16) need to change in spl boot-loader as given on below link.

http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_Tuning_the_DDR3_Timings_on_BeagleBoneBlack#Determine_Basic_Preliminary_Timings

void sdram_init(void)
{
   volatile int myVar = 1;
   if (read_eeprom() < 0)
      puts("Could not get board ID.\n");

   if (board_is_evm_sk()) {
      /*
       * EVM SK 1.2A and later use gpio0_7 to enable DDR3.
       * This is safe enough to do on older revs.
       */
      gpio_request(GPIO_DDR_VTT_EN, "ddr_vtt_en");
      gpio_direction_output(GPIO_DDR_VTT_EN, 1);
   }

   if (board_is_icev2()) {
      gpio_request(ICE_GPIO_DDR_VTT_EN, "ddr_vtt_en");
      gpio_direction_output(ICE_GPIO_DDR_VTT_EN, 1);
   }

   if (board_is_evm_sk())
      config_ddr(303, &ioregs_evmsk, &ddr3_data,
            &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
   else if (board_is_bone_lt())
      config_ddr(400, &ioregs_bonelt,
            &ddr3_beagleblack_data,
            &ddr3_beagleblack_cmd_ctrl_data,
            &ddr3_beagleblack_emif_reg_data, 0);
   else if (board_is_evm_15_or_later())
      config_ddr(303, &ioregs_evm15, &ddr3_evm_data,
            &ddr3_evm_cmd_ctrl_data, &ddr3_evm_emif_reg_data, 0);
   else if (board_is_icev2())
      config_ddr(400, &ioregs_evmsk, &ddr3_icev2_data,
            &ddr3_icev2_cmd_ctrl_data, &ddr3_icev2_emif_reg_data,
            0);
   else
   {
   // config_ddr(266, &ioregs, &ddr2_data, &ddr2_cmd_ctrl_data, &ddr2_emif_reg_data, 0);
#if 1
     -> adding this in  /board/ti/am335x/board.c using ti-processor-sdk-linux-am335x-evm-03.00.00.04
      //enable_i2c0_pin_mux();
      //i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
      config_ddr(400, MT41K256M16HA125E_IOCTRL_VALUE, &ddr3_bbb_data, &ddr3_bbb_cmd_ctrl_data, &ddr3_bbb_emif_reg_data, 0);

      while(myVar);
#endif
   }

in  this file ./arch/arm/include/asm/arch-am33xx/ddr_defs.h i adding Micron reg

* Micron MT41K256M16HA-125:E - BBBlack */
#define MT41K256M16HA125E_EMIF_READ_LATENCY 0x100007
#define MT41K256M16HA125E_EMIF_TIM1 0x0AAAD4DB
#define MT41K256M16HA125E_EMIF_TIM2 0x266B7FDA
#define MT41K256M16HA125E_EMIF_TIM3 0x501F867F
#define MT41K256M16HA125E_EMIF_SDCFG 0x61C05332
#define MT41K256M16HA125E_EMIF_SDREF 0x00000C30
#define MT41K256M16HA125E_ZQ_CFG 0x50074BE4
#define MT41K256M16HA125E_DLL_LOCK_DIFF 0x1
#define MT41K256M16HA125E_RATIO 0x80
#define MT41K256M16HA125E_INVERT_CLKOUT 0x00
#define MT41K256M16HA125E_RD_DQS 0x3A
#define MT41K256M16HA125E_WR_DQS 0x45
#define MT41K256M16HA125E_PHY_WR_DATA 0x7C
#define MT41K256M16HA125E_PHY_FIFO_WE 0x96
#define MT41K256M16HA125E_IOCTRL_VALUE 0x18B
Adding struct to  board file /board/ti/am335x/board.c

static const struct ddr_data ddr3_bbb_data = {
.datardsratio0 = MT41K256M16HA125E_RD_DQS,
.datawdsratio0 = MT41K256M16HA125E_WR_DQS,
.datafwsratio0 = MT41K256M16HA125E_PHY_FIFO_WE,
.datawrsratio0 = MT41K256M16HA125E_PHY_WR_DATA,
//.datadldiff0 = PHY_DLL_LOCK_DIFF,
};
static const struct cmd_control ddr3_bbb_cmd_ctrl_data = {
.cmd0csratio = MT41K256M16HA125E_RATIO,
//.cmd0dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
.cmd0iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
.cmd1csratio = MT41K256M16HA125E_RATIO,
//.cmd1dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
.cmd1iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
.cmd2csratio = MT41K256M16HA125E_RATIO,
//.cmd2dldiff = MT41K256M16HA125E_DLL_LOCK_DIFF,
.cmd2iclkout = MT41K256M16HA125E_INVERT_CLKOUT,
};
static struct emif_regs ddr3_bbb_emif_reg_data = {
.sdram_config = MT41K256M16HA125E_EMIF_SDCFG,
.ref_ctrl = MT41K256M16HA125E_EMIF_SDREF,
.sdram_tim1 = MT41K256M16HA125E_EMIF_TIM1,
.sdram_tim2 = MT41K256M16HA125E_EMIF_TIM2,
.sdram_tim3 = MT41K256M16HA125E_EMIF_TIM3,
.zq_config = MT41K256M16HA125E_ZQ_CFG,
.emif_ddr_phy_ctlr_1 = MT41K256M16HA125E_EMIF_READ_LATENCY | PHY_EN_DYN_PWRDN,
};
After doing all these changes compiling (spl&uboot) boot-loader and copy that MLO and uboot.img into sdcard and connected to beagle bone black,  press switch(S2) to boot from connected sdcard.
its showing nothing on uart0, without sdcard its showing cccccccccccccccccccccccccccccc on uart0.
emmc not connected with beagle board.
Please suggest me how to debug this issue.
  • Hi Shilesh,

    From what I understand you are using BeagleBoneBlack with AM335x PSDK 3.00.00.04. In this case you do not need to follow the wiki and change DDR3 settings. The wiki should be followed only if you are using custom board with DDR3 chips different than these used in BeagleBoneBlack.

    AM335x PSDK 3.00.00.04 support BeagleBoneBlack by default, you should not change the u-boot source code to be able to boot.

    Regards,
    Pavel
  • Thanks Pavel for you response,

    Yes, i am using a custom board smiler like beagle bone black , generally beagle bone black used Kingston DDR3 , but  on my board  i am using micron(MT41K256M16) DDR3 in that case i need to change in spl boot-loader as per given link.

    on link ti told locate s_init function in ./board/ti/am335xx/board.c , but s_init function located in ./arch/arm/cpu/armv7/am33xx/board.c file so  i need to change in that file. is it  correct or not.

    please update me. we also send a board to ti for debug this issue.

     

  • Shilesh Babu said:
    generally beagle bone black used Kingston DDR3 , but  on my board  i am using micron(MT41K256M16) DDR3 in that case i need to change in spl boot-loader as per given link.

    I can not agree with that statement. I have two BeagleBoneBlack boards with me, both are with Micron MT41K256M16HA-125E DDR3 chips. And both can boot up fine with default AM335x PSDK 3.00.00.04.

    Also the wiki page that you are looking into states the same:

    IMPORTANT

    The timings above were derived for the Micron MT41K256M16HA-125:E which is used on the BeagleBoneBlack. A different memory device will require different timing parameters than used above

    For non-booting custom board, I would suggest you to start with the below wiki:

    Regards,
    Pavel

     
     

     

  • thanks to correct me.
    i would like to ask you, my board connected with power supply its showing cccccccccccc on uart0. it means rom code is running, but once i insert flashed sdcard to board its showing nothing on uart0, please can you tell me what are the possibilities so i can debug this issue.
  • Shilesh,

    How do you flash your SD card? Do you use PSDK/bin/create-sdcard.sh script? Do you configure your boot pins for MMC/SD boot?

    The wiki page I provided to you is still valid for this case, you can refer to it for debug hints.

    Regards,
    Pavel
  • Yes, i used PSDK/bin/create-sdcard.sh script to make sdcard and pressed switch(s2) to boot form sd boot mode, same card i checked on BeagleBone Black Rev C with kingston DDR3. its working fine.
  • Shilesh Babu said:
    pressed switch(s2) to boot form sd boot mode

    I am not sure what s2 on your custom board does. I would suggest you again to check your boot pins, these should be configured for MMC/SD boot.

    Do you have any changes in MMC/SD interface between your custom board and BBB?

    Regards,
    Pavel