[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250410-squeezing-outcast-f717ff17817c@spud>
Date: Thu, 10 Apr 2025 11:21:46 +0100
From: Conor Dooley <conor@...nel.org>
To: Aleksa Paunovic <aleksa.paunovic@...cgroup.com>
Cc: "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
Djordje Todorovic <Djordje.Todorovic@...cgroup.com>,
Palmer Dabbelt <palmer@...belt.com>,
Aleksandar Rikalo <arikalo@...il.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Dragan Mladjenovic <Dragan.Mladjenovic@...mia.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] Allow for riscv-clock to pick up mmio address.
On Wed, Apr 09, 2025 at 02:38:55PM +0000, Aleksa Paunovic wrote:
> From: Dragan Mladjenovic <Dragan.Mladjenovic@...mia.com>
>
> Allows faster rdtime access via GCR.U mtime shadow register on p8700.
>
> Signed-off-by: Aleksa Paunovic <aleksa.paunovic@...cgroup.com>
> +#if defined(CONFIG_RISCV_TIME_MMIO)
> + gcru = of_find_compatible_node(NULL, NULL, "mti,p8700-gcru");
Firstly, this is an undocumented compatible, so you'll need to create a
binding for it before you can use it. Not much to say on the use of the
compatible in the driver without more information on what the device
looks like.
Secondly, the option you have added is generically named and described,
yet only functions on this p8700 platform. At a minimum, it needs to
explain the platforms where it is relevant, and probably also should
depend on the kconfig option that enables building a dt etc for the
p8700 platform in the first place.
Cheers,
Conor.
> + if (gcru) {
> + if (!of_property_read_u64_index(gcru, "reg", 0, &mmio_addr)) {
> + 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);
> + }
> + of_node_put(gcru);
> + }
> + }
> +#endif
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists