From patchwork Wed Apr 6 16:14:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 65190 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1146855lbc; Wed, 6 Apr 2016 09:15:35 -0700 (PDT) X-Received: by 10.66.221.167 with SMTP id qf7mr72145212pac.94.1459959335542; Wed, 06 Apr 2016 09:15:35 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id 78si5478653pft.93.2016.04.06.09.15.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Apr 2016 09:15:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 225401A1FB7; Wed, 6 Apr 2016 09:15:34 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8059E1A1FB2 for ; Wed, 6 Apr 2016 09:15:32 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id v188so28703175wme.1 for ; Wed, 06 Apr 2016 09:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BcMmqke7zRy402qh4P66Nkgfp45vmMS0rnL5Y5JpeZc=; b=F1YvEpbn/3h3HpVuk2B1t+x2zcc096P7X1KCkiCz3wowu0TG3rk+HNIvWEy/GxtwOJ iQvGRjOfioAQMZ2N+f6IQ9e9MxOS5kY2ux1ynRbcOlwjE8B4zwFAihwsla/9sUMu4ljq kn01XgB1ecBmDpa8SoZiTwiTBIWA3+kGzRn4M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BcMmqke7zRy402qh4P66Nkgfp45vmMS0rnL5Y5JpeZc=; b=A5WJAvU56UapHsjPLYa7zVpL5zvfN/SpcyAqwDeI1iylwub+kces4bEtCePoSSvnU1 F92pjBqAuVTDnbk9nsyU6/lctgJ6LSLoTUjeqy4q6yzUZA/cVfL4L3D6t3jQ1k/9S8+S xEaZiaVcLKFKWh4tZhHI7cpsCOhrcq1Hrra8H0smXfHDtAyT/2E5sk6tW1WFRX9UFyPK ovQ0piEdi22HYK+2bHja3xyjBrBfR1ByU1K3pol+6bzPPL5XfHTd7K27xRbeHxg4oCnq /INV1r77W53vlxebWFc9yNLAoUg9E+K11QjE+Esaj26c3LCj7GDof4xtCgwM4owxOtVa Fnyw== X-Gm-Message-State: AD7BkJKPfsU7xj+bmiZgopLsLyNrnMyxSpnae+qPCWffJUAQHNIQMNK9IKM8DcvTr8mwyHmj X-Received: by 10.28.130.67 with SMTP id e64mr25029591wmd.6.1459959331221; Wed, 06 Apr 2016 09:15:31 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id om6sm3961219wjc.40.2016.04.06.09.15.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Apr 2016 09:15:30 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Wed, 6 Apr 2016 18:14:59 +0200 Message-Id: <1459959319-19293-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459959319-19293-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459959319-19293-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 01/21] ArmVirtPkg: introduce FdtClientProtocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This introduces the FdtClientProtocol, which will be used to expose the device tree provided by the host to other DXE drivers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtPkg.dec | 3 + ArmVirtPkg/Include/Protocol/FdtClient.h | 89 ++++++++++++++++++++ 2 files changed, 92 insertions(+) -- 2.5.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index b6ff63677837..fa908253b320 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -34,6 +34,9 @@ [Guids.common] gArmVirtTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } } gEarlyPL011BaseAddressGuid = { 0xB199DEA9, 0xFD5C, 0x4A84, { 0x80, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } } +[Protocols] + gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } } + [PcdsFixedAtBuild, PcdsPatchableInModule] # # This is the physical address where the device tree is expected to be stored diff --git a/ArmVirtPkg/Include/Protocol/FdtClient.h b/ArmVirtPkg/Include/Protocol/FdtClient.h new file mode 100644 index 000000000000..b7cf8191b5ab --- /dev/null +++ b/ArmVirtPkg/Include/Protocol/FdtClient.h @@ -0,0 +1,89 @@ +/** @file + + Copyright (c) 2016, Linaro Ltd. 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. + +**/ + +#ifndef __FDT_CLIENT_PROTOCOL_H__ +#define __FDT_CLIENT_PROTOCOL_H__ + +// +// Protocol interface structure +// +typedef struct _FDT_CLIENT_PROTOCOL FDT_CLIENT_PROTOCOL; + +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_GET_NODE_PROPERTY) ( + IN FDT_CLIENT_PROTOCOL *This, + IN INT32 Node, + IN CONST CHAR8 *PropertyName, + OUT CONST VOID **Prop, + OUT UINTN *PropSize OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_SET_NODE_PROPERTY) ( + IN FDT_CLIENT_PROTOCOL *This, + IN INT32 Node, + IN CONST CHAR8 *PropertyName, + IN CONST VOID *Prop, + IN UINTN PropSize + ); + +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE) ( + IN FDT_CLIENT_PROTOCOL *This, + IN CONST CHAR8 *CompatibleString, + OUT INT32 *Node + ); + +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY) ( + IN FDT_CLIENT_PROTOCOL *This, + IN CONST CHAR8 *CompatibleString, + IN CONST CHAR8 *PropertyName, + OUT CONST VOID **Prop, + OUT UINTN *PropSize OPTIONAL + ); + +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_REG) ( + IN FDT_CLIENT_PROTOCOL *This, + IN CONST CHAR8 *CompatibleString, + OUT CONST VOID **Reg, + OUT UINTN *RegElemSize, + OUT UINTN *RegSize + ); + +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_GET_CHOSEN_NODE) ( + IN FDT_CLIENT_PROTOCOL *This, + OUT INT32 *Node + ); + +struct _FDT_CLIENT_PROTOCOL { + FDT_CLIENT_GET_NODE_PROPERTY GetNodeProperty; + FDT_CLIENT_SET_NODE_PROPERTY SetNodeProperty; + + FDT_CLIENT_FIND_COMPATIBLE_NODE FindCompatibleNode; + FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY FindCompatibleNodeProperty; + FDT_CLIENT_FIND_COMPATIBLE_NODE_REG FindCompatibleNodeReg; + + FDT_CLIENT_GET_CHOSEN_NODE GetChosenNode; +}; + +#endif