From nobody Thu Nov 16 00:53:27 2023 X-Original-To: dev-commits-src-main@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 4SW1k01YZWz50xdt; Thu, 16 Nov 2023 00:53:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SW1k013XGz4FTJ; Thu, 16 Nov 2023 00:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700096008; 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=zz9YKUx3M/oaPrmnWmAEm3tUdvDE5tnCDUfnolnj+d8=; b=XhGcP/mYQ3DPx80FGWqaB2QosWmfeuzJ2lQa+2EyGH9DXsOQjnuPg4fRxZ35TXMcA27fVj Cd+DUYjNsH7824oeD2gZmyOji4tkWUGvuszbkLKAl8rKkRFGBZitOrz/eYHR1PERkRzFM0 RdYkhjncBIlz/mYdlO2DQ1XxG43j5M8r7ZFuh/pJFVbQLf4qj7lAxTZCzNn4r4s0ck6hQE kzrFSnr+Rr5q9mcNS8x9iyGUPuip7jYosVqgd0BoM51Pj0sXqyjE1IVhF+YIEZL1I4sZ45 hjGQsc7MLjiUL3kwBHyUN3wF/hZG5pHGzE6kiGFMEcIrhwciyvYRL8C+lv9NMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700096008; 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=zz9YKUx3M/oaPrmnWmAEm3tUdvDE5tnCDUfnolnj+d8=; b=LMXwHtBXHtZcqvinv3OuJ3TnGBRGGSMsfw4oqICXFUJrTg2NMAbEzkJo5ZDrkkNo50itUP 3ZBLcoI30VjRbkroTHm3Lz/jJlAuAydGYkMl5QGUqK0iMp6o+wDIrcre3NFD4Sxz35PDS9 iSIVN+LV5VWgs0XSv2fV0nHh3WA4sSEOMLo2ceV75Km08S6fPm4+j/HKk8YVoMBz7nbyuY 8WCgvo5aTgaJgg7hLa9gidcRpdvNZBhDOrZE3Umrnh1G8zxMEIh3ijC1WAAk2FmqTXHPZ3 JfHf/Is5WWsA7d0Zqybv8VUp7JCTzLOPAneeUSxYiUIEJtVsFFUckEYofUdu+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700096008; a=rsa-sha256; cv=none; b=vDjNP5+mOebyQU3+RpAZ0gnpFb3u0UDk9BLuOF3F1rAIwUEwh2c94Uk7nKRdUMxfqHCXqB cSxGMNOClr9qw/O0yYrwv9HJOUSZxoM0fJTuhZCCWaHU5TjwzVJj0s4dV0f1KFlmjbEuy7 RUrTLrSYfu3/pQVscG7Y5kAdCdohsvnbHdUFTaExHtchJxBv57xkowf8KXFJn8QPd7H37l RSrGafgwibGSJBo2c3J5Jr8UW10qI5zPP1Ei0BcV/qBqz0V4x4QuLagiTZpiVYlv8OZuVJ A7QJ6OYQt2JxNLfqCzTZNTcN4nJmpSE0N22lPbAwH/+SyqOQ+IG4Kqp94NfIEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SW1k005xHzdV4; Thu, 16 Nov 2023 00:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AG0rRgc048678; Thu, 16 Nov 2023 00:53:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AG0rRuv048675; Thu, 16 Nov 2023 00:53:27 GMT (envelope-from git) Date: Thu, 16 Nov 2023 00:53:27 GMT Message-Id: <202311160053.3AG0rRuv048675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 5972ffde919a - main - ig4(4): Add an EMAG device type List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5972ffde919ab65ba29d4d51ccf735da18d52719 Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=5972ffde919ab65ba29d4d51ccf735da18d52719 commit 5972ffde919ab65ba29d4d51ccf735da18d52719 Author: Andrew Gallatin AuthorDate: 2023-11-16 00:51:28 +0000 Commit: Andrew Gallatin CommitDate: 2023-11-16 00:53:21 +0000 ig4(4): Add an EMAG device type Sponsored by: Ampere Computing LLC, Netflix Submitted by: allanjude Differential Revision: https://reviews.freebsd.org/D28746 Reviewed by: imp --- sys/dev/ichiic/ig4_acpi.c | 12 ++++++++++-- sys/dev/ichiic/ig4_iic.c | 3 +++ sys/dev/ichiic/ig4_var.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/dev/ichiic/ig4_acpi.c b/sys/dev/ichiic/ig4_acpi.c index f88cca6cf13d..3f370ae7abb9 100644 --- a/sys/dev/ichiic/ig4_acpi.c +++ b/sys/dev/ichiic/ig4_acpi.c @@ -83,13 +83,21 @@ static int ig4iic_acpi_attach(device_t dev) { ig4iic_softc_t *sc; + char *str; int error; sc = device_get_softc(dev); sc->dev = dev; - /* All the HIDs matched are Atom SOCs. */ - sc->version = IG4_ATOM; + error = ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids, &str); + if (error > 0) + return (error); + if (strcmp(str, "APMC0D0F") == 0) { + sc->version = IG4_EMAG; + } else { + /* All the other HIDs matched are Atom SOCs. */ + sc->version = IG4_ATOM; + } sc->regs_rid = 0; sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->regs_rid, RF_ACTIVE); diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c index 195bca62928a..3dc72c458b24 100644 --- a/sys/dev/ichiic/ig4_iic.c +++ b/sys/dev/ichiic/ig4_iic.c @@ -89,6 +89,9 @@ * Ig4 hardware parameters except Haswell are taken from intel_lpss driver */ static const struct ig4_hw ig4iic_hw[] = { + [IG4_EMAG] = { + .ic_clock_rate = 100, /* MHz */ + }, [IG4_HASWELL] = { .ic_clock_rate = 100, /* MHz */ .sda_hold_time = 90, /* nsec */ diff --git a/sys/dev/ichiic/ig4_var.h b/sys/dev/ichiic/ig4_var.h index 964a610e7408..989cf23779a2 100644 --- a/sys/dev/ichiic/ig4_var.h +++ b/sys/dev/ichiic/ig4_var.h @@ -42,6 +42,7 @@ #include "iicbus_if.h" enum ig4_vers { + IG4_EMAG, IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE,