From patchwork Fri Feb 23 15:40:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129391 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp744694lja; Fri, 23 Feb 2018 07:41:11 -0800 (PST) X-Google-Smtp-Source: AH8x227eDlO7iuHJgWSLBai2a/K1SarZEs0dDFV3zZy+HSzXiqbOfciVyRrcTFcsEs5zhlKh0Uwb X-Received: by 10.99.121.140 with SMTP id u134mr1731020pgc.89.1519400471125; Fri, 23 Feb 2018 07:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519400471; cv=none; d=google.com; s=arc-20160816; b=S5zP7eZwPl76q2Odes5wYdtFgoBtxCgLIzOHYrbvos5cAw5xWV7zMkC9xImky79fak OPBJKtn2IC1NU0gp5sp3rYdX/T8vC/28wEVV7LLraw0Lbs8+2qZbFKh3Ulw3UW6GuhS7 YNZjgQ1Jgwwi0M7xYgIgWS6JcSGcc2k5GxQEnYEUJ1e3EZT4NIaPcE9o4XC8i5MUn8IB Ge+Bl64hst+V8OyZ4UEL0J0N39KGh1KN+3bCn2Sx5wWEdENTji8p2tXrUSk85X+9oaTi 4rCdm2h4b0Sq3tpYtgLRBjaswSa8o7ECztSAJt340Nih5LBvlwUtb5J64zfE30u+nRLv qTZg== 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=QbeIuKnSkyuRmCGjx/RGVidZvAo9kZ6fXg/UsjmvOtE=; b=O0LcghhNbHsxvDHEy2syuFzaEl4cbGt5oDqCS+hCvOJp98/KoXyWsP/SqdRTeGI3vf P9L9eVvJBEsQIUgIA2GJq0MhhWnGVVrWrtV17R9QfwjN0mYdDoO4P1seRUI6yh8a6Tmd gAHctoP6O1OwJ43J3WSDrpvt6Ou1cxnBb3hBPn17jRo+EiNFPYmFYKAw+moMo4mK0u3l VoEUw7NDQHtYAwjZOJQu7xuoTBxk7uiyHXsc8fgtI/mBFBzceKBWfqZT3B/5MtLaC1Cc 2fyTWxr62hPnh/nq0Z1NrljLc5l91iecLUruQYyUzwvCKYsd9rDdQXYOk26vOkrwTQ1F fA4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=agAEewbj; 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 q11-v6si1915809pll.379.2018.02.23.07.41.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:41:11 -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=agAEewbj; 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 97E1B21FD73D3; Fri, 23 Feb 2018 07:35:08 -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::243; helo=mail-wr0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (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 6563C22436956 for ; Fri, 23 Feb 2018 07:35:06 -0800 (PST) Received: by mail-wr0-x243.google.com with SMTP id z12so14544783wrg.4 for ; Fri, 23 Feb 2018 07:41:08 -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=WP8isaFUCyJo3H6KltEq48RI1meTjpK28QPXUtYoI9Y=; b=agAEewbjfxnMkP255bW3CK7hrRXFPXZV7vtC5D8rI7YZzUg8V1ArVMq/p8y0Behrm9 1RlDVXyz0WwiIlnU+eLWmh5DDvUyM9lJs/ufm72XMuvqTl/CFGHkHfpBUAq2YOPy5nxb pfx9+glswlWq9cG0rzpe1JB0A/t2LeAYkHp4k= 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=WP8isaFUCyJo3H6KltEq48RI1meTjpK28QPXUtYoI9Y=; b=btV+UuCYwr8aSqc7WHlQ302/oGs6XYOkOCFFSgmfh8IuH++U+xTEI+zoaTZWlDlnnS UaxLcghByN8mZslqj1QYJEt7lkyOGzPf6j2eLtC9/FcEqMGsJNnSPN4OxqIP9LH85Hbd hpwhzlcVYDthK8idtPDZsVSup3gIMRSkUQmrIJ4DpDx5uPpH8awjgOkR6opKmbeE3DnS sTt1glZWROJCOYAeOGQwr4adiB84AKA149ZtnpkRofHN5GWZG797cIeEbqWAiKKhzZNB ZfLghvqiXAtG+vU2oQ01IhVBiUnfu6aieBNF9Ah9HgPHiupbMT2EDJ6RBypGLGUNQw1Y D/0A== X-Gm-Message-State: APf1xPC1OviAKRY+Wby49/f9hcQEOLua13R/RyEp7gDNW93YViQkFF2Z 15Lr65VO3bfxR7M5ulbydRQ8vzErXiI= X-Received: by 10.223.160.42 with SMTP id k39mr2236574wrk.138.1519400466562; Fri, 23 Feb 2018 07:41:06 -0800 (PST) Received: from localhost.localdomain ([196.90.4.100]) by smtp.gmail.com with ESMTPSA id 188sm2273215wmg.29.2018.02.23.07.41.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:41:05 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 23 Feb 2018 15:40:47 +0000 Message-Id: <20180223154052.9828-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180223154052.9828-1-ard.biesheuvel@linaro.org> References: <20180223154052.9828-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms v3 1/6] Platform/96Boards: 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/96Boards/96Boards.dec | 67 ++++++++++++++++++ Platform/96Boards/Include/Protocol/Mezzanine.h | 71 ++++++++++++++++++++ 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/96Boards/96Boards.dec b/Platform/96Boards/96Boards.dec new file mode 100644 index 000000000000..2a063ced9e4a --- /dev/null +++ b/Platform/96Boards/96Boards.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 = 96Boards + PACKAGE_GUID = ce4a4683-6e2d-4ec3-bc11-974289a09ab0 + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[Protocols] + ## Include/Protocol/Mezzanine.h + g96BoardsMezzanineProtocolGuid = { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } } + +[Guids] + # PCD scope GUID + g96BoardsTokenSpaceGuid = { 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 + g96BoardsI2c0MasterGuid = { 0xba10e402, 0xcfdd, 0x4b87, { 0xbd, 0x02, 0x6e, 0x26, 0x9f, 0x01, 0x94, 0x11 } } + g96BoardsI2c1MasterGuid = { 0xcf64ac46, 0xd0be, 0x4a69, { 0x90, 0xa2, 0xf2, 0x82, 0x5b, 0x92, 0x25, 0x61 } } + g96BoardsSpiMasterGuid = { 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 + g96BoardsTokenSpaceGuid.PcdI2c0Parent|""|VOID*|0x00000001 + g96BoardsTokenSpaceGuid.PcdI2c1Parent|""|VOID*|0x00000002 + + # I2C bus frequency in Hertz + g96BoardsTokenSpaceGuid.PcdI2c0BusFrequencyHz|0|UINT32|0x00000003 + g96BoardsTokenSpaceGuid.PcdI2c1BusFrequencyHz|0|UINT32|0x00000004 + + # ASCII DT path to the SPI parent node of the 96boards LS connector + g96BoardsTokenSpaceGuid.PcdSpiParent|""|VOID*|0x00000005 + + # ASCII DT path to the GPIO parent node of the 96boards LS connector + g96BoardsTokenSpaceGuid.PcdGpioParent|""|VOID*|0x00000006 + + # Polarity of the 96boards LS connector GPIOs (0 == GPIO_ACTIVE_HIGH, 1 == GPIO_ACTIVE_LOW) + g96BoardsTokenSpaceGuid.PcdGpioPolarity|0|UINT32|0x00000007 + + # Pin numbers of the 96boards LS connector GPIOs + g96BoardsTokenSpaceGuid.PcdGpioPinA|0|UINT32|0x00000010 + g96BoardsTokenSpaceGuid.PcdGpioPinB|0|UINT32|0x00000011 + g96BoardsTokenSpaceGuid.PcdGpioPinC|0|UINT32|0x00000012 + g96BoardsTokenSpaceGuid.PcdGpioPinD|0|UINT32|0x00000013 + g96BoardsTokenSpaceGuid.PcdGpioPinE|0|UINT32|0x00000014 + g96BoardsTokenSpaceGuid.PcdGpioPinF|0|UINT32|0x00000015 + g96BoardsTokenSpaceGuid.PcdGpioPinG|0|UINT32|0x00000016 + g96BoardsTokenSpaceGuid.PcdGpioPinH|0|UINT32|0x00000017 + g96BoardsTokenSpaceGuid.PcdGpioPinI|0|UINT32|0x00000018 + g96BoardsTokenSpaceGuid.PcdGpioPinJ|0|UINT32|0x00000019 + g96BoardsTokenSpaceGuid.PcdGpioPinK|0|UINT32|0x0000001A + g96BoardsTokenSpaceGuid.PcdGpioPinL|0|UINT32|0x0000001B diff --git a/Platform/96Boards/Include/Protocol/Mezzanine.h b/Platform/96Boards/Include/Protocol/Mezzanine.h new file mode 100644 index 000000000000..9847649d2ac3 --- /dev/null +++ b/Platform/96Boards/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 _96BOARDS_MEZZANINE_H_ +#define _96BOARDS_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 g96BoardsMezzanineProtocolGuid; + +#endif // _96BOARDS_MEZZANINE_H_