From nobody Sun May 19 09:08:43 2024 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 Reviewed-by: Leif Lindholm --- 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- From nobody Sun May 19 09:08:43 2024 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+39908+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+39908+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1556791145; cv=none; d=zoho.com; s=zohoarc; b=gcbYSEE2Sn8sUyrEJ6VIBZwj2ib7f5L3w2fNG+btJgR9BJncTbRjORQdlQiHhxjhWvN8+1UoLaKt3qNBJxYjA7kmd64PNJiO0+51Mw2QgUpHAQ678AzEJC8vDxsqhJwxeSeWPlI16Uw9Qq25fsJJbiYs4oySZAees+jH5r3ammg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556791145; 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=gZmz6DbPRTqkOgqcyAG00/Wxpi3T68qjsbriUo+t3H0=; b=BuBkvFUK+rHmxZseUwxavlHz9P1ddTDbz46uSwEqEgituttaj0XG82dvi7XVD5ozs2MaYmf88KhuuN6zg1z6G/TBaxn09B9XJ9DOyi3zHbG+c+h1ebqnEk12WPQ0OnvqFqQ/EUt/3mWoa5FMv8w4au8VPi7dp3pSE0vNRuM10s0= 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+39908+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 1556791145548249.70758401953344; Thu, 2 May 2019 02:59:05 -0700 (PDT) Return-Path: X-Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by groups.io with SMTP; Thu, 02 May 2019 02:59:04 -0700 X-Received: by mail-wm1-f43.google.com with SMTP id q15so1919988wmf.3 for ; Thu, 02 May 2019 02:59:03 -0700 (PDT) X-Gm-Message-State: APjAAAVm69JsY2c4n7XuS8ExAijEd4XxUSzcFhwEv5EbDIOuNccfM6ak EUaRiesY8gbmwLy1STc2iNq9yurYB3FtDA== X-Google-Smtp-Source: APXvYqxVc8b3fiTEBC+D3NESwV2e0rBwhIm7krDT3a0HzV6qhpoqE/5xZoSM6dJ37Hajf1BDWkJ9aQ== X-Received: by 2002:a7b:c25a:: with SMTP id b26mr1599176wmj.123.1556791141790; Thu, 02 May 2019 02:59:01 -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.59.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 02:59:00 -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 2/2] Platform/Secure96Dxe: add ACPI description of the LEDs and I2C peripherals Date: Thu, 2 May 2019 11:58:54 +0200 Message-Id: <20190502095854.6989-3-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=1556791144; bh=/22OcI3m61Tq7l8N3ASnaA8p84F2u+n/1bEQgryB6ok=; h=Cc:Date:From:Reply-To:Subject:To; b=ogonC6mv0dpD/tnHlWQ5qcOIoWe84tL84QPVzvP0sKwpaRXdFGhATgY0pAADx6qJdmX wzka84jFiUekyAhmLel0srdUTY87mi1yjeiubyj1BMdt43+weNi82f5DyPH13ZCl5xDvi 9gPGTpeXLXsURbpOrCul5G7pbsQKREcby5w= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Wire up the new 96boards mezzanine SSDT loading support, and use it to describe the four GPIO LEDs on the Secure96 mezzanine board, as well as the two ATmel crypto accelerators residing on the I2C bus. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- Platform/96Boards/Secure96Dxe/Secure96.asl | 116 ++++++++++++++++++++ Platform/96Boards/Secure96Dxe/Secure96.h | 8 ++ Platform/96Boards/Secure96Dxe/Secure96Dxe.c | 59 +++++++++- Platform/96Boards/Secure96Dxe/Secure96Dxe.inf | 1 + 4 files changed, 179 insertions(+), 5 deletions(-) diff --git a/Platform/96Boards/Secure96Dxe/Secure96.asl b/Platform/96Boards= /Secure96Dxe/Secure96.asl new file mode 100644 index 000000000000..f458929fffb6 --- /dev/null +++ b/Platform/96Boards/Secure96Dxe/Secure96.asl @@ -0,0 +1,116 @@ +/** @file + * Copyright (c) 2019, Linaro Limited. All rights reserved. + * + * This program and the accompanying materials are licensed and made + * available under the terms and conditions of the BSD License which + * accompanies this distribution. The full text of the license may be + * found at http://opensource.org/licenses/bsd-license.php + * + * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR + * IMPLIED. + */ + +#include "Secure96.h" + +DefinitionBlock ("Secure96.aml", "SSDT", 2, "96BRDS", "SECURE96", 1) +{ + Scope (_SB) + { + Device (LD96) + { + Name (_HID, "LNRO9601") + Name (_UID, 0x0) + Name (_CID, "PRP0001") + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { Package () { "compatible", "gpio-leds" }, } + }) + Name (_CRS, ResourceTemplate() { + GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputO= nly, SECURE96_ACPI_GPIO) + { + FixedPcdGet32 (PcdGpioPinG), + FixedPcdGet32 (PcdGpioPinF), + FixedPcdGet32 (PcdGpioPinI), + FixedPcdGet32 (PcdGpioPinH), + } + }) + + Device (LDU1) + { + Name (_ADR, 0x1) + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "label", "secure96-u1" }, + Package () { "gpios", Package () { ^^LD96, 0, 0, 0= }, }, + } + }) + } + + Device (LDU2) + { + Name (_ADR, 0x2) + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "label", "secure96-u2" }, + Package () { "gpios", Package () { ^^LD96, 0, 1, 0= }, }, + } + }) + } + + Device (LDU3) + { + Name (_ADR, 0x3) + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "label", "secure96-u3" }, + Package () { "gpios", Package () { ^^LD96, 0, 2, 0= }, }, + } + }) + } + + Device (LDU4) + { + Name (_ADR, 0x4) + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "label", "secure96-u4" }, + Package () { "gpios", Package () { ^^LD96, 0, 3, 0= }, }, + } + }) + } + } + + Device (SH96) + { + Name (_HID, "LNRO9602") + Name (_UID, 0x0) + Name (_CID, "PRP0001") + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { Package () { "compatible", "atmel,atsha204a" = }, } + }) + Name (_CRS, ResourceTemplate() { + I2CSerialBus (ATSHA204A_SLAVE_ADDRESS,, 100000,, SECURE96_= ACPI_I2C0,,,,) + }) + } + + Device (EC96) + { + Name (_HID, "LNRO9603") + Name (_UID, 0x0) + Name (_CID, "PRP0001") + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { Package () { "compatible", "atmel,atecc508a" = }, } + }) + Name (_CRS, ResourceTemplate() { + I2CSerialBus (ATECC508A_SLAVE_ADDRESS,, 100000,, SECURE96_= ACPI_I2C0,,,,) + }) + } + } +} diff --git a/Platform/96Boards/Secure96Dxe/Secure96.h b/Platform/96Boards/S= ecure96Dxe/Secure96.h index 84b8aed13d1e..a44dc4804f92 100644 --- a/Platform/96Boards/Secure96Dxe/Secure96.h +++ b/Platform/96Boards/Secure96Dxe/Secure96.h @@ -23,4 +23,12 @@ #define INFINEON_SLB9670_SPI_CS 0x0 #define INFINEON_SLB9670_DT_NODENAME tpm@0 =20 +#ifndef SECURE96_ACPI_GPIO +#define SECURE96_ACPI_GPIO "\\_SB.GPIO" +#endif + +#ifndef SECURE96_ACPI_I2C0 +#define SECURE96_ACPI_I2C0 "\\_SB.I2C0" +#endif + #endif // _SECURE96_H_ diff --git a/Platform/96Boards/Secure96Dxe/Secure96Dxe.c b/Platform/96Board= s/Secure96Dxe/Secure96Dxe.c index 6c48d7c0b024..68f8ec812b52 100644 --- a/Platform/96Boards/Secure96Dxe/Secure96Dxe.c +++ b/Platform/96Boards/Secure96Dxe/Secure96Dxe.c @@ -24,6 +24,8 @@ =20 #include "Secure96.h" =20 +#define SECURE96_SSDT_OEM_TABLE_ID SIGNATURE_64('S','E','C','U','R','E','9= ','6') + STATIC CONST UINT32 mI2cAtmelSha204aSlaveAddress[] =3D { ATSHA204A_SLAVE_ADDRESS, =20 @@ -148,15 +150,20 @@ ApplyDeviceTreeOverlay ( UINTN OverlaySize; EFI_STATUS Status; INT32 Err; + UINTN Index; =20 // // Load the raw overlay DTB image from the raw section of this FFS file. // - Status =3D GetSectionFromFv (&gEfiCallerIdGuid, - EFI_SECTION_RAW, 0, &Overlay, &OverlaySize); - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { - return EFI_NOT_FOUND; + for (Index =3D 0;; Index++) { + Status =3D GetSectionFromFv (&gEfiCallerIdGuid, + EFI_SECTION_RAW, Index, &Overlay, &OverlaySize); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + if (!fdt_check_header (Overlay)) { + break; + } } =20 // @@ -177,8 +184,50 @@ ApplyDeviceTreeOverlay ( return EFI_SUCCESS; } =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. +**/ +STATIC +EFI_STATUS +EFIAPI +InstallSsdtTable ( + IN MEZZANINE_PROTOCOL *This, + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ) +{ + EFI_ACPI_DESCRIPTION_HEADER *Ssdt; + UINTN SsdtSize; + EFI_STATUS Status; + UINTN Index; + UINTN TableKey; + + // + // Load SSDT table from the raw section of this FFS file. + // + for (Index =3D 0;; Index++) { + Status =3D GetSectionFromFv (&gEfiCallerIdGuid, EFI_SECTION_RAW, Index, + (VOID **)&Ssdt, &SsdtSize); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + if (SsdtSize >=3D sizeof (EFI_ACPI_DESCRIPTION_HEADER) && + Ssdt->OemTableId =3D=3D SECURE96_SSDT_OEM_TABLE_ID) { + break; + } + } + return AcpiProtocol->InstallAcpiTable (AcpiProtocol, Ssdt, SsdtSize, + &TableKey); +} + STATIC MEZZANINE_PROTOCOL mMezzanine =3D { ApplyDeviceTreeOverlay, + InstallSsdtTable, ARRAY_SIZE (mI2c0Devices), 0, mI2c0Devices, diff --git a/Platform/96Boards/Secure96Dxe/Secure96Dxe.inf b/Platform/96Boa= rds/Secure96Dxe/Secure96Dxe.inf index 72dbf1314c15..ce4c8b5f8fa5 100644 --- a/Platform/96Boards/Secure96Dxe/Secure96Dxe.inf +++ b/Platform/96Boards/Secure96Dxe/Secure96Dxe.inf @@ -21,6 +21,7 @@ [Defines] ENTRY_POINT =3D Secure96DxeEntryPoint =20 [Sources] + Secure96.asl Secure96.dts Secure96.h Secure96Dxe.c --=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 (#39908): https://edk2.groups.io/g/devel/message/39908 Mute This Topic: https://groups.io/mt/31453110/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-