From: Andre Przywara <andre.przywara@arm.com>
To: Lucas Stach <l.stach@pengutronix.de>,
Russell King <linux+etnaviv@armlinux.org.uk>
Cc: etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Chen-Yu Tsai <wens@csie.org>,
linux-sunxi <linux-sunxi@lists.linux.dev>
Subject: drm/etnaviv: detecting disabled Vivante GPU?
Date: Thu, 4 Sep 2025 00:29:24 +0100 [thread overview]
Message-ID: <20250904002924.2bc63b73@minigeek.lan> (raw)
Hi,
the Allwinner A523/A527/T527 family of SoCs feature a Vivante
"VIP9000"(?) NPU, though it seems to be disabled on many SKUs.
See https://linux-sunxi.org/A523#Family_of_sun55iw3 for a table, the
row labelled "NPU" indicates which model has the IP. We suspect it's
all the same die, with the NPU selectively fused off on some packages.
Board vendors seem to use multiple SKUs of the SoC on the same board,
so it's hard to say which particular board has the NPU or not. We
figured that on unsupported SoCs all the NPU registers read as 0,
though, so were wondering if that could be considered as a bail-out
check for the driver?
At the moment I get this, on a SoC with a disabled NPU:
[ 1.677612] etnaviv etnaviv: bound 7122000.npu (ops gpu_ops)
[ 1.683849] etnaviv-gpu 7122000.npu: model: GC0, revision: 0
[ 1.690020] etnaviv-gpu 7122000.npu: Unknown GPU model
[ 1.696145] [drm] Initialized etnaviv 1.4.0 for etnaviv on minor 0
[ 1.953053] etnaviv-gpu 7122000.npu: GPU not yet idle, mask: 0x00000000
Chen-Yu got this on his board featuring the NPU:
etnaviv-gpu 7122000.npu: model: GC9000, revision: 9003
If I get the code correctly, then etnaviv_gpu_init() correctly detects
the "unsupported" GPU model, and returns -ENXIO, but load_gpu() in
etnaviv_drv.c then somewhat ignores this, since it keeps looking for more
GPUs, and fails to notice that *none* showed up:
/sys/kernel/debug/dri/etnaviv/gpu is empty in my case.
Quick questions:
- Is reading 0 from VIVS_HI_CHIP_IDENTITY (or any other of the ID
registers) an invalid ID, so we can use that to detect those disabled
NPUs? If not, can any other register used to check this? The whole
block seems to be RAZ/WI when the NPU is disabled.
- Would it be acceptable to change the logic to error out of the
driver's init or probe routine when no GPU/NPU has been found, at
best with a proper error message? As it stands at the moment, the
driver is loaded, but of course nothing is usable, so it keeps
confusing users.
Happy to provide a patch, but just wanted to test the waters.
Cheers,
Andre
next reply other threads:[~2025-09-03 23:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 23:29 Andre Przywara [this message]
2025-09-04 7:08 ` drm/etnaviv: detecting disabled Vivante GPU? Icenowy Zheng
2025-09-04 10:10 ` Christian Gmeiner
2025-09-04 10:36 ` Andre Przywara
2025-09-10 7:28 ` Lucas Stach
2025-09-10 10:48 ` Andre Przywara
-- strict thread matches above, loose matches on Subject: below --
2025-09-07 6:10 Muhammed Subair
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=20250904002924.2bc63b73@minigeek.lan \
--to=andre.przywara@arm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=wens@csie.org \
/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