From nobody Thu Nov 12 09:51:25 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 4jQFyj3ZTLz70KC6 for ; Thu, 12 Nov 2026 09:51:25 +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 4jQFyj1R88z3Fwt for ; Thu, 12 Nov 2026 09:51:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794477085; 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=iqGYCJqp+l1qlwxuA4cgfxM+s/BLyARfXc648ic/JZw=; b=IpN2Cw1JMhBxapnITsQ3nZ0topxywYDSHKMohUDHRHPov5vCB/93DXbdnHlVxuNFm3zjMX +1cE6h1cJotEPvIWk2A6YD1QBsskySKgo7MBvvB+ToCoesbcZpD6fBwi0cod2OBN9SqX4C XF/9zofHLpUpTTXBqyWuchGH83PhskhIr5KrDIAzrpghRFIlj7Z5lco3qOguVNHim5GXmd AGMcXWAEegVThZ8yTQYsZhF/zBQH+YARYJOxjVELlhev6OO1HQcBiteHxf4zGS5z716tW8 8bFhP/1ySSkOGiJ+VpQ7XOUS0Zp1Fm+oY0feXWK8bRlVJ+c1Vm5wTdJTaVbXug== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794477085; b=W1Yj9XEnWDdJG+Q6vudoAkp9D+r2Up/M2eOrw/JJ777VwdxWTgAuwtk3Zfuauu9T63edIN 0goCvxoC1Pn7/rLW5bz9MxfJu/Ougv2Ht7Z0YmrIHa7JPMO1wcUpH4POPKdyn+fdXryqXu r/aeN3iT2GebHTAbwVB3cH8y3b0wXvrdDXoYMNgykjJI4jLnLNahix90KfNFm94EJxbB8V JcaFaIV4GLiFqqFNj+iicNKip1XvmQuEV1w+timB/piUzm5tsTWAmgnV/w3nqVwVtkxtxo tMPy8NR76JlugYfG2LsUQ5omeH90pKld3kZRh8VznshrkMMueeQ/d6bfvD8ESA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794477085; 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=iqGYCJqp+l1qlwxuA4cgfxM+s/BLyARfXc648ic/JZw=; b=a2DTeajfV9YGQqvZjZrhYTM0/cuWKFjtAnS7Xd6f+5t2WHeb7wzFJjocSM9nm4Ap8uuML+ iWoXTmKJQQkADIeRN6IenIgHCcb+F5xzzs9j2qGnLBYmMSvqfYBl12QcxTWoQQo1LfjDjl 6EKLgogo21aN827HOD022PWlawJSSBrT4ncaWb9ABuyRSJcOxyWl4EiYqXJ4Fdvhexkxg9 mcI1HU17QHc65i3ns1fNbwuJJ40zmtHYcGaA2xK1apjMbnGuDuPn9HqMo3lNsnUxaNbAXR vb8mNLOLEIZKBcuNQOcdHuQxpOIUNDnp0mnDS+W1MqwBorisvDnZqqxErUwmEg== 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 4jQFyj13n2zxfr for ; Thu, 12 Nov 2026 09:51:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f9c2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 12 Nov 2026 09:51:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 4f1a78adcd65 - main - aw_ccu: h6: Set the lock enable bit of the PLLs 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: 4f1a78adcd6503778b6d0722713b707382ada3a7 Auto-Submitted: auto-generated Date: Thu, 12 Nov 2026 09:51:25 +0000 Message-Id: <6af58c1d.1f9c2.352b30ab@gitrepo.freebsd.org> The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4f1a78adcd6503778b6d0722713b707382ada3a7 commit 4f1a78adcd6503778b6d0722713b707382ada3a7 Author: Emmanuel Vadot AuthorDate: 2026-11-10 14:46:27 +0000 Commit: Emmanuel Vadot CommitDate: 2026-11-12 09:47:29 +0000 aw_ccu: h6: Set the lock enable bit of the PLLs The PLLs have a lock enable bit, bit 29, and the lock status bit, bit 28, is only updated when it is set. The firmware only sets it on the PLLs that it uses, which are the CPUX, DDR0 and PERIPH0 ones, so the other PLLs could never be seen as locked. Set it on all the PLLs when attaching, as Linux does. Tested on: H6 --- sys/dev/clk/allwinner/ccu_h6.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/sys/dev/clk/allwinner/ccu_h6.c b/sys/dev/clk/allwinner/ccu_h6.c index f172d85ab07e..5d344a36a50b 100644 --- a/sys/dev/clk/allwinner/ccu_h6.c +++ b/sys/dev/clk/allwinner/ccu_h6.c @@ -448,6 +448,25 @@ static struct aw_ccung_clk h6_ccu_clks[] = { { .type = AW_CLK_FIXED, .clk.fixed = &pll_video1_clk}, }; +/* + * Registers of the PLLs, the lock status bit of a PLL is only updated when + * its lock enable bit is set. + */ +#define PLL_LOCK_ENABLE (1 << 29) + +static const bus_size_t h6_pll_regs[] = { + 0x00, /* PLL_CPUX */ + 0x10, /* PLL_DDR0 */ + 0x20, /* PLL_PERIPH0 */ + 0x28, /* PLL_PERIPH1 */ + 0x30, /* PLL_GPU */ + 0x40, /* PLL_VIDEO0 */ + 0x48, /* PLL_VIDEO1 */ + 0x58, /* PLL_VE */ + 0x60, /* PLL_DE */ + 0x70, /* PLL_HSIC */ +}; + static int ccu_h6_probe(device_t dev) { @@ -466,6 +485,8 @@ static int ccu_h6_attach(device_t dev) { struct aw_ccung_softc *sc; + uint32_t val; + int error, i; sc = device_get_softc(dev); @@ -476,7 +497,20 @@ ccu_h6_attach(device_t dev) sc->clks = h6_ccu_clks; sc->nclks = nitems(h6_ccu_clks); - return (aw_ccung_attach(dev)); + error = aw_ccung_attach(dev); + if (error != 0) + return (error); + + /* + * Only the PLLs used by the firmware have the lock enable bit set, + * set it for all of them so that we can wait for them to lock. + */ + for (i = 0; i < nitems(h6_pll_regs); i++) { + val = bus_read_4(sc->res, h6_pll_regs[i]); + bus_write_4(sc->res, h6_pll_regs[i], val | PLL_LOCK_ENABLE); + } + + return (0); } static device_method_t ccu_h6ng_methods[] = {