[PATCH] riscv: Access time mmio instead of rdtime.
Palmer Dabbelt
palmer at dabbelt.com
Wed Feb 5 07:31:37 PST 2025
On Sun, 29 Dec 2024 07:09:13 PST (-0800), Conor Dooley wrote:
> On Fri, Dec 27, 2024 at 04:00:56PM +0100, Aleksandar Rikalo wrote:
>> +#if defined(CONFIG_RISCV_TIME_MMIO)
>> + if (!of_property_read_u64(n, "clock-reg", &mmio_addr)) {
>
> This is a non-standard, undocumented property. reg & reg-names are what
> you should be using here.
We were talking some in the patchwork meeting. If this system has a
CLINT then it's probably best to refactor the timers such that MMIO
CLINT access is independent from M-mode (as there's some patches
floating around to make M-mode use rdtime on systems that implement
rdtime).
>> + riscv_time_val = ioremap((long)mmio_addr, 8);
>> + if (riscv_time_val) {
>> + pr_info("Using mmio time register at 0x%llx\n", mmio_addr);
>> + static_branch_enable(&riscv_time_mmio_available);
>> + } else {
>> + pr_warn("Unable to use mmio time at 0x%llx\n", mmio_addr);
>> + }
>> + }
>> +#endif
More information about the linux-riscv
mailing list