From patchwork Fri Apr 8 09:44:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 65365 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp569071lbl; Fri, 8 Apr 2016 02:45:22 -0700 (PDT) X-Received: by 10.66.55.70 with SMTP id q6mr11195471pap.126.1460108721883; Fri, 08 Apr 2016 02:45:21 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id ld10si22582pab.98.2016.04.08.02.45.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 02:45:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; 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 198.145.21.10 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 59C4C1A1EE2; Fri, 8 Apr 2016 02:45:21 -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 CFD131A1E99 for ; Fri, 8 Apr 2016 02:45:19 -0700 (PDT) Received: by mail-wm0-x234.google.com with SMTP id f198so57518805wme.0 for ; Fri, 08 Apr 2016 02:45:19 -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=tUJZHA/WH98F41QQB3vfzD5d//5CF2l/8Qrdee2/lMU=; b=D8ONCI5lDFx7aDJf/XeRfZNd/oVtb6SHOTfTROTEREhpCyqEO86h7EZp47PIJ9Ejxs N8vINt2Ml6DZ/Da++3uVZX+kzk5KDU5fKcgEPJuOVrPgTKJQOPBC1ekHx9sLkkjW9xf3 lUq8yB5Er2rtCcGu3Cm3khUAzRvHAB3KdaIIM= 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=tUJZHA/WH98F41QQB3vfzD5d//5CF2l/8Qrdee2/lMU=; b=LCawSLNbPfT4ZI2OG4j8IcIWIya1gUSwQ+rhynUro3JQnDRivNq4bdWJTldrdZ1/Za ZIrHPaPBGIClMoWeHhdqhkdlWRWiMMXj7Lxlf6Q8TvPNTrqgtWdBLbB3zaGPQMT+0Ge+ jotIxbYN8x035B25iE5/uq0jt+EvpeOpqZ2r5rJR+zgcTH0NUZ0r7Wnx3N1aQZSzaK2X OG2Qg1dOAiMAX5r6il2DI7LjagcosuCZpjHzTa8AryZrdS/OXtKaP91SWdYFArXf14P4 EX8qs91GUvOcHZwMP2KNFsrPQp7+E9Jl40pPu4cfK+/K8gBNOvHaUfesDS5JzqqjXSrr BLfg== X-Gm-Message-State: AD7BkJJiOUR7UhbPJng2BKYxHMQxfwdXc49DBZ0oVv1eZMyIISYMQPVHiYtykLnOFb6Mxvw9 X-Received: by 10.194.6.36 with SMTP id x4mr8412530wjx.122.1460108718487; Fri, 08 Apr 2016 02:45:18 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id s10sm9710681wjp.3.2016.04.08.02.45.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Apr 2016 02:45:17 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 8 Apr 2016 11:44:48 +0200 Message-Id: <1460108711-12122-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460108711-12122-1-git-send-email-ard.biesheuvel@linaro.org> References: <1460108711-12122-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 01/24] 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 | 108 ++++++++++++++++++++ 2 files changed, 111 insertions(+) -- 2.5.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek 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..0913c89a8e45 --- /dev/null +++ b/ArmVirtPkg/Include/Protocol/FdtClient.h @@ -0,0 +1,108 @@ +/** @file + + DISCLAIMER: the FDT_CLIENT_PROTOCOL introduced here is a work in progress, + and should not be used outside of the EDK II tree. + + 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_H__ +#define __FDT_CLIENT_H__ + +#define FDT_CLIENT_PROTOCOL_GUID { \ + 0xE11FACA0, 0x4710, 0x4C8E, {0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C }\ + } + +// +// 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 UINT32 *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 UINT32 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_NEXT_COMPATIBLE_NODE) ( + IN FDT_CLIENT_PROTOCOL *This, + IN CONST CHAR8 *CompatibleString, + IN INT32 PrevNode, + 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 UINT32 *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 UINT32 *RegElemSize, + OUT UINT32 *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_NEXT_COMPATIBLE_NODE FindNextCompatibleNode; + FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY FindCompatibleNodeProperty; + FDT_CLIENT_FIND_COMPATIBLE_NODE_REG FindCompatibleNodeReg; + + FDT_CLIENT_GET_CHOSEN_NODE GetOrInsertChosenNode; +}; + +extern EFI_GUID gFdtClientProtocolGuid; + +#endif