From nobody Thu Oct 29 16:01:45 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 4jFprT5kPXz6xFB7 for ; Thu, 29 Oct 2026 16:01:45 +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 4jFprT4QJqz4jbk for ; Thu, 29 Oct 2026 16:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793289705; 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=MJ0BEPdcY3FXuvTcKQ/9mEk5+u/RT6LkW8XL31P6Z6A=; b=k0GJfr/eqAwF1xaKEDc3zuIzQwDTeELXXxAk0mNdLHj39zccjjKZF+2S4RBEKVCdFfW3aU LFAiroNeyXzsbnV9U9TXY6xmbMsbJBEoWDpd+im9IwdqHAcoRFvunY+lxNyNAtDnaQ6wzF aUhjr3OjqVqDDijkwTxajrm5s4EveWvKifLYwcGlZ+GCZPZ5Y/RA3ZIjEnzyWkTmYI9QMY kovceIT2Oedqa5ndP8OwzzB7apFO0rOHThIN7XT+81VxqphbI4wQMWknj6KVn+2WOxHrR3 BgQWieH7Z6XY61Zyzr1Hu0YHfrFTCG8rIzKMhNa0EzFzSb6fHE9oUsgnRD9Sgg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793289705; b=jScfCM/B6iG4Sx4a1KU9yf8UQXf7FlX3ei9lRn1MINjoV+JOcUA51FBOiygqEC1uiqCQgQ QEFtXaGd12LkXwoazvmo5pShsmv6AHT6HyOtEdJ6I0Sm4fqE9QSxNOFFxZD2yQucHx8/fx l6NttWMPaTJ1JlI6eVGecwP+McwnBkrDRLcg1Odl5+0nv8PLU5nO/lszH7KbmT+EZhFDcU ZZCqogqR4/H1SBCo2/bl6MU7378d3mptHB70T5Ghjbd7eB60rLxYUXeGAQh1dqIFVeh50m rI2gXXxLRsujtsQi1X0Ox4U3knsBNvgH9YKsq+3+iMD8h259Xin3am25gnpxMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793289705; 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=MJ0BEPdcY3FXuvTcKQ/9mEk5+u/RT6LkW8XL31P6Z6A=; b=juo+ENIAA83CGJcSIhY6C52Z0VoH2zt/BP1HGM9UFva+Cm3TieOLh8QlWwHhJ7golLpk+8 JFCQwyiEGX/kTsR3hkwWdH0poN9X6ssYtcc9XKNsTv7Ef9PedLl0AA3VF5Jy1hr9kduJ4s iRpVUvpbG9puAJ8bPqCVzdf4Dx5UakKkuadP/3Hbbx7rmFhgDvea/XeFZSuc406a5+7DUV 8lW+hHVHUiKzIK+YfWJ/JQKTgrfcsUIyhaypdVK102KapsICSTmccgsTzy4aW2wHx6pbFJ U5PSOVTMMABfXG+mw4NSSI6rX4W7kNU+Uhr13F2oBFrHbGurspe0VytiW0AA0g== 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 4jFprT45hczn5J for ; Thu, 29 Oct 2026 16:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32ea2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 16:01:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 3a2528ae7a61 - main - rk_pinctrl: Fix the drive strength of the pins on the older SoCs List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 3a2528ae7a61b9423d10a1272aebcf1ada771839 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 16:01:45 +0000 Message-Id: <6ae36de9.32ea2.11bb0b2a@gitrepo.freebsd.org> The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3a2528ae7a61b9423d10a1272aebcf1ada771839 commit 3a2528ae7a61b9423d10a1272aebcf1ada771839 Author: Emmanuel Vadot AuthorDate: 2026-10-29 06:49:39 +0000 Commit: Emmanuel Vadot CommitDate: 2026-10-29 16:00:52 +0000 rk_pinctrl: Fix the drive strength of the pins on the older SoCs rk_pinctrl_parse_drive(), used for every Rockchip SoC but the RK3568, could never succeed and so the drive-strength of the pins was never programmed: - OF_getencprop() returns the size of the property, but the result was tested against 0. A present property made the function return an error. - The register offset of the matching table entry was never returned, so the caller used whatever was left in reg (the pull register or an uninitialized value). Fixing only the first problem would have written the drive value in the wrong register. - The table lookup skipped an entry only if both the bank and the subbank differed, so an entry matching only one of them could be used. Test the size of the property, skip an entry if either the bank or the subbank differs and return the offset of the entry. Tested on a Rock64 (RK3328) by clearing the drive strength of the gmac pins in U-Boot: without this change they stay at 2mA, with it they get the 4mA and 8mA of the DTS and the rest of the GRF is unchanged. On a RockPro64 (RK3399) the registers are unchanged, no pin of its default DTS is in the tables of this driver that has a drive-strength. Not tested on RK3288. Note that the RK3399 tables only cover GPIO0 and GPIO1. The other banks, which have 3 bits per pin on some groups, are still not handled. Reviewed by: mmel --- sys/arm64/rockchip/rk_pinctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/rockchip/rk_pinctrl.c b/sys/arm64/rockchip/rk_pinctrl.c index 027e6a79266f..4fefbd5766b9 100644 --- a/sys/arm64/rockchip/rk_pinctrl.c +++ b/sys/arm64/rockchip/rk_pinctrl.c @@ -1016,16 +1016,17 @@ rk_pinctrl_parse_drive(struct rk_pinctrl_softc *sc, phandle_t node, int i; if (OF_getencprop(node, "drive-strength", &value, - sizeof(value)) != 0) + sizeof(value)) != sizeof(value)) return (-1); /* Map to the correct drive value */ for (i = 0; i < sc->conf->npin_drive; i++) { - if (sc->conf->pin_drive[i].bank != bank && + if (sc->conf->pin_drive[i].bank != bank || sc->conf->pin_drive[i].subbank != subbank) continue; if (sc->conf->pin_drive[i].ma == value) { *drive = sc->conf->pin_drive[i].value; + *offset = sc->conf->pin_drive[i].offset; return (0); } }