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.

  • Resolved

Linux/AM3352: AM335x RTC Kick Register Write Issue in U-Boot

Prodigy 160 points

Replies: 6

Views: 2596

Part Number: AM3352

Tool/software: Linux

Hello,

We have a new custom board but can not bring up it(blank screen on debug console). After detail check using JTag, we found CPU will hang 

in  rtc32k_unlock() function(below figure) which located in <u-boot>/\arch\arm\cpu\armv7\am33xx\board.c.

Value of RTC_KICK0R_WE and RTC_KICK1R_WE are  0x83E7 0B13 and 0x95A4F1E0( match the values described in TRM 20.3.5.23,

since we do not modify original u-boot code)

 

If we remove rtc32k_enable() which calls  rtc32k_unlock(), u-boot could continue execute and print characters on debug console.

But we do not want to remove RTC since u-boot uses many time related functions.  

CPU is AM3352BZCZA100 and Processor SDK is 2.00.02.11.

Any suggestion is appreciated. Thanks.

  • Attach RTC schematic.

  • In reply to Robert Yin17:

    Hi Robert,

    I will have a look and come back to you.

    Regards,
    Pavel



  • In reply to Pavel Botev:

    Robert,

    I suspect that you have issues with your RTCSS clock source. Can you check what values you have in below two registers just before rtc32k_unlock() function call?

    CM_RTC_RTC_CLKCTRL
    CM_RTC_CLKSTCTRL

    Regards,
    Pavel



  • In reply to Pavel Botev:

    Hi Pavel

    Sorry for late. The registers values are as below figure.

    Thanks.

  • In reply to Robert Yin17:

    Robert,

    Can you try to read the RTC_CTRL_REG, RTC_OSC_REG, RTC_STATUS_REG and KICK rgisters inside the rtc32k_enable() function, before invoking rtc32k_unlock()?

    #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
    static void rtc32k_enable(void)
    {
    struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE;



    printf("RTC_CTRL_REG = %x/n", readl(&rtc->ctrl));
    printf("RTC_STATUS_REG = %x/n", readl(&rtc->status));
    printf("RTC_OSC_REG = %x/n", readl(&rtc->osc));
    printf("KICK0R = %x/n", readl(&rtc->kick0r));
    printf("KICK1R = %x/n", readl(&rtc->kick1r));

    rtc32k_unlock(rtc);

    /* Enable the RTC 32K OSC by setting bits 3 and 6. */
    writel((1 << 3) | (1 << 6), &rtc->osc);
    }
    #endif


    Another check you can made is the signal level on the RTC_XTALOUT/A4 and RTC_XTALIN/A6 pins. You can measure these with scope and compare the levels with AM335x EVM and/or StarterKit.

    Check also the below wiki page:

    processors.wiki.ti.com/.../AM335x_Schematic_Checklist

    Regards,
    Pavel



  • In reply to Pavel Botev:

    Hi Pavel,

    After check RTC schematic, the RTC_PWRONRSTn pin is not correctly connected. 

    After this pin is connected, problem is solved.

    Thanks for your help.

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.