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.

[参考译文] AM3358:无法在 U-Boot 上启用 RTC

Guru**** 2805425 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1625140/am3358-unable-to-enable-rtc-on-u-boot

部件号: AM3358

在 u-boot 侧、对于 defconfig、我添加了以下内容:
 
默认配置:
CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC=y
CONFIG_DM_RTC=y
 
然后、在 board.c 中、我添加了以下块:
board.c
#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
void rtc32k_enable(void)
{
    struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE;
 
    /*
     * Unlock the RTC's registers.  For more details please see the
     * RTC_SS section of the TRM.  In order to unlock we need to
     * write these specific values (keys) in this order.
     */
    writel(RTC_KICK0R_WE, &rtc->kick0r);
    writel(RTC_KICK1R_WE, &rtc->kick1r);
 
    /* 6: EN_32KCLK */
    /* 3: SEL_32KCLK_SRC 0: internal, 1: external */
    writel((1 << 3) | (1 << 6), &rtc->osc);
}
#endif
我有一个 32.7kHz 的外部振荡器、因此选择了位 3。  
 
最后、在 DTS 中、我添加了:
器件树
&RTC{
  系统电源控制器;
};
它编译正常并生成 MLO 和 u-boot.img、但是 u-boot 滞留在这里:

CCCCCCCC
<debug_uart>

之前、在内核器件树中、我在引导加载程序端添加了以下内容、但没有进行任何更改:
&RTC{

 系统电源控制器;

};
dtsi 还有一些其他 RTC 配置保持不变。  

在 defconfig 上、我进行了以下更改:  
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_OMAP=y

这只是使其解压缩 Linux(通过引导加载程序阶段)、然后复位。  

什么是我的缺失?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Viraj:

    您是如何尝试加载的? 它是通过 UART 还是 SD 等其他设备实现的?

    [quote userid=“689269" url="“ url="~“~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1625140/am3358-unable-to-enable-rtc-on-u-boot
    我有一个 32.7kHz 的外部振荡器、因此选择了位 3。  
    [/报价]

    您是否尝试过使用内部振荡器?

    此致、
    Vinu