From nobody Thu Dec 12 18:19:06 2024 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 4Y8LMZ4mj7z5gZnN; Thu, 12 Dec 2024 18:19:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y8LMZ2jqwz3xdj; Thu, 12 Dec 2024 18:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734027546; 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=7YHN3DJozd5yXSlkxP7Tz63yq7F1UlPOoKBzlZfccCQ=; b=Bl6zgKFtMqjGn0pU4TPMf2rj5UQi1wbFweu7LlPoud1BxQPnRPwVUb4a8hdArYNatRSJ0L VGHeCYrJJqYxsIK7tz+kqksso+PSxc0uCqul1a9IukOh2jBVhgcC4YXHe7+FUEdbyGaVdv DJpuBiHsrhFbf1Jt3LjT/0bbbeAZPesIPBAxGZMW4FvF9bKAO+dAlBIu2dDFJb0/l5ZIxE 4MzGYALgSW0THvsHqulgRa3joMxICN0xEm8TUEDFqMnMZctWzlWJhGhVlzjC8qFUdFgZzc vXu3nex6uZF3ZvI1of+7Aaf1UcFqw84kUxPtrFYln7TLNbbsJHGn+l8HsCog+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734027546; 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=7YHN3DJozd5yXSlkxP7Tz63yq7F1UlPOoKBzlZfccCQ=; b=Y4RsAIc2+q32G65ynY8zeq/CT5sdVsV6I6weAX/aKV1j1uaMc02B7BMbM4ZSc/dCIwLAdc 0Z/WnSXCflpLK/KyJu6k16SL3E6Fxi81t2+u+XxXYc+yHRD80tTOVqAzE+A5QjuV13a7P9 kQBp9BleVqNZws9cgNjKsfLU0U3NR4KQJfhz3D4Ez3UwhJNIwi9i4De4WlbMuIaV8si8FH xZ+30/MquaTvfBJJs3+lNB/l6EyEJD2+kAIdMLZSH6gNJ11+dLbUVI23/W94rz87d6YG/O oFFrp6nZQqgQaky42Ot0MNCfhsm8g8/sQM29gCxtu2CX3xFKVzYi5EtwcbFqEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734027546; a=rsa-sha256; cv=none; b=h1yhZv5swisgviOd8BsYDqiDa/fLCBN0TqSR7E+V9SWG2SuFt3B09d/oo8WnL3I8hrqRZA N3fa3r/EwZTl6bb5KONQCPvRuVHUvKWArfHIaf+98XoYEKhDjLOBA3txocJVDyJNbp/pxv RKiu4kBLFLM1whY+tw6j4Ydo5rtevZLQmzXdqIwC3B9C7RThNr3nxKUuVbl+CCtBZyiBri +A9U/20BGcydjQ9ff6vYBw0/kckLDK7dmqcNd1BMjuDv6hMjFj3ADiXRCxPMJ1cMdTmcij RJGwFJdQUaxvV33NRibcE1ZLKhk5h6jGAFlLEEAItngvmS1VmMVjyK9NnAW2Mg== 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 4Y8LMZ280jz133S; Thu, 12 Dec 2024 18:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BCIJ6Ir097367; Thu, 12 Dec 2024 18:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BCIJ6fq097364; Thu, 12 Dec 2024 18:19:06 GMT (envelope-from git) Date: Thu, 12 Dec 2024 18:19:06 GMT Message-Id: <202412121819.4BCIJ6fq097364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 1f5c50a86173 - main - pci_host_generic:Add pcib_request_feature on ACPI 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f5c50a8617355758510675cb9412f56fed12efc Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1f5c50a8617355758510675cb9412f56fed12efc commit 1f5c50a8617355758510675cb9412f56fed12efc Author: Andrew Turner AuthorDate: 2024-12-12 16:30:39 +0000 Commit: Andrew Turner CommitDate: 2024-12-12 18:00:23 +0000 pci_host_generic:Add pcib_request_feature on ACPI In the ACPI attachment add support for the pcib_request_feature method. This uses the common _OSC handling. Reviewed by: imp, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48048 --- sys/dev/pci/pci_host_generic_acpi.c | 27 +++++++++++++++++++++++++++ sys/dev/pci/pci_host_generic_acpi.h | 1 + 2 files changed, 28 insertions(+) diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c index d90b7c0c01f8..1ff3a6bda707 100644 --- a/sys/dev/pci/pci_host_generic_acpi.c +++ b/sys/dev/pci/pci_host_generic_acpi.c @@ -287,6 +287,8 @@ pci_host_generic_acpi_init(device_t dev) sc = device_get_softc(dev); handle = acpi_get_handle(dev); + acpi_pcib_osc(dev, &sc->osc_ctl, 0); + /* Get Start bus number for the PCI host bus is from _BBN method */ status = acpi_GetInteger(handle, "_BBN", &sc->base.bus_start); if (ACPI_FAILURE(status)) { @@ -504,6 +506,30 @@ generic_pcie_acpi_get_id(device_t pci, device_t child, enum pci_id_type type, return (pcib_get_id(pci, child, type, id)); } +static int +generic_pcie_acpi_request_feature(device_t pcib, device_t dev, + enum pci_feature feature) +{ + struct generic_pcie_acpi_softc *sc; + uint32_t osc_ctl; + + sc = device_get_softc(pcib); + + switch (feature) { + case PCI_FEATURE_HP: + osc_ctl = PCIM_OSC_CTL_PCIE_HP; + break; + case PCI_FEATURE_AER: + osc_ctl = PCIM_OSC_CTL_PCIE_AER; + break; + default: + return (EINVAL); + } + + return (acpi_pcib_osc(pcib, &sc->osc_ctl, osc_ctl)); +} + + static device_method_t generic_pcie_acpi_methods[] = { DEVMETHOD(device_probe, generic_pcie_acpi_probe), DEVMETHOD(device_attach, pci_host_generic_acpi_attach), @@ -517,6 +543,7 @@ static device_method_t generic_pcie_acpi_methods[] = { DEVMETHOD(pcib_release_msix, generic_pcie_acpi_release_msix), DEVMETHOD(pcib_map_msi, generic_pcie_acpi_map_msi), DEVMETHOD(pcib_get_id, generic_pcie_acpi_get_id), + DEVMETHOD(pcib_request_feature, generic_pcie_acpi_request_feature), DEVMETHOD_END }; diff --git a/sys/dev/pci/pci_host_generic_acpi.h b/sys/dev/pci/pci_host_generic_acpi.h index 802099abb9d7..5617da971306 100644 --- a/sys/dev/pci/pci_host_generic_acpi.h +++ b/sys/dev/pci/pci_host_generic_acpi.h @@ -35,6 +35,7 @@ struct generic_pcie_acpi_softc { struct generic_pcie_core_softc base; int segment; + uint32_t osc_ctl; ACPI_BUFFER ap_prt; /* interrupt routing table */ };