From nobody Tue Apr 01 17:46:14 2025 X-Original-To: dev-commits-src-branches@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 4ZRwQt6Klyz5rsKG; Tue, 01 Apr 2025 17:46:14 +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 4ZRwQt3Qnvz3Krg; Tue, 01 Apr 2025 17:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743529574; 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=Kk1ACLrwTWjw1pmuYrnYSA36KO4cS/USoKAyIYZ0EgI=; b=FtUCBh2RFYPu5wPK7nB4oozV156xe+FKCMFlGQIt6CQ951ckqyp5VbRVKZWerkOZIm3ADk mIS03zEDWSx0g5qX8BQNvkez4wNHo2yVMTCK92FJ+p2JDhh5WuqATPL6gb/goWI2t9rNn0 m99DG+esQiK9rBvEjgI1S6gUWf0ovZEV5XSFbgBvlIK93OWijYdso5XSh45Z/4lx/nOR80 cYaZIaIgyHPWCPRsk2ppBBmAIjYTsmVrs7h3x1rpUGF0D7rnD4tkaFcfO4V0iqyEVypAwd CTWOwjFLJxpCQ2nGBwGGrPJMOlgj/WgiieLNkgsUzByzoovMCPjf9Cbv/DB7iQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1743529574; a=rsa-sha256; cv=none; b=DHmFg90Qb1YcKqKP1geoAl86MGsKoPe4/VXodKT9gE5zEltBttAbFSv9VwLhvr/wR7vlKj BpPHn4x5ZNijoshEDYThwc2LbRlsX0+ZTZKsyjGpzXURpt1B/s/WT9XBXfrRY/3rTsU8nl SaTsWdxRncGXY/QrJcs9cQUaS2dnKcwxl7rOPCkOW5D7M7eeg4riJrPcSCcibBbyEl9Jrg 87W1VxoG5zNEaMxyVt/RwzJHJyhezjLhxuyIpSGnlUexrhlz6oc8BxVlVuhKz2xT3+7tCE Sc49Z2VjCD2p67T+BthTJpXowzbysuq8tt5s7aNe5YIfmD2oPhEc7rTC9Yq4bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743529574; 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=Kk1ACLrwTWjw1pmuYrnYSA36KO4cS/USoKAyIYZ0EgI=; b=lQnv5UUHlONaAEPvPLhxGnKuxpdS6uHsxulzE/rpcgC4lsMUJ3XmPpJ7fjZ2FbYgkWQxql YbU9fksSHaV7IenIeSS5qbqe6GvtXGhz9THYaq4MKPu96rLZsY5brRDmxULOU0vQ1smOD4 NG3JB5OFrmEZ2wP3bl7c2wZDyIiiLOazW5S0iX0R51B6Q4ILTeTxXdIOfZGnhQeCVr68ZH m9XiSDes3BIHF65rRGOAcYYCetwkGaa3cOohlj4zBUvh+ykMDH6gUG7B2BlHOCjtDhx7WN VQOE97fTYKzze7cCbUrOBL8lkgSnckbjqYQ/7UL6WeWs7LbzngDlw2biHEnLXw== 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 4ZRwQt2Sj1zh3F; Tue, 01 Apr 2025 17:46:14 +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 531HkEl1050226; Tue, 1 Apr 2025 17:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 531HkEAd050223; Tue, 1 Apr 2025 17:46:14 GMT (envelope-from git) Date: Tue, 1 Apr 2025 17:46:14 GMT Message-Id: <202504011746.531HkEAd050223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 3c9eae3c11da - stable/14 - pci_host_generic:Add pcib_request_feature on ACPI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3c9eae3c11da69103389c2a1fd5a7c34948e6e13 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3c9eae3c11da69103389c2a1fd5a7c34948e6e13 commit 3c9eae3c11da69103389c2a1fd5a7c34948e6e13 Author: Andrew Turner AuthorDate: 2024-12-12 16:30:39 +0000 Commit: Colin Percival CommitDate: 2025-04-01 17:43:57 +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 (cherry picked from commit 1f5c50a8617355758510675cb9412f56fed12efc) --- 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 b389eeb16fcf..992e8b5c8b8d 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)) { @@ -503,6 +505,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), @@ -516,6 +542,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 */ };