mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Aleksa Paunovic <aleksa.paunovic@htecgroup.com>
Cc: "linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	Djordje Todorovic <Djordje.Todorovic@htecgroup.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Aleksandar Rikalo <arikalo@gmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dragan Mladjenovic <Dragan.Mladjenovic@syrmia.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] Allow for riscv-clock to pick up mmio address.
Date: Thu, 10 Apr 2025 11:21:46 +0100	[thread overview]
Message-ID: <20250410-squeezing-outcast-f717ff17817c@spud> (raw)
In-Reply-To: <20250409143816.15802-1-aleksa.paunovic@htecgroup.com>

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

On Wed, Apr 09, 2025 at 02:38:55PM +0000, Aleksa Paunovic wrote:
> From: Dragan Mladjenovic <Dragan.Mladjenovic@syrmia.com>
> 
> Allows faster rdtime access via GCR.U mtime shadow register on p8700.
> 
> Signed-off-by: Aleksa Paunovic <aleksa.paunovic@htecgroup.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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-04-10 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 14:38 Aleksa Paunovic
2025-04-10 10:21 ` Conor Dooley [this message]
2025-04-23 14:42   ` Aleksa Paunovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250410-squeezing-outcast-f717ff17817c@spud \
    --to=conor@kernel.org \
    --cc=Djordje.Todorovic@htecgroup.com \
    --cc=Dragan.Mladjenovic@syrmia.com \
    --cc=aleksa.paunovic@htecgroup.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=arikalo@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®