Hi Simon, On Wed, 28 Oct 2026 at 16:43, Simon Glass <[email protected]> wrote: > Just to check, is this right in practice? The 'date' command uses RTC > sequence 0. The ARM and RISC-V 'virt' machines always provide a PL031 > or Goldfish RTC, and those boards imply DM_RTC with RTC_PL031 or > RTC_GOLDFISH. So with the default configs the virtio RTC is the second > RTC and 'date' never reads it, which I suspect is why you disabled > RTC_GOLDFISH when testing. On qemu-x86, DM_RTC is not enabled in > U-Boot proper, so the driver is not built at all.
You're right, that sentence overstates it. With the default configs the virtio RTC is only the second RTC, and that is why I disabled RTC_GOLDFISH to test it with "date". On qemu-x86 it also needs DM_RTC enabled. > It might be worth a follow-up adding a sentence to the virtio > documentation on how to reach the virtio RTC when a platform RTC is > present, e.g. with 'rtc dev', or with an alias if that suits your use > case. Yes, I'll send that. One thing I found while checking: "rtc dev 1" selects it for "rtc read", but "date" still uses sequence 0. An alias does not work either, as the virtio device is bound by the transport and has no node of its own. So the doc would point to "rtc dev" and "rtc read", and say that "date" needs the platform RTC disabled. Thanks, Hung-Chun
