You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IMX6ULL平台PCF85063A RTC唤醒中断失效问题排查求助

问题:IMX6ULL上PCF85063A RTC唤醒中断失效排查

问题背景

正在为IMX6ULL的嵌入式Linux镜像开发内核补丁,通过I2C1总线连接PCF85063A RTC芯片,但唤醒中断功能无法正常工作。INT引脚连接至SODIMM 106,该引脚原本分配给触摸屏中断,已修改相关配置,但问题仍未解决。

系统日志

启动日志

[    8.487168] rtc-pcf85063 0-0051: registered as rtc0 
[    8.502610] rtc-pcf85063 0-0051: setting system clock to 2023-07-07T16:28:49 UTC (1688747329)
[  146.689736] [<1c6ab285>] irq_default_primary_handler threaded [<b6666757>] pcf85063_rtc_handle_irq

手动触发suspend日志(执行echo mem > /sys/power/state)

[  266.251231] PM: suspend entry (deep)  
[  266.312442] Filesystems sync: 0.054 seconds
[  266.324553] Freezing user space processes
[  266.339858] Freezing user space processes completed (elapsed 0.010 seconds)
[  266.348429] OOM killer disabled.
[  266.351779] Freezing remaining freezable tasks
[  266.361847] Freezing remaining freezable tasks completed (elapsed 0.005 seconds)
[  266.369741] printk: Suspending console(s) (use no_console_suspend to debug)
[  266.494859] PM: suspend devices took 0.110 seconds
[  266.534029] Disabling non-boot CPUs ...
[  266.820497] PM: resume devices took 0.260 seconds
[  266.840124] OOM killer enabled.
[  266.843347] Restarting tasks ... done.
[  266.884987] random: crng reseeded on system resumption
[  266.912850] PM: suspend exit
-sh: echo: write error: Device or resource busy

rtcwake命令日志(执行rtcwake -u -s 60 -m mem)

[  202.338932] PM: suspend entry (deep)                                          
[  202.376789] Filesystems sync: 0.032 seconds                                   
[  202.393022] systemd-journald[121]: Data hash table of /run/log/journal/1e231.
[  202.416581] Freezing user space processes                                     
[  202.447739] Freezing user space processes completed (elapsed 0.026 seconds)  
[  202.457459] OOM killer disabled.                                              
[  202.460937] Freezing remaining freezable tasks                                
[  202.471934] Freezing remaining freezable tasks completed (elapsed 0.006 seco)
[  202.479707] printk: Suspending console(s) (use no_console_suspend to debug)  
[  202.605185] PM: suspend devices took 0.110 seconds                            
[  202.643749] Disabling non-boot CPUs ...                                       
[  202.931423] PM: resume devices took 0.260 seconds                             
[  202.950730] OOM killer enabled.                                               
[  202.953949] Restarting tasks ...                                              
[  202.966793] systemd-journald[121]: /run/log/journal/1e2317323e804be59d671ac5.
[  202.995698] done.                                                             
[  202.998191] random: crng reseeded on system resumption                        
[  203.005129] PM: suspend exit                                                  
rtcwake: write error 

已修改的设备树内容

&i2c1 {
    status = "okay";

    pcf85063: rtc@51 {
      compatible = "nxp,pcf85063a";
      reg = <0x51>;
      pinctrl-names = "default";
      pinctrl-0 = <&pinctrl_rtc_int>;
      interrupt-parent = <&gpio1>;
      interrupts = <10 IRQ_TYPE_EDGE_FALLING>; /* SODIMM 106*/
      quartz-load-femtofarads = <12500>;
      clock {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency = <32768>;
      };
    };
  };

&snvs_rtc {
    status = "disabled";
};

排查思路

  • 检查引脚配置:确认pinctrl_rtc_int是否正确定义,SODIMM 106对应的GPIO1_IO10是否被设置为中断模式,且没有被其他设备占用。执行cat /sys/kernel/debug/gpio查看引脚状态,确保标记为irq且未被其他驱动注册。
  • 验证RTC中断寄存器配置:用i2cdump等I2C工具读取PCF85063A的中断控制寄存器(0x01和0x02),确认唤醒中断已启用,且中断极性配置为下降沿(与设备树匹配),同时检查倒计时闹钟是否正确设置。
  • 检查中断唤醒能力:查看/sys/devices/platform/soc/soc:internal-regs/gpio/gpio1/gpio10/power/wakeup文件,若显示enabled则正常,否则需在设备树的PCF85063节点添加wakeup-source属性。
  • 内核驱动补丁检查:确认PCF85063驱动是否适配IMX6ULL的唤醒流程,检查驱动中的suspend和resume函数是否正确保存/恢复寄存器状态,以及是否正确注册了唤醒源。
  • 排查suspend失败原因:日志中出现Device or resource busy,说明有设备阻止系统进入suspend。开启no_console_suspend内核参数后重新执行suspend,查看详细日志定位未正确挂起的设备,或使用pm_debug_messages参数获取更多调试信息。
  • 测试中断触发:系统正常运行时,手动触发RTC INT引脚的下降沿,查看dmesg是否能捕获到pcf85063_rtc_handle_irq日志,确认中断通路是否正常。

内容的提问来源于stack exchange,提问作者Bjlli

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 19:07:51