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.

PROCESSOR-SDK-AM335X: Disable RTC32K on am335x

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3352

Hi,

I also have a RTC32K issue on am3352 with custom board.

According to the website, here, I can't find the option "SPL/TPL -> Enable the RTC32K OSC on AM33xx based platforms" to deselect.

There is only one option "Pass hand-off information from SPL to U-Boot proper".

The verson of u-boot is "u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3".

Please help with on question, thanks.

  • Hi,
    Please see below on how rtc32k_enable() is conditionally compiled depending on "CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC"

    In /common/spl/Kconfig
    config SPL_AM33XX_ENABLE_RTC32K_OSC
    	bool "Enable the RTC32K OSC on AM33xx based platforms"
    	default y if AM33XX
    	help
    	  Enable access to the AM33xx RTC and select the external 32kHz clock
    	  source.
    
    In /arch/arm/mach-omap2/am33xx/board.c
    #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
    static void rtc32k_enable(void)
    {
    	struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE;
    	rtc32k_unlock(rtc);
    	/* Enable the RTC 32K OSC by setting bits 3 and 6. */
    	writel((1 << 3) | (1 << 6), &rtc->osc);
    }
    #endif

    Best,

    -Hong

  • Hi Hong,

    I understand the CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC has to be diable.

    In my build folder of uboot,

    1. u-boot/1_2019.07-r0/git/am335x_evm/u-boot.cfg, I can see the definition #define CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC 1

    2. u-boot/1_2019.07-r0/git/am335x_evm/include/config/auto.conf, CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC=y

    There definition is built by my uboot settings. How do I disable it?

    Thanks.

  • Hong, 

    The case is customer board has no external 32.768K crystal/OSC.

    It may be different from enable and disable RTC32K_OSC.  

    In this case, does it need to disable RTC in SPL/u-boot since code will stop in SPL. 

    BR, Rich 

  • Hi,
    Can we run a test by directly commenting off calling rtc32k_enable() as listed below in "arch/arm/mach-omap2/am33xx/board.c"
    #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
    /* Enable RTC32K clock */
    // rtc32k_enable();
    #endif
    Best,
    -Hong

  • Hi Hong and Rich,

    Consequently, I mark out rtc32k_enable is not helpful on booting custom board.

    I use am3352 on custom board but without 32K cystal, and I can not bring up the board.

    After investigation, I have hardcore the board id using "A335x_SK" but I still can not see any logs through UART0.

    File: /board/ti/common/board_detect.c

    /*
    rc = ti_i2c_eeprom_get(bus_addr, dev_addr, TI_EEPROM_HEADER_MAGIC,
    sizeof(am_ep), (uint8_t *)&am_ep);
    if (rc)
    return rc;
    */

    am_ep.header = TI_EEPROM_HEADER_MAGIC;
    strcpy(am_ep.name, "A335X_SK");
    strcpy(am_ep.version, "1.2B");
    strcpy(am_ep.serial, "01224P190001"); //WWYY4P19nnnn, WW:week of year,YY:year,nnnn:board number
    strcpy(am_ep.config, "SKU#00"); //default configuration
    am_ep.mac_addr[0][0] = 0x00;
    am_ep.mac_addr[0][1] = 0x18;
    am_ep.mac_addr[0][2] = 0x23;
    am_ep.mac_addr[0][3] = 0x00;
    am_ep.mac_addr[0][4] = 0x03;
    am_ep.mac_addr[0][5] = 0x10;

    Like am335x-evmsk, custom board uses mmc0 as SD card and also is correct which use mmc0 as first priority.

    I am not sure what causes this issue, but maybe RTC32k is the one of them.

    Could you provide any suggestion? Thanks.

  • Hi,
    Do we have JTAG access on your board?
    If yes, can we try "attaching" JTAG to your board booting from MMC to pinpoint to which point code is running up to?
    where "attaching" means attach/connect JTAG without target reset.
    Let's use JTAG debugger to find out if SPL starts to run on your board.
    a). if yes, SPL needs to be debugged further to see where lock-up is.
    b). if no, check SYSBOOT[] latched in CM CTRL_STS register @0x44E10040 to see if it is matching SYSBOOT pin configured on your board.
    Additionally bootrom boot progress can be checked via reading trace vector as described in "5.2.3.2.5 Tracing Data" of the TRM.
    Best,
    -Hong

  • Hi Hond,

    I have met another question and I already can see logs through UART0.

    e2e.ti.com/.../processor-sdk-am335x-am3352-boot-up-fail---error-reading-image-u-boot-img

  • Ok, let's close the e2e, and follow up in the new e2e post.