From nobody Tue Jan 6 01:43:34 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 4dlYpt473yz6MtbB for ; Tue, 06 Jan 2026 01:43:34 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dlYpt3PqCz47wN for ; Tue, 06 Jan 2026 01:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767663814; 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=QgAI4qSqFMYcFKHeI8F409dmIbKNqHrG2ssgC/DoTnM=; b=BN1SnWxbDKeGLBeYq0ED+evSALNh2FCeWgrSdqAjmCrXNUf435ZiEXXwbXGoJ9oNvflquf +t5yOmtgAPBUwrZvljCrpTQSfuEvqUdKdJWfCPyhLp+2nwsV887hxpx9zoSzyCotxp5UXO Wn/RUDGYELtUivW4DRwwoSG57wn9qd92dx2MUPi67v/7cDO4UTMtP17l/Xd07p/jAWVQvN dfj1KymQu3Lejm6c6eVU5tHTqwcIcsHu0p7+tqIPp82cgsxOWtQ2jHX66DzwjBek5sS7A1 +y+YIkGEEz8v4F4cKe6pQxwHxKym79b7neyj+jUK93yNkqdN2Ckvp3288KWkGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767663814; 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=QgAI4qSqFMYcFKHeI8F409dmIbKNqHrG2ssgC/DoTnM=; b=r17BCdrIzHvNlVxyLnyOYPRs4X3EDT+YMtwwHnJMoOyPOm8DljHvU6sxHqklbKUAxT/V/D eVkZFrix50E03zZs+7VfvqgcCJRWFD7lfa77WAItpEX3DxuDipyOHiPkM7dzcD+hkUz3lm jpiXsMpqtlO/91WekBg4xl3AuaTfNNw7o07GRcLE7wzlrxv+GTIkEnV3DGzimA9oHZysmx voK6Hw51wwZT26Qb7NKJU5iGTz43mKe8ECUuiAgMgPz8dQE89qoMM1r0nJ+QG7OxSHVtBz K85NMo+Fd87UDG+OlMzWnMOQqthq1mAMDzR6qlz1B+Gu+vYLAilUcPreBJGyMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767663814; a=rsa-sha256; cv=none; b=ULaYXy4UHz/uowmZNZgBx3uutKMWeZr7YDpcx+ec/w5W8mm5icIlzNWCULofoZ0yoH3hr0 WtgVppXSOq5Mzw76VALbOE6NMwKLnt2y1wbhNQoZieNSd8Ta8Q3rHUe5O7xlg9tqx0rdsF EnpJPy0YT35jTEIP/dyDlmybmPsnCbXoqyP5OjgDZ8MBk+R3gW0YZcnvo2SHPV+DJPErRv rgm5Ur39a6aZZLdaCXqOjNWfrYsG9LPYWXHEWGrnm1X/bJwiPG3yJQHkzzbxqMm8ArrdsC HmeSMQTYS/I5IU7mPy5rA7Iu3GpHHHNHrB1DM+3BmYbKyJvl2/ZgUT9I2uxSPg== 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 4dlYpt2l1PzmPQ for ; Tue, 06 Jan 2026 01:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ff5d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 06 Jan 2026 01:43:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: f224591746bd - main - Add ASMC_DEBUG make option 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: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f224591746bdaf14ad5f63de4738a3146cc2f55f Auto-Submitted: auto-generated Date: Tue, 06 Jan 2026 01:43:34 +0000 Message-Id: <695c68c6.3ff5d.593fc2c7@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=f224591746bdaf14ad5f63de4738a3146cc2f55f commit f224591746bdaf14ad5f63de4738a3146cc2f55f Author: Enji Cooper AuthorDate: 2026-01-04 08:27:57 +0000 Commit: Enji Cooper CommitDate: 2026-01-06 01:43:04 +0000 Add ASMC_DEBUG make option This allows folks to enable debug statements in asmc(4) using kernel configs via the `options ASMC_DEBUG` directive. While here, remove a duplicate `device vt_efifb` directive in `NOTES` as it's already handled in the `GENERIC` config MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54511 --- sys/amd64/conf/NOTES | 7 ++++--- sys/conf/options.amd64 | 3 +++ sys/dev/asmc/asmc.c | 20 +++++++++++--------- sys/modules/asmc/Makefile | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index d48fd10c0e62..efcc03623c05 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -43,9 +43,6 @@ cpu HAMMER # aka K8, aka Opteron & Athlon64 # Optional devices: # -# vt(4) drivers. -device vt_efifb # EFI framebuffer - # 3Dfx Voodoo Graphics, Voodoo II /dev/3dfx CDEV support. This will create # the /dev/3dfx0 device to work with glide implementations. This should get # linked to /dev/3dfx and /dev/voodoo. Note that this is not the same as @@ -116,6 +113,10 @@ device efidev # EFI RTC device efirtc +# Apple System Management Controller (SMC) +device asmc +options ASMC_DEBUG # Enable asmc(4)-specific debug logic. + # # Intel QuickAssist driver with OpenCrypto support # diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64 index df18abfa8e1e..a3a735731438 100644 --- a/sys/conf/options.amd64 +++ b/sys/conf/options.amd64 @@ -68,3 +68,6 @@ MPTABLE_LINUX_BUG_COMPAT # x86 specific uart options UART_NS8250_EARLY_PORT opt_uart.h + +# Enable asmc(4)-specific debug logic. +ASMC_DEBUG opt_asmc.h diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 0572c8e663a7..5d3b97a065c9 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -34,6 +34,8 @@ * Inspired by the Linux applesmc driver. */ +#include "opt_asmc.h" + #include #include #include @@ -83,7 +85,7 @@ static void asmc_sms_calibrate(device_t dev); static int asmc_sms_intrfast(void *arg); static void asmc_sms_printintr(device_t dev, uint8_t); static void asmc_sms_task(void *arg, int pending); -#ifdef DEBUG +#ifdef ASMC_DEBUG void asmc_dumpall(device_t); static int asmc_key_dump(device_t, int); #endif @@ -515,7 +517,7 @@ static driver_t asmc_driver = { */ #define _COMPONENT ACPI_OEM ACPI_MODULE_NAME("ASMC") -#ifdef DEBUG +#ifdef ASMC_DEBUG #define ASMC_DPRINTF(str) device_printf(dev, str) #else #define ASMC_DPRINTF(str) @@ -828,7 +830,7 @@ asmc_resume(device_t dev) return (0); } -#ifdef DEBUG +#ifdef ASMC_DEBUG void asmc_dumpall(device_t dev) { struct asmc_softc *sc = device_get_softc(dev); @@ -939,7 +941,7 @@ nosms: sc->sc_nkeys = 0; } -#ifdef DEBUG +#ifdef ASMC_DEBUG asmc_dumpall(dev); #endif @@ -974,19 +976,19 @@ asmc_wait_ack(device_t dev, uint8_t val, int amount) static int asmc_wait(device_t dev, uint8_t val) { -#ifdef DEBUG +#ifdef ASMC_DEBUG struct asmc_softc *sc; #endif if (asmc_wait_ack(dev, val, 1000) == 0) return (0); -#ifdef DEBUG +#ifdef ASMC_DEBUG sc = device_get_softc(dev); #endif val = val & ASMC_STATUS_MASK; -#ifdef DEBUG +#ifdef ASMC_DEBUG device_printf(dev, "%s failed: 0x%x, 0x%x\n", __func__, val, ASMC_CMDPORT_READ(sc)); #endif @@ -1009,7 +1011,7 @@ asmc_command(device_t dev, uint8_t command) { } } -#ifdef DEBUG +#ifdef ASMC_DEBUG device_printf(dev, "%s failed: 0x%x, 0x%x\n", __func__, command, ASMC_CMDPORT_READ(sc)); #endif @@ -1055,7 +1057,7 @@ out: return (error); } -#ifdef DEBUG +#ifdef ASMC_DEBUG static int asmc_key_dump(device_t dev, int number) { diff --git a/sys/modules/asmc/Makefile b/sys/modules/asmc/Makefile index f1b4a981ad24..4ba45a4625d8 100644 --- a/sys/modules/asmc/Makefile +++ b/sys/modules/asmc/Makefile @@ -1,6 +1,6 @@ .PATH: ${SRCTOP}/sys/dev/asmc KMOD= asmc -SRCS= asmc.c opt_acpi.h acpi_if.h bus_if.h device_if.h +SRCS= asmc.c opt_acpi.h opt_asmc.h acpi_if.h bus_if.h device_if.h .include