From nobody Wed Dec 3 06:51:58 2025 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 4dLpGQ4h2gz6Hmh5 for ; Wed, 03 Dec 2025 06:51:58 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLpGQ3lRDz3Q6r for ; Wed, 03 Dec 2025 06:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764744718; 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=ZB5YdKGX5MCSHUsp8D47vBL711ofLy0QBJdA17LL2xg=; b=QV9zxbInOOKRRPDVDXKL1u3Y3ZplwnOUnj374nZSlGk2OiJXGCnZa9whY+rK+cfOfmk4Lu 3oPOKK646DV8RJR+3ALSSjtbJJxrmxsGRBYrWvCIGqmqScZK6CYoRIj9jv2x6Ej5WlCBwv ii51Xak1mcicTEAELwaSvIsLJWfX4wh4uF4PqO5xYNhSEhYm38RL9fExtDQmaI8wu0OPSV OLDCCjCcfep8VHG1UAsqEpFhsgAjc20/pUY6+k8GFvWfc62Y26pHwwA52du6Pom7dgdh0k nB+WxX99zBLJb/1sTk7RBfIqv0QzuPYXg4DOJ00xYB2Qo6lt/DrnhhQe1xqiZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764744718; 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=ZB5YdKGX5MCSHUsp8D47vBL711ofLy0QBJdA17LL2xg=; b=xv9v/hoeii5YQGHxeNLI+dsDZk47UFRgmT9j6OnhBnB3JRzYjkfkO2J+DjlrAoGOlEwZDq yI9ap4KJioV9x/qJ5OaTAhQaTfmnqc+IWFvEwzeIRbMWSuq3KCbwIKlm1IbnE1LZ4HogMI I+oQGh40pEOPwOKj/PiU02jL6tgFFRGbmiasOjJSEJ688lA4a9vWtA7gZYMGJp9OIE8aj8 GGNLDp8JetD/RDlmYuAc+6Nm8+rx0XlC64raYP/eSVQqzDMbv48KraxDchkkWL5TG4H7aG neD0IHW7wJweD22xUPjxb1Q2bQDr5cY/mTfdmglA6HwTa+SBqASjaFquAfLuxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764744718; a=rsa-sha256; cv=none; b=cJP/AeS8Xer76pz60y5ioy+GognVSTZTTjVIDsqjIOo0NwovMzActBlyauuFaizKTc1h7F 2GOe84C8P1YQVJIeO7akWRpxJoK1oopTQZbDpdx1f9eNqlct+IUKwWdoGblz7zfww5u8Bk g0fKCvSaFAk2WndnHB4r8CQTheLJi7wdIx2PTzGnlysYxZDMqkixjzV7vdkcAlgPVKbf71 YTt1tcYLB/nXc6wsvO5kEZ1ngwmd9oLDtwnjcjPtWMgI0TDQWqcNYRl0JxEHZH/Y7/q0/z ulQs0fdSMmMQTJYvHcSMHqafhZwtKo4l2tGJ3pOLKXhgU7L9OJQGjl1t2PrrTw== 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 4dLpGQ3BDZzBPP for ; Wed, 03 Dec 2025 06:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22d76 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 06:51:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: d14a985898ee - main - ofw: Add ofw_bus_is_machine_compat(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d14a985898eebd3bda8bb30c4078bde3ebd135f2 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 06:51:58 +0000 Message-Id: <692fde0e.22d76.185bc98a@gitrepo.freebsd.org> The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=d14a985898eebd3bda8bb30c4078bde3ebd135f2 commit d14a985898eebd3bda8bb30c4078bde3ebd135f2 Author: Michal Meloun AuthorDate: 2025-11-06 18:50:52 +0000 Commit: Michal Meloun CommitDate: 2025-12-03 06:47:41 +0000 ofw: Add ofw_bus_is_machine_compat(). We need a quick way to identify a given machine (SoC), mainly when implementing quirks for a given SoC. MFC after: 2 weeks Reviwed by: imp Differential Revision: https://reviews.freebsd.org/D53992 --- sys/dev/ofw/ofw_bus_subr.c | 9 +++++++++ sys/dev/ofw/ofw_bus_subr.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index b99d784929bc..efca3ea14e2f 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -298,6 +298,15 @@ ofw_bus_is_compatible_strict(device_t dev, const char *compatible) return (0); } +bool +ofw_bus_is_machine_compatible(const char *compat) +{ + phandle_t root; + + root = OF_finddevice("/"); + return (ofw_bus_node_is_compatible(root, compat) != 0); +} + const struct ofw_compat_data * ofw_bus_search_compatible(device_t dev, const struct ofw_compat_data *compat) { diff --git a/sys/dev/ofw/ofw_bus_subr.h b/sys/dev/ofw/ofw_bus_subr.h index 1a33d7655f77..203c9689f156 100644 --- a/sys/dev/ofw/ofw_bus_subr.h +++ b/sys/dev/ofw/ofw_bus_subr.h @@ -117,6 +117,9 @@ int ofw_bus_is_compatible(device_t, const char *); int ofw_bus_is_compatible_strict(device_t, const char *); int ofw_bus_node_is_compatible(phandle_t, const char *); +/* Check if machine (root node) is compatible */ +bool ofw_bus_is_machine_compatible(const char *); + /* * Helper routine to search a list of compat properties. The table is * terminated by an entry with a NULL compat-string pointer; a pointer to that