RTC外设配置
STM32MP1系列芯片已经内置RTC功能,可以直接配置使用,需要硬件连接RTC的备份电池。Linux kernel代码中启用RTC功能就可以使用了
RTC外设能够产生两个中断:
- 连接到Cortex-A7 GIC的安全中断,未在OpenSTLinux发行版中使用。 
- 一个非安全中断,同时连接到Cortex-A7 GIC和Cortex-M4 NVIC:此中断在Linux上使用,默认情况下在OpenSTLinux发行版中使用。 
| Domain | Peripheral | Runtime allocation | Comment | |||
| Instance | Cortex-A7 secure (OP-TEE) | Cortex-A7 non-secure (Linux) | Cortex-M4 (STM32Cube) | |||
| Core | RTC | RTC | ☑ | 
dts代码如下
&rtc {
         status = "okay";
};配置好后,启动系统可以看到有RTC设备和RTC控制器注册成功的信息
root@pangu:~# dmesg| grep rtc
[    1.859046] stm32_rtc 5c004000.rtc: rtc core: registered 5c004000.rtc as rtc0
[    1.865008] stm32_rtc 5c004000.rtc: Date/Time must be initialized
[    1.870915] stm32_rtc 5c004000.rtc: registered rev:1.2
[    2.327185] stm32_rtc 5c004000.rtc: setting system clock to 2000-01-01 05:19:06 UTC (946703946)
root@pangu:~# ls -la /dev/rtc*
lrwxrwxrwx 1 root root      4 Jul 16 06:58 /dev/rtc -> rtc0
crw------- 1 root root 253, 0 Jul 16 06:58 /dev/rtc0作者:SteveChen  创建时间:2024-09-18 14:45
最后编辑:SteveChen 更新时间:2024-10-18 15:16
最后编辑:SteveChen 更新时间:2024-10-18 15:16
