Re: Proposal for ACLINT MTIMER groups
For the MTIMER devices in a MTIMER group, only the MTIME register is aliased whereas the MTIMECMP registers are real/physical registers. As-per current proposal, a read/write to an “aliased MTIME” of a MTIMER device will read/write the “physical MTIME” register of the MTIMER group.
In examply#2, the “physical MTIME” register is not visible to software as a distinct MMIO register and software can write any “aliased MTIME” register to modify the “physical MTIME” register. I am okay to define “aliased MTIME” register as read-only (unless anyone has objections) but this would mean that “physical MTIME register” need to be exposed as a distinct MTIMER device with no associated HART (i.e. no MTIMECMP registers). Also, once software sees a MTIMER device with “aliased MTIME” register, it will never write to such register.
In example#3, the “mtimer,reference” DT property is only a HINT for software to choose a “reference physical MTIME register” when doing inter-group MTIME software synchronization. The “mtimer,reference” does not imply anything about HW root in a multi-socket system because there will be separate NUMA-related DT properties for describing topology of a multi-socket system.
The “time” CSR in a RISC-V HART is “user-level read-only” (i.e. URO) hence cannot be used for software-synchronization.
Also, it simply makes NO SENSE to have a MTIMER device without a MTIME register.
Both MTIME and MTIMECMP register impact the state of HART timer interrupt because values in MTIMECMP register are absolute values of MTIME register (counter).
It is certainly okay define “aliased MTIME” register as read-only because software won’t use “aliased MTIME” register for synchronization so I will consider this aspect when updating ACLINT specification.
A more explicit “mtimer,aliased” DT property (instead of boolean DT property) which points to the MTIMER device having “physical MTIME” register only provides more details in the device tree and not much useful to software because software on a RISC-V HART will always read the “aliased MTIME” register from the MTIMER device associated with it.
._,_