casaroli opened a new pull request, #20526: URL: https://github.com/apache/nuttx/pull/20526
## Summary * `drivers/timers/pl031`: the driver did not compile without `CONFIG_RTC_ALARM`, because `struct pl031_lowerhalf_s` always had a `struct lower_setalarm_s` field, which `rtc.h` defines only with alarms. The field now has the same condition as the code that uses it. No configuration enabled `RTC_PL031`, so this was not seen. * `arch/arm64/qemu`: the QEMU virt machine has a PL031 RTC at `0x09010000` (SPI 2), which QEMU sets from the host clock. qemu-armv8a did not register it, so the system time started at `CONFIG_START_YEAR`, and files on a host share (v9fs, hostfs) had times years in the future. With `CONFIG_RTC_PL031`, `up_rtc_initialize()` now registers the PL031. * New option `QEMU_RTC_PL031_SYNC`: the boot waits (up to one second) for the RTC second to change. The PL031 counts whole seconds, so without the wait the system time starts up to one second behind the host. ## Impact qemu-armv8a with `CONFIG_RTC_PL031` only. New options `QEMU_RTC_PL031_BASE`, `QEMU_RTC_PL031_IRQ` and `QEMU_RTC_PL031_SYNC` (default n). No defconfig changes. ## Testing qemu-armv8a in QEMU 11 (TCG), kernel build with `RTC`, `RTC_DATETIME`, `RTC_DRIVER`, `RTC_ARCH`, `RTC_PL031` and `QEMU_RTC_PL031_SYNC`: ``` host: 2026-10-08 18:27:04 UTC nsh> bash -c "printf '%(%F %T)T UTC\n' -1" NuttX time: 2026-10-08 18:27:04 UTC ``` Without the change the system time started in 2022. With `QEMU_RTC_PL031_SYNC`, a file that the host wrote just before is no longer newer than the system time. Builds: `qemu-armv8a:knsh` with the options above, and `qemu-armv8a:knsh` and `qemu-armv8a:netnsh` without them. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
