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.

AM3352 Booting problem

Other Parts Discussed in Thread: AM3352

Hello,

I'm a newbie dealing with AM3352 custom board and using ti-sdk-am335x-evm-07.00.00.00.
My board has
    * AM3352 processor
    * TPS65217C PMIC
    * IS43TR16128A-125KBLI DDR3

I'm facing problem in booting using SD card. SYSBOOT[4:0] is 10111b. Created SD card using create-sdcard.sh script.

 - Initially booting was getting struck in rtc32k_enable() function (Path - u-boot-2013.10-ti2013.12.01/arch/arm/cpu/armv7/am33xx/board.c). Hence commented the function call and it proceeded further.

   Did changes to support TPS65217C PMIC and also DDR3 timing changes.

 - Now it is getting stuck in mmc_getcd function (path - u-boot-2013.10-ti2013.12.01/drivers/mmc) at "cd = mmc->getcd(mmc);"
   MMC detials :
    MMC0 is used in SD/MMC connector.
    MMC1 for Bluetooth-WiFi interface
    MMC2 is not used

Please help me in resolving the issues.

Regards,

Lahari P.

  • Hi,

    I will forward this to the SW team.
  • Hi,

    mmc_getcd() function in mmc driver is responsible for the detection of the mmc card.
    Can you please share the mmc pins configurations in your u-boot?

    Best Regards,
    Yordan
  • Thanks for the reply Yordan. I have not made any changes in mmc pin configuration.
    PFB configurations.

    configure_module_pin_mux(i2c1_pin_mux);
    configure_module_pin_mux(gpio0_7_pin_mux);
    configure_module_pin_mux(rgmii1_pin_mux);
    configure_module_pin_mux(mmc0_pin_mux_sk_evm);

    static struct module_pin_mux mmc0_pin_mux_sk_evm[] = {
    {OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT3 */
    {OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT2 */
    {OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT1 */
    {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */
    {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */
    {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */
    {OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)}, /* MMC0_CD */
    {-1},
    };

    Thanks and regards,
    Lahari P.
  • Hi Lahari,

    Pinmuxes seem ok. Do you use the CD pin or a GPIO?

    Do you have the omap_mmc_init() function called properly for the MMC0 device?
    Also can you attach your bootlog (maybe add #define DEBUG in your configuration to get a more detailed output)?
    Do you get to the u-boot stage? Can you share your enviroment?

    Best Regards,
    Yordan
  • Hi Yordan,

    I'm using CD pin (MMC0_SDCD signal).

    - omap_mmc_init function is called with parameters (0, 0, 0, -1, -1).

    - Please find logs in the attachment. Tried adding "#define DEBUG" in am335x_evm.h, ti_am335x_common.h, ti_armv7_common.h but I'm getting compilation error "`.rodata' will not fit in region `.sram'".

    Serial console : Minicom (linux version)

    uboot log.txt
    [Lahari : I have added so many traces to debug. please ignore the traces ]
    
    
    U-Boot SPL 2013.10 (Sep 01 2015 - 11:57:24)
    Clock enable failed for 0x44e00800 idlest 0x10002
    clock1
    clock2
    clock3
    clock4
    clock5
    clock6
    clock1
    clock2
    clock3
    clock4
    clock5
    clock6
    clock1
    clock2
    clock3�������������������������������������
                                               clock6
    ### Use AM335x_SK V1.2 setting ###
    Reading eeprom_return0.
    clock1
    clock2
    clock3
    clock4
    clock5
    clock6
    completed init
    5
    ### Use AM335x_SK V1.2 setting ###
    Reading eeprom_return0.
    inside board_is_evm_sk
    completed set_mux_conf_regs
    Entering sdram_init### Use AM335x_SK V1.2 setting ###
    Reading eeprom_return0.
    6
    ddr1
    ddr2
    ddr3
    ddr4
    ddr5
    ddr3
    ddr_inline
    ddr6
    ddr7
    ddr8
    ddr9
    16
    7
    exiting s_init
    18
    mem malloc
    timer init
    21
    23
    27
    28
    30
    31
    33
    34
    36
    37
    38
    39
    24
    25
    config usb0
    config usb1
    26
    20
    ### Use AM335x_SK V1.2 setting ###
    Reading eeprom_return0.
    freq2
    freq3
    freq4
    freq9
    i2cgot11
    pmic1
    pmic2
    pmic3
    pmic4
    clock1
    clock2
    clock3
    clock4
    clock5
    clock6
    pmic1
    pmic2
    pmic3
    pmic4
    clock1
    clock2
    clock3
    clock4
    clock5
    clock6
    22
    spl.0
    spl.1.1
    boot device is 8
    spl.3
    spl_mmc_1
    spl_mmc_2
    mmc1
    mmc2
    mmc3
    board_mmc_init boot_common.c
    device 1:: dev id 0 Entering omap_mmc_initfunc 
     dev_index is [0] || cd_gpio is [-1] || wp_gpio is [-1]
    returning 
    mmc5
    mmc8
    mmc9
    entering mmc_start_init
    inside mmc_getcd func
    inside board_mmc_getcd --
    inside if
    


    - I'm not getting u-boot stage.
    PFB am335x_evm.h snippet. Is this the environment?

    #define CONFIG_EXTRA_ENV_SETTINGS \
        "loadaddr=0x80200000\0" \
        "fdtaddr=0x80F80000\0" \
        "fdt_high=0xa0000000\0" \
        "boot_fdt=try\0" \
        "rdaddr=0x81000000\0" \
        "bootpart=0:2\0" \
        "bootdir=/boot\0" \
        "bootfile=zImage\0" \
        "fdtfile=undefined\0" \
        "console=ttyO0,115200n8\0" \
        "partitions=" \
            "uuid_disk=${uuid_gpt_disk};" \
            "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
        "optargs=\0" \
        "dfu_alt_info_mmc=" DFU_ALT_INFO_MMC "\0" \
        "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \
        "mmcdev=0\0" \
        "mmcroot=/dev/mmcblk0p2 ro\0" \
        "mmcrootfstype=ext4 rootwait\0" \
        "usbroot=/dev/sda2 rw\0" \
        "usbrootfstype=ext4 rootwait\0" \
        "rootpath=/export/rootfs\0" \
        "nfsopts=nolock\0" \
        "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
            "::off\0" \
        "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \
        "ramrootfstype=ext2\0" \
        "mmcargs=setenv bootargs console=${console} " \
            "${optargs} " \
            "root=${mmcroot} " \
            "rootfstype=${mmcrootfstype}\0" \
        "usbargs=setenv bootargs console=${console} " \
            "${optargs} " \
            "root=${usbroot} " \
            "rootfstype=${usbrootfstype}\0" \
        "spiroot=/dev/mtdblock4 rw\0" \
        "spirootfstype=jffs2\0" \
        "spisrcaddr=0xe0000\0" \
        "spiimgsize=0x362000\0" \
        "spibusno=0\0" \
        "spiargs=setenv bootargs console=${console} " \
            "${optargs} " \
            "root=${spiroot} " \
            "rootfstype=${spirootfstype}\0" \
        "netargs=setenv bootargs console=${console} " \
            "${optargs} " \
            "root=/dev/nfs " \
            "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
            "ip=dhcp\0" \
        "bootenv=uEnv.txt\0" \
        "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
        "importbootenv=echo Importing environment from mmc ...; " \
            "env import -t $loadaddr $filesize\0" \
        "dfu_alt_info_ram=" DFU_ALT_INFO_RAM "\0" \
        "ramargs=setenv bootargs console=${console} " \
            "${optargs} " \
            "root=${ramroot} " \
            "rootfstype=${ramrootfstype}\0" \
        "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
        "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
        "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
        "mmcloados=run mmcargs; " \
            "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
                "if run loadfdt; then " \
                    "bootz ${loadaddr} - ${fdtaddr}; " \
                "else " \
                    "if test ${boot_fdt} = try; then " \
                        "bootz; " \
                    "else " \
                        "echo WARN: Cannot load the DT; " \
                    "fi; " \
                "fi; " \
            "else " \
                "bootz; " \
            "fi;\0" \
        "mmcboot=mmc dev ${mmcdev}; " \
            "if mmc rescan; then " \
                "echo SD/MMC found on device ${mmcdev};" \
                "if run loadbootenv; then " \
                    "echo Loaded environment from ${bootenv};" \
                    "run importbootenv;" \
                "fi;" \
                "if test -n $uenvcmd; then " \
                    "echo Running uenvcmd ...;" \
                    "run uenvcmd;" \
                "fi;" \
                "if run loadimage; then " \
                    "run mmcloados;" \
                "fi;" \
            "fi;\0" \
        "spiboot=echo Booting from spi ...; " \
            "run spiargs; " \
            "sf probe ${spibusno}:0; " \
            "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
            "bootz ${loadaddr}\0" \
        "netboot=echo Booting from network ...; " \
            "setenv autoload no; " \
            "dhcp; " \
            "tftp ${loadaddr} ${bootfile}; " \
            "tftp ${fdtaddr} ${fdtfile}; " \
            "run netargs; " \
            "bootz ${loadaddr} - ${fdtaddr}\0" \
        "ramboot=echo Booting from ramdisk ...; " \
            "run ramargs; " \
            "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
        "findfdt="\
            "if test $board_name = A335BONE; then " \
                "setenv fdtfile am335x-bone.dtb; fi; " \
            "if test $board_name = A335BNLT; then " \
                "setenv fdtfile am335x-boneblack.dtb; fi; " \
            "if test $board_name = A33515BB; then " \
                "setenv fdtfile am335x-evm.dtb; fi; " \
            "if test $board_name = A335X_SK; then " \
                "setenv fdtfile am335x-evmsk.dtb; fi; " \
            "if test $fdtfile = undefined; then " \
                "echo WARNING: Could not determine device tree to use; fi; \0" \
        BOOTCMD_COMMON \
        BOOTCMD_MMC \
        BOOTCMD_NAND \
        BOOTCMD_USB
    #endif

    Thanks and regards,

    Lahari P.

  • Hi,

    Yes that is the environment, I checked it against the one in SDK7.0 and it is correct.

    Not sure why your bootloader gets stuck in initializing the MMC though. From the bootlog I see it freezes in mmc.c driver:
    if (cd < 0) {
             if (mmc->cfg->ops->getcd)
                          cd = mmc->cfg->ops->getcd(mmc);
             else
                          cd = 1;
    }
    However, in omap_hsmmc.c it seems you get the sd card detected:
    device 1:: dev id 0 Entering omap_mmc_initfunc
    dev_index is [0] || cd_gpio is [-1] || wp_gpio is [-1]

    Can you verify (with debug prints) that mmc clocks are set accordingly? print the content of CM_PER_MMC0_CLKCTRL (0x44E0_003C).

    Have you tried using an sd card from different vendor? Can you try booting your board with the latest TI u-boot from SDK1.00.00.03 (u-boot-2014.07)? Or with the latest mainline u-boot from denx.de?

    Best Regards,
    Yordan

  • Hi Yordan,

    I'm not getting MMC clock. So i'm trying to enable RTC clock.
    will try with different vendor card and latest u-boot. And ll get back to you.

    Thanks and regards,
    Lahari P.
  • Hello Yordan,

    •  As per your suggestion checked with different vendor but no progress. it's getting struck in the same place (cd = mmc->getcd(mmc);).
    •  Content of CM_PER_MMC0_CLKCTRL is 2
    •  MMC_CLK is around 6MHz for some fraction of second and later clock won't be present.
    • Tried booting with latest u-boot "u-boot-2014.07+gitAUTOINC+fb6ab76dad-gfb6ab76" .

    Cross compiled using below command
    make CROSS_COMPILE=arm-linux-gnueabihf- O=am335x_evm am335x_evm_config all

    Now in v2014 booting is strucking before going to mmc. I'm unable to check where it is failing.
    If I add puts statement in board_init_r it strucks and it won't display properly.


    U-Boot SPL 2014.07 (Oct 06 2015 - 10:56:51)
    Enable RTC32K clock  
    SPL_BUILD
    calling prcm_init func  
    ### Use AM335x_SK V1.2 setting ###
    Reading eeprom_return0.
    calling set_mux_conf_regs func  
    ### Use AM335x_SK V1.2 setting ###
    Reading eeprom_return0.
    inside board_is_evm_sk
    returning from board_early_init_f
    ### Use AM335x_SK V1.2 setting ###
    Reading eeprom_return0.
    returning from s_init
    >>sai_rm

    Kindly help me in solving the Issues.

    Thanks and regards,

    Lahari P.