From patchwork Tue Feb 20 17:49:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 128940 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4898004ljc; Tue, 20 Feb 2018 09:50:03 -0800 (PST) X-Google-Smtp-Source: AH8x227nNuNIwvy95V9MFedCWfDVC3UBdv0hnq650Tqc7FtPHHmTMxIJVB6lEdOd1nD7HFIwhOEw X-Received: by 10.98.248.4 with SMTP id d4mr433746pfh.78.1519149003031; Tue, 20 Feb 2018 09:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519149003; cv=none; d=google.com; s=arc-20160816; b=gQKeYxrBSouILjgQVmagneYJDqJpLhzqcY0+1RV0Rn/wh/6tw0F5ixrHlET0EZwSDs RlLMgWzz/4GC7bDMhei9uSW+TPhjsdw7KDnvKd3WKUwHZDaoIUVyhZP/9RcDSsw0afPB +lfz56EBg9OyET/OQZZ2WGa0/W/54RG39xv7RiYQ7j0B8qw7Z0kiNJkVDiD0uqmjlT/Z FsK9ATMXxwcQ8PwlX97yMo+Qx6rEIV9FlvELaX6Y8/RkMFaA0eviC1PBgqPZxEd4/ft6 3wyCR5ZoziJzFbuHBXRGrZBcbzdqn6k84zTe981Vy5v4vOcr7BETkAa4pp2vgWLq8cNp nNOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=cVBDFB2I3V+RGB78mT0Yv0RL4gi6Z3w6I2zaDpfjPCY=; b=BH4/3ZL+rwNlbDb5bGaQ37siun6fP2rRpj+bYEi0ciafhmigO6XH4PhvZw/T2nfAdl F77lvLvz5UPnnfkwibV0MOuAibOdgKAP+Bnrzw51TYBf36E78Za6uR7VboRhz2d9oBQA VKrehRfFTJL7KnLEBKSuY3CAjx04GQAMDug+GNCDLCLNVfRFctpVrUY3lP/thR+kGqd/ HgOHkiPQBm6QvxhsmIC21+/5f0FZPrrNkIFiYfVARywvxHU+ZwkgcXhrE++LMFHnQqdT pPWBVMPCJehp1Sj2HX5jcfPXNSZu9FBJVg6OePs958ihBHlbev4q2IyiPZmMcuzSPcXV PF+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HyGsGSMG; 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 sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id b10si6988265pge.563.2018.02.20.09.50.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 09:50:03 -0800 (PST) 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 header.s=google header.b=HyGsGSMG; 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 sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C6D2F20954CBD; Tue, 20 Feb 2018 09:44:03 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::242; helo=mail-wr0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (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 0024320954CBD for ; Tue, 20 Feb 2018 09:44:01 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id s5so16850029wra.0 for ; Tue, 20 Feb 2018 09:50:00 -0800 (PST) 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=FJYVDeOQmv+DMdmwSxjtl61kZOTF+xx3seo8gDkemUQ=; b=HyGsGSMGtsK9KMixqFzN2M7MRGGpyJZ1C7TeeIqAdswGaJSLRs0APfVf7Bnvg8dWGl yf/nkjS4TGBLZgBsCUg98YNsZ0tiMLz6u4QDyEAy14D9oETZlcIwhHkloeXgfHANznnu AswZVA+mcoXuf8f+ybshKde/q5r1hnQNSgsV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FJYVDeOQmv+DMdmwSxjtl61kZOTF+xx3seo8gDkemUQ=; b=SQKK+KDxMHr0AQIYEbHSf7nYDjnziP3Y0n9Ea6YH1X/Py5XfHKiyRBcqVhstpldauY FzPIr4UefsP9lbK/RqDt91blGCmXq6Ey+Nn8DBsunTU9gQ8kCDh8Xrlq5L5iD5wv40/5 pcBb7ib9FhFP25Bs3qDEybYfS32vSZWZhr26bKTv34MsX+k3pxu0fMGy/5dU4NeIgVwz hqKPcocnRlwLlnXJ89yJ18okAaCSw3SCeCe4WAjUL7p9M5uB7WnlPFEzBnhUo1j5vt7q 8fPtfeAUaNmDHQZIKS/tAu7x9lc9KgH5RT2lrc9qYgdv8BnC6iXR6d4qhebL/1vNovuY WOAw== X-Gm-Message-State: APf1xPCmSX41ZEAxu6j9Xwr/6NXYFbDspBSSF5zmD16fdAi7WufPn9K9 ZWSZeokX+PWAPlnXLYCk4WkhDc5vs1A= X-Received: by 10.223.148.195 with SMTP id 61mr434463wrr.248.1519148998542; Tue, 20 Feb 2018 09:49:58 -0800 (PST) Received: from localhost.localdomain ([105.149.187.179]) by smtp.gmail.com with ESMTPSA id u63sm18282208wrc.26.2018.02.20.09.49.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 09:49:57 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 20 Feb 2018 17:49:39 +0000 Message-Id: <20180220174944.525-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180220174944.525-1-ard.biesheuvel@linaro.org> References: <20180220174944.525-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms v2 2/7] Platform/NinetySixBoards: introduce package and mezzanine protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Introduce the mezzanine protocol and the 96boards package defining the PCDs and GUIDs that may be used by implementations of the protocol. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Platform/NinetySixBoards/Include/Protocol/Mezzanine.h | 71 ++++++++++++++++++++ Platform/NinetySixBoards/NinetySixBoards.dec | 67 ++++++++++++++++++ 2 files changed, 138 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h new file mode 100644 index 000000000000..7869ea979b48 --- /dev/null +++ b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h @@ -0,0 +1,71 @@ +/** @file + + Copyright (c) 2018, 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 _MEZZANINE_H_ +#define _MEZZANINE_H_ + +#include +#include + +#define MEZZANINE_PROTOCOL_GUID \ + { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } } + +typedef struct _MEZZANINE_PROTOCOL MEZZANINE_PROTOCOL; + +/** + Apply the mezzanine's DT overlay + + @param[in] This Pointer to the MEZZANINE_PROTOCOL instance. + @param[in,out] Dtb Pointer to the device tree blob + + @return EFI_SUCCESS Operation succeeded. + @return other An error has occurred. +**/ +typedef +EFI_STATUS +(EFIAPI *APPLY_DEVICE_TREE_OVERLAY) ( + IN MEZZANINE_PROTOCOL *This, + IN OUT VOID *Dtb + ); + +struct _MEZZANINE_PROTOCOL { + // + // Get the device tree overlay for this mezzanine board + // + APPLY_DEVICE_TREE_OVERLAY ApplyDeviceTreeOverlay; + // + // The number of devices on LS connector I2C bus #0 + // + UINT32 I2c0NumDevices; + // + // The number of devices on LS connector I2C bus #1 + // + UINT32 I2c1NumDevices; + // + // Linear array of I2C devices on LS connector bus #0 + // + CONST EFI_I2C_DEVICE *I2c0DeviceArray; + // + // Linear array of I2C devices on LS connector bus #0 + // + CONST EFI_I2C_DEVICE *I2c1DeviceArray; + // + // NULL terminated linked list of SPI devices attached to the LS connector + // + CONST EFI_SPI_PERIPHERAL *SpiDeviceLinkedList; +}; + +extern EFI_GUID gNinetySixBoardsMezzanineProtocolGuid; + +#endif // _MEZZANINE_H_ diff --git a/Platform/NinetySixBoards/NinetySixBoards.dec b/Platform/NinetySixBoards/NinetySixBoards.dec new file mode 100644 index 000000000000..f7e2b01459d7 --- /dev/null +++ b/Platform/NinetySixBoards/NinetySixBoards.dec @@ -0,0 +1,67 @@ +## @file +# +# Copyright (c) 2018, 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. +# +## + +[Defines] + DEC_SPECIFICATION = 0x0001001A + PACKAGE_NAME = NinetySixBoards + PACKAGE_GUID = ce4a4683-6e2d-4ec3-bc11-974289a09ab0 + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[Protocols] + ## Include/Protocol/Mezzanine.h + gNinetySixBoardsMezzanineProtocolGuid = { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } } + +[Guids] + # PCD scope GUID + gNinetySixBoardsTokenSpaceGuid = { 0xe0d2f33a, 0xb7dd, 0x4a69, { 0xb6, 0x76, 0xda, 0xe8, 0xa4, 0x17, 0xa7, 0xb5 } } + + # GUIDs to be installed as protocols to identify which controller connects to which bus + gNinetySixBoardsI2c0MasterGuid = { 0xba10e402, 0xcfdd, 0x4b87, { 0xbd, 0x02, 0x6e, 0x26, 0x9f, 0x01, 0x94, 0x11 } } + gNinetySixBoardsI2c1MasterGuid = { 0xcf64ac46, 0xd0be, 0x4a69, { 0x90, 0xa2, 0xf2, 0x82, 0x5b, 0x92, 0x25, 0x61 } } + gNinetySixBoardsSpiMasterGuid = { 0x9703fd99, 0xe638, 0x42b8, { 0xab, 0x81, 0x52, 0x61, 0x1b, 0xf7, 0xf7, 0x5d } } + +[PcdsFixedAtBuild] + # ASCII DT paths to the I2C parent nodes of the 96boards LS connector + gNinetySixBoardsTokenSpaceGuid.PcdI2c0Parent|""|VOID*|0x00000001 + gNinetySixBoardsTokenSpaceGuid.PcdI2c1Parent|""|VOID*|0x00000002 + + # I2C bus frequency in Hertz + gNinetySixBoardsTokenSpaceGuid.PcdI2c0BusFrequencyHz|0|UINT32|0x00000003 + gNinetySixBoardsTokenSpaceGuid.PcdI2c1BusFrequencyHz|0|UINT32|0x00000004 + + # ASCII DT path to the SPI parent node of the 96boards LS connector + gNinetySixBoardsTokenSpaceGuid.PcdSpiParent|""|VOID*|0x00000005 + + # ASCII DT path to the GPIO parent node of the 96boards LS connector + gNinetySixBoardsTokenSpaceGuid.PcdGpioParent|""|VOID*|0x00000006 + + # Polarity of the 96boards LS connector GPIOs (0 == GPIO_ACTIVE_HIGH, 1 == GPIO_ACTIVE_LOW) + gNinetySixBoardsTokenSpaceGuid.PcdGpioPolarity|0|UINT32|0x00000007 + + # Pin numbers of the 96boards LS connector GPIOs + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinA|0|UINT32|0x00000010 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinB|0|UINT32|0x00000011 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinC|0|UINT32|0x00000012 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinD|0|UINT32|0x00000013 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinE|0|UINT32|0x00000014 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinF|0|UINT32|0x00000015 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinG|0|UINT32|0x00000016 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinH|0|UINT32|0x00000017 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinI|0|UINT32|0x00000018 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinJ|0|UINT32|0x00000019 + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinK|0|UINT32|0x0000001A + gNinetySixBoardsTokenSpaceGuid.PcdGpioPinL|0|UINT32|0x0000001B