From: Igor Paunovic <royalnet026@gmail.com>
To: Huseyin BIYIK <boogiepop@gmx.com>
Cc: Igor Paunovic <royalnet026@gmail.com>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
Tomeu Vizoso <tomeu@tomeuvizoso.net>,
Heiko Stuebner <heiko@sntech.de>,
Jiaxing Hu <gahing@gahingwoo.com>,
Oded Gabbay <ogabbay@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org
Subject: Re: [RFC] accel/rocket: DVFS on RK3588 - a hardware constraint, and some numbers
Date: Wed, 2 Sep 2026 13:04:27 +0200 [thread overview]
Message-ID: <20260902110432.22069-1-royalnet026@gmail.com> (raw)
In-Reply-To: <f5241666-9657-4f49-958f-476fd366e408@gmx.com>
Hi Huseyin,
> No you can even read them from userspace with mmap. i think there
> is also a firewall configuration where you can restrict the access
> per ip core, but default configuration should not require any EL
> escalation.
You were right, and here is the number that proves it. On my daily
kernel, from plain userspace mmap, the GPU PVTPLL counter reads:
GPU_GRF+0x18 (STATUS1) = 0x412 -> 1042 MHz measured,
at the stock 1000 MHz PVTPLL operating point
so the written rate really is just nominal calibration, and the
actual ring runs 4.2% above it on this sample. One detail against
your note: on my board the live value shows up in STATUS1
(OSC_CNT_AVG), while STATUS0.OSC_CNT stays zero. Thank you for mmm
and for the TF-A pointer - both did exactly what you said.
The NPU counter is another story, and I can now bound it tightly.
With the ring alive and clocking the NPU at 1 GHz (CON74[0]=1,
CON0_L=0x103, length 12, CAL_CNT=24), NPU_GRF+0x24 stays zero from
both kernel ioremap and userspace mmap, after eliminating every
lever reachable from the non-secure side:
- counter input select already xin_osc0_func (CON74[4]=1)
- REF_CNT (+0x1c) tried both as found (0) and set to 0x18
- every gate bit in CLKGATE_CON(27/28/29) opened, one register
at a time and all together (27/28 were already fully ungated)
- CON registers read and write fine throughout - only STATUS0/1
stay zero
The GPU counter counts out of the box with its pvtm gates closed,
so none of the pvtm clocks are the reference. SkatterBencher's
rk3588-tools hit the same wall ("NPU PVTPLL is not working", with
the sel flip left unimplemented), so this seems to be a wall and
not my setup.
That leaves two candidates, and one of them is the firewall you
mentioned: either the NPU status words are restricted for
non-secure masters (per-ip-core firewall), or the counter is
simply not wired on the NPU instance. Have you ever seen a nonzero
NPU read on silicon, for example through your d2d6928641ba
get_rate path from EL3? My next step is to cherry-pick that commit
into my BL31: if EL3 also reads zero, the silicon answer wins.
Jonas: the GPU result above also answers the OSC counter offset
question from the pclk thread - GPU STATUS1 sits at GRF_GPU+0x18
and counts without any setup.
I added a GRF_NPU catalog entry to mmm while testing (start
0xFD5A200C, per the TF-A offsets). Happy to send it as a PR if
you want it despite the dead counter.
Igor
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: Igor Paunovic <royalnet026@gmail.com>
To: Huseyin BIYIK <boogiepop@gmx.com>
Cc: Igor Paunovic <royalnet026@gmail.com>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
Tomeu Vizoso <tomeu@tomeuvizoso.net>,
Heiko Stuebner <heiko@sntech.de>,
Jiaxing Hu <gahing@gahingwoo.com>,
Oded Gabbay <ogabbay@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org
Subject: Re: [RFC] accel/rocket: DVFS on RK3588 - a hardware constraint, and some numbers
Date: Wed, 2 Sep 2026 13:04:27 +0200 [thread overview]
Message-ID: <20260902110432.22069-1-royalnet026@gmail.com> (raw)
In-Reply-To: <f5241666-9657-4f49-958f-476fd366e408@gmx.com>
Hi Huseyin,
> No you can even read them from userspace with mmap. i think there
> is also a firewall configuration where you can restrict the access
> per ip core, but default configuration should not require any EL
> escalation.
You were right, and here is the number that proves it. On my daily
kernel, from plain userspace mmap, the GPU PVTPLL counter reads:
GPU_GRF+0x18 (STATUS1) = 0x412 -> 1042 MHz measured,
at the stock 1000 MHz PVTPLL operating point
so the written rate really is just nominal calibration, and the
actual ring runs 4.2% above it on this sample. One detail against
your note: on my board the live value shows up in STATUS1
(OSC_CNT_AVG), while STATUS0.OSC_CNT stays zero. Thank you for mmm
and for the TF-A pointer - both did exactly what you said.
The NPU counter is another story, and I can now bound it tightly.
With the ring alive and clocking the NPU at 1 GHz (CON74[0]=1,
CON0_L=0x103, length 12, CAL_CNT=24), NPU_GRF+0x24 stays zero from
both kernel ioremap and userspace mmap, after eliminating every
lever reachable from the non-secure side:
- counter input select already xin_osc0_func (CON74[4]=1)
- REF_CNT (+0x1c) tried both as found (0) and set to 0x18
- every gate bit in CLKGATE_CON(27/28/29) opened, one register
at a time and all together (27/28 were already fully ungated)
- CON registers read and write fine throughout - only STATUS0/1
stay zero
The GPU counter counts out of the box with its pvtm gates closed,
so none of the pvtm clocks are the reference. SkatterBencher's
rk3588-tools hit the same wall ("NPU PVTPLL is not working", with
the sel flip left unimplemented), so this seems to be a wall and
not my setup.
That leaves two candidates, and one of them is the firewall you
mentioned: either the NPU status words are restricted for
non-secure masters (per-ip-core firewall), or the counter is
simply not wired on the NPU instance. Have you ever seen a nonzero
NPU read on silicon, for example through your d2d6928641ba
get_rate path from EL3? My next step is to cherry-pick that commit
into my BL31: if EL3 also reads zero, the silicon answer wins.
Jonas: the GPU result above also answers the OSC counter offset
question from the pclk thread - GPU STATUS1 sits at GRF_GPU+0x18
and counts without any setup.
I added a GRF_NPU catalog entry to mmm while testing (start
0xFD5A200C, per the TF-A offsets). Happy to send it as a PR if
you want it despite the dead counter.
Igor
next prev parent reply other threads:[~2026-09-02 11:05 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 13:16 [RFC] accel/rocket: DVFS on RK3588 - a hardware constraint, and some numbers Igor Paunovic
2026-08-01 13:16 ` Igor Paunovic
2026-08-01 19:32 ` Jiaxing Hu
2026-08-01 19:32 ` Jiaxing Hu
2026-08-02 12:04 ` Igor Paunovic
2026-08-02 12:04 ` Igor Paunovic
2026-08-15 18:24 ` Tomeu Vizoso
2026-08-15 18:24 ` Tomeu Vizoso
2026-08-17 18:22 ` Nicolas Dufresne
2026-08-17 18:22 ` Nicolas Dufresne
2026-08-18 7:27 ` Igor Paunovic
2026-08-18 7:27 ` Igor Paunovic
2026-08-18 12:12 ` Jonas Karlman
2026-08-18 12:12 ` Jonas Karlman
2026-08-18 12:30 ` Jonas Karlman
2026-08-18 12:30 ` Jonas Karlman
2026-08-19 5:52 ` Igor Paunovic
2026-08-19 5:52 ` Igor Paunovic
2026-08-19 9:40 ` Jonas Karlman
2026-08-19 9:40 ` Jonas Karlman
2026-08-19 12:59 ` Igor Paunovic
2026-08-19 12:59 ` Igor Paunovic
2026-08-19 16:20 ` Jonas Karlman
2026-08-19 16:20 ` Jonas Karlman
2026-08-19 18:48 ` Igor Paunovic
2026-08-19 18:48 ` Igor Paunovic
2026-08-19 20:07 ` Hüseyin BIYIK
2026-08-19 20:07 ` Hüseyin BIYIK
2026-09-02 11:04 ` Igor Paunovic [this message]
2026-09-02 11:04 ` Igor Paunovic
2026-09-03 9:16 ` Igor Paunovic
2026-09-03 9:16 ` Igor Paunovic
[not found] ` <2f88072c-6aa3-4294-a35d-722d1c7a405c@email.android.com>
2026-09-03 18:51 ` Igor Paunovic
2026-09-03 18:51 ` Igor Paunovic
2026-09-04 11:08 ` Jiaxing Hu
2026-09-04 11:08 ` Jiaxing Hu
2026-09-04 12:46 ` Igor Paunovic
2026-09-04 12:46 ` Igor Paunovic
2026-09-05 5:13 ` Jiaxing Hu
2026-09-05 5:13 ` Jiaxing Hu
2026-09-05 7:01 ` Igor Paunovic
2026-09-05 7:01 ` Igor Paunovic
2026-08-19 18:47 ` Nicolas Dufresne
2026-08-19 18:47 ` Nicolas Dufresne
2026-09-04 11:19 ` Jiaxing Hu
2026-09-04 11:19 ` Jiaxing Hu
[not found] <DKDOBW9CJ2Y3.10EEIZDTXPYJZ@cknow-tech.com>
2026-08-01 14:40 ` Igor Paunovic
2026-08-01 14:40 ` Igor Paunovic
2026-08-01 16:29 ` Diederik de Haas
2026-08-01 16:29 ` Diederik de Haas
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=20260902110432.22069-1-royalnet026@gmail.com \
--to=royalnet026@gmail.com \
--cc=boogiepop@gmx.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gahing@gahingwoo.com \
--cc=heiko@sntech.de \
--cc=jonas@kwiboo.se \
--cc=linux-rockchip@lists.infradead.org \
--cc=nicolas@ndufresne.ca \
--cc=ogabbay@kernel.org \
--cc=tomeu@tomeuvizoso.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.