From nobody Wed Nov 18 06:49:12 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jTsdh51Qnz6y64T for ; Wed, 18 Nov 2026 06:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTsdh4LCbz3NXs for ; Wed, 18 Nov 2026 06:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794984552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bq5eQw/IcnnHwyiBUEgabJGGYc9+hJXDxWRYL1sNdIg=; b=dtrsOZ5EmdEacdXL1jn7kmQtY7XAmvy0bCgm2ND3cSco43LumXRcLwmCcQJgCo8mQ8Jxy7 pRdYkgf8KWJ/YbAovsLmAuwaOZPGRxuAV52E7E/Bx9gG+zkEfCWD+My7adAJ96ig6SqxFp IWoNBcxjJOT8N/tlukAjK6jys6Iw3k+x/7PluFfdFPCwxkxLTNd6/MSRgNx89Mq5mJZoSF tkllLFZfFm0Br3y14OMX5C3TSzoikCz33oFGvCL26xtBtknoo7x5fP6cduPn1fqD15DrNl puxCbrGoZgk29CCZecBBLBXsuE7g4zL1DkrY4BNJo5vJ1m1P6B4KWk+gekgh7Q== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794984552; b=Z9ofDlcY3eoTRuoROFfAfxR24XG1aqExrhKhHH8etZgdmvS7Tm2j6wNPZOiX/7r5G+umM8 yY4n7P+w7Fv6AHcsaT55mwaT1aNaQS277osjbv9pObwnD3QCEBwDraLlx2SIUNfEF2i9iv oIieQzKCMQU/b/93oNZv/RXfl36Ka8xvJ24oXBN7o7OMed35FEkgjHzZ8ecpmvzzAc4HyF 3EPkBjj7OCd24Q5Qg1Agr6c1j9QfpSGahwDXbFqbMIqh4lTLJWn/K3BnAc17Dya1EjEhfa 067+wKJRz1qzWTtQuZ9MPuIhb7RFZmhtQWiPqSTCZR3bJrPCKQWyqoBo2UNvvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794984552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bq5eQw/IcnnHwyiBUEgabJGGYc9+hJXDxWRYL1sNdIg=; b=mYXEWPIoG5g5SvFPBerPH+Po9g5++DW5qXuMiTbSahEmfuH+2JpzQT/feKUM+C3kXGb+YN D7v3XLYu23L/DRy+lzJVltS6jvu914aVdOWoMr8Fp7Pr74FUe8geG8Bj+t0ylzOimwXixy Q2iIq3ERfDvjZjLZ9z2uXaeKyp36JRe8z1mgAqLU9CBubeEBodLCbcfFEuwjQ+I5kP41gB 0FoKb0Vymb01Rlw5rIemD2pq4gyftfzTE+PhSbbGGbf212cz0b+4yXMxiQaMuuCSWTtzz5 9HxjB9VJgyIm79AnOuw2dCAP9M5wHDblgmBf6wkdsoHRfdQhR7i8Dqj6d46Zdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTsdh3m0rz1HLm for ; Wed, 18 Nov 2026 06:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d948 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Nov 2026 06:49:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a7b3eb616cf3 - main - aw_sid: Add the CPU speed grade fuse of the H6 and H616 List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7b3eb616cf36377de58b1376169801db3786bb8 Auto-Submitted: auto-generated Date: Wed, 18 Nov 2026 06:49:12 +0000 Message-Id: <6afd4a68.d948.7e2198ee@gitrepo.freebsd.org> The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a7b3eb616cf36377de58b1376169801db3786bb8 commit a7b3eb616cf36377de58b1376169801db3786bb8 Author: Emmanuel Vadot AuthorDate: 2026-11-17 19:31:12 +0000 Commit: Emmanuel Vadot CommitDate: 2026-11-18 06:48:37 +0000 aw_sid: Add the CPU speed grade fuse of the H6 and H616 The OPP tables of the H6 and H616 use the speed grade, stored in the efuse, to select the voltage of each OPP. Add it as a fuse so it can be read from the cpu_speed_grade nvmem cell, and expose it in a sysctl. The speed grade of the H616 is the 2 first bytes of the efuse and overlaps with the root key. Match the size too when looking up the fuse of an nvmem read. Tested on: Pine H64 (sysctl dev.aw_sid.0.speedgrade) --- sys/arm/allwinner/aw_sid.c | 22 +++++++++++++++++++++- sys/arm/allwinner/aw_sid.h | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/sys/arm/allwinner/aw_sid.c b/sys/arm/allwinner/aw_sid.c index 0e4549265790..069821bac740 100644 --- a/sys/arm/allwinner/aw_sid.c +++ b/sys/arm/allwinner/aw_sid.c @@ -179,6 +179,15 @@ static struct aw_sid_efuse h6_efuses[] = { .id = AW_SID_FUSE_ROOTKEY, .public = true, }, + { + .name = "speedgrade", + .desc = "CPU Speed Grade", + .base = EFUSE_OFFSET, + .offset = 0x1c, + .size = 4, + .id = AW_SID_FUSE_SPEEDGRADE, + .public = true, + }, }; static struct aw_sid_efuse h616_efuses[] = { @@ -200,6 +209,15 @@ static struct aw_sid_efuse h616_efuses[] = { .id = AW_SID_FUSE_THSSENSOR, .public = true, }, + { + .name = "speedgrade", + .desc = "CPU Speed Grade", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 2, + .id = AW_SID_FUSE_SPEEDGRADE, + .public = true, + }, }; static struct aw_sid_efuse d1_efuses[] = { @@ -417,8 +435,10 @@ aw_sid_read(device_t dev, uint32_t offset, uint32_t size, uint8_t *buffer) sc = device_get_softc(dev); + /* Some cells overlap, the H616 speed grade is part of the rootkey. */ for (i = 0; i < sc->sid_conf->nfuses; i++) - if (offset == sc->sid_conf->efuses[i].offset) { + if (offset == sc->sid_conf->efuses[i].offset && + size == sc->sid_conf->efuses[i].size) { fuse_id = sc->sid_conf->efuses[i].id; break; } diff --git a/sys/arm/allwinner/aw_sid.h b/sys/arm/allwinner/aw_sid.h index 2022b0a663c9..3e79f8b70fa1 100644 --- a/sys/arm/allwinner/aw_sid.h +++ b/sys/arm/allwinner/aw_sid.h @@ -29,6 +29,7 @@ enum aw_sid_fuse_id { AW_SID_FUSE_ROOTKEY = 1, AW_SID_FUSE_THSSENSOR, + AW_SID_FUSE_SPEEDGRADE, }; int aw_sid_read_tscalib(uint32_t *, uint32_t *);