From nobody Sun Feb 8 23:59:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39907+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39907+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1556791143; cv=none; d=zoho.com; s=zohoarc; b=nXsyKL0M10uIozokvET8/p13DU1B4pLYDZQn9R/Q3v1XKAm/i9LjFxG4jwzULC7o0acOidE4GgetdiyzcKsuFMvJMgR5gsUsGLJRjG+A/IiXk/z+zpdTo7CC948fFgJPLSGeDAt6R3HRZWk35AlO5De4n7KwcDqJ8LLmlxytmaI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556791143; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=zAboyE8fOoAVv/FTYNhWOpbWNw6KWKqtM+rZ573OPR4=; b=WLZIepZcuLjpRBxj6GWO2BxQYv7k3zEjsOLgvN14pjYzwHjm/H7jzlCYr2N8i4GcdygKjcR+L0KXwJbgyXzBWPKYSRHltVcGgWpbPMlidPFKN0+xz2+uXYs1//xvqyL5CmbcbUvdJd9VL91eXUXhDIye5YZxJoPITKVS8H8s16E= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39907+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1556791143535820.4455308794018; Thu, 2 May 2019 02:59:03 -0700 (PDT) Return-Path: X-Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by groups.io with SMTP; Thu, 02 May 2019 02:59:02 -0700 X-Received: by mail-wr1-f65.google.com with SMTP id k16so2457429wrn.5 for ; Thu, 02 May 2019 02:59:02 -0700 (PDT) X-Gm-Message-State: APjAAAXxVnMVtmwRMfMT+0BVb1VfvALd5STt6rS/IHzxgWdKADXmOexw 4zDgRQ638LmNVlm2eJ/1SnOLBM7R24DLXQ== X-Google-Smtp-Source: APXvYqwONprPUvDO2Z65bvTUqOF4W7xq82vwpdf13K/ybVd96iv5rV21WvhnJh2UMDdKV662U9g1Pw== X-Received: by 2002:adf:ec0d:: with SMTP id x13mr2038263wrn.268.1556791140499; Thu, 02 May 2019 02:59:00 -0700 (PDT) X-Received: from sudo.home ([2a01:cb1d:112:6f00:2dc9:bac0:dc74:9979]) by smtp.gmail.com with ESMTPSA id j3sm10681740wrg.72.2019.05.02.02.58.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 02:58:59 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, graeme.gregory@linaro.org, Ard Biesheuvel Subject: [edk2-devel] [PATCH edk2-platforms v2 1/2] Platform/96Boards: add ACPI support to mezzanine/LS connector driver Date: Thu, 2 May 2019 11:58:53 +0200 Message-Id: <20190502095854.6989-2-ard.biesheuvel@linaro.org> In-Reply-To: <20190502095854.6989-1-ard.biesheuvel@linaro.org> References: <20190502095854.6989-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556791143; bh=FomJJm0Vo+RgwddPrtulURMaRSGlFWLau/8pPbu/ZAc=; h=Cc:Date:From:Reply-To:Subject:To; b=As1reE2zDTE3Gz/MtvDoZ/6H+JctUIg6PM9X6EhA29Ft+6q4K+/tXIQlLhIQX1dyBO5 FxpiindHuBe+QTHAyEjKLrTt6UfIi3ui4VV43ma3UKIdGVKoMAm71nvEJycDgfHPu/1xf RZNAVwYUREdzQFnUYAsgVx66e+4VXHcSQ5g= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Make the LS connector mezzanine support code ACPI aware, and invoke the appropriate hook in the driver code to install a SSDT instead of a DT overlay when running on a system that is booting in ACPI mode. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Platform/96Boards/Include/Protocol/Mezzanine.h | 21 ++++++++++++ Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c | 35 ++++++++++++++---= --- Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf | 1 + 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/Platform/96Boards/Include/Protocol/Mezzanine.h b/Platform/96Bo= ards/Include/Protocol/Mezzanine.h index 9847649d2ac3..97f43e9a920f 100644 --- a/Platform/96Boards/Include/Protocol/Mezzanine.h +++ b/Platform/96Boards/Include/Protocol/Mezzanine.h @@ -16,6 +16,7 @@ #define _96BOARDS_MEZZANINE_H_ =20 #include +#include #include =20 #define MEZZANINE_PROTOCOL_GUID \ @@ -39,12 +40,32 @@ EFI_STATUS IN OUT VOID *Dtb ); =20 +/** + Install the mezzanine's SSDT table + + @param[in] This Pointer to the MEZZANINE_PROTOCOL instance. + @param[in] Dtb Pointer to the device tree blob + + @return EFI_SUCCESS Operation succeeded. + @return other An error has occurred. +**/ +typedef +EFI_STATUS +(EFIAPI *INSTALL_SSDT_TABLE) ( + IN MEZZANINE_PROTOCOL *This, + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ); + struct _MEZZANINE_PROTOCOL { // // Get the device tree overlay for this mezzanine board // APPLY_DEVICE_TREE_OVERLAY ApplyDeviceTreeOverlay; // + // Install the mezzanine's SSDT table + // + INSTALL_SSDT_TABLE InstallSsdtTable; + // // The number of devices on LS connector I2C bus #0 // UINT32 I2c0NumDevices; diff --git a/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c b/Platform/9= 6Boards/LsConnectorDxe/LsConnectorDxe.c index f19d95635056..27044c5da699 100644 --- a/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c +++ b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include =20 @@ -97,7 +98,7 @@ InstallHiiPages ( STATIC VOID EFIAPI -ApplyDeviceTreeOverlay ( +PublishOsDescription ( EFI_EVENT Event, VOID *Context ) @@ -105,11 +106,30 @@ ApplyDeviceTreeOverlay ( VOID *Dtb; MEZZANINE_PROTOCOL *Mezzanine; EFI_STATUS Status; + EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol; + + Status =3D gBS->LocateProtocol (&g96BoardsMezzanineProtocolGuid, NULL, + (VOID **)&Mezzanine); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "%a: no mezzanine driver active\n", __FUNCTION__)); + return; + } + + Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, + (VOID **)&AcpiProtocol); + if (!EFI_ERROR (Status)) { + Status =3D Mezzanine->InstallSsdtTable (Mezzanine, AcpiProtocol); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "%a: failed to install SSDT table - %r\n", + __FUNCTION__, Status)); + } + return; + } =20 // // Find the DTB in the configuration table array. If it isn't there, just - // bail without an error: we may be running on an ACPI platform even if - // this driver does not support it [yet]. + // bail without an error: the system may be able to proceed even without + // ACPI or DT description, so it isn't up to us to complain about this. // Status =3D EfiGetSystemConfigurationTable (&gFdtTableGuid, &Dtb); if (Status =3D=3D EFI_NOT_FOUND) { @@ -117,13 +137,6 @@ ApplyDeviceTreeOverlay ( } ASSERT_EFI_ERROR (Status); =20 - Status =3D gBS->LocateProtocol (&g96BoardsMezzanineProtocolGuid, NULL, - (VOID **)&Mezzanine); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "%a: no mezzanine driver active\n", __FUNCTION__)); - return; - } - Status =3D Mezzanine->ApplyDeviceTreeOverlay (Mezzanine, Dtb); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "%a: failed to apply DT overlay - %r\n", __FUNCTIO= N__, @@ -211,7 +224,7 @@ EntryPoint ( Status =3D gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, TPL_NOTIFY, - ApplyDeviceTreeOverlay, + PublishOsDescription, NULL, &gEfiEndOfDxeEventGroupGuid, &EndOfDxeEvent); diff --git a/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf b/Platform= /96Boards/LsConnectorDxe/LsConnectorDxe.inf index 1bf528ceaa84..20b9637c1923 100644 --- a/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf +++ b/Platform/96Boards/LsConnectorDxe/LsConnectorDxe.inf @@ -46,6 +46,7 @@ [LibraryClasses] [Protocols] g96BoardsLsConnectorProtocolGuid ## PRODUCES g96BoardsMezzanineProtocolGuid ## CONSUMES + gEfiAcpiTableProtocolGuid ## SOMETIMES_CONSUMES =20 [Guids] gEfiEndOfDxeEventGroupGuid --=20 2.20.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39907): https://edk2.groups.io/g/devel/message/39907 Mute This Topic: https://groups.io/mt/31453109/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-