From patchwork Thu Apr 12 18:47:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 133306 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1974097ljb; Thu, 12 Apr 2018 11:48:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/z5nl2LQpPu1tVz3yvamZNx9mHCT6mqwgSHraw9Is8AW2LKj11WYTcDBNffg3NA7v/I9FW X-Received: by 2002:a17:902:b2c8:: with SMTP id x8-v6mr2262573plw.83.1523558900844; Thu, 12 Apr 2018 11:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523558900; cv=none; d=google.com; s=arc-20160816; b=GGn9IZsluYTSHm9/vRCcMZTLrQQRLIUkS8IccN65acYoTUrFNKBHD/nb6OmZN98Adl 6iGKps/3Zy8GWMD1g1szcPWcYNtODyYzDjgkOuvy/q4g2kmGP/KKAIM53Njj/9TxSAJl 9rlTHKGuxTUoKB9CKmEF80+CrfCC2YtgD0IqKrWlrVft4yb1tbgxs4VUH8ptLCWYoJCX ss3bKV8QO07nqS2LE35EIH3GQwuPK0m7prkBaxQ6ktpZXXQPVA5AS+5U+/fDE5qsW6qb FQoLQkWJKhu1enIdDK2j7NP9s1WWEPC3qf8QqcqYH0hF53vDMUB7h0kknjTqS53EPH1U l29w== 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:delivered-to:arc-authentication-results; bh=0IazcBVW2/WS4nBQA/k1xkuplV7ZuHJFEj/w+WLnLlY=; b=MS4hXriwjIgX5xjZDNguNxi6blNLXc+ZhQeuLn1B17dVnzHjpPpMMAHl7svxGzVTAv dSlhdF+QpgQ3Dbl2PQCR/FIsInCn3fBE9L20waxgXQ8fX0FQcwfr1uWUE8s8bMXIPaYx qxLzWfx5yE59zloUj5UCTMIQOKAKvqze5uzOm4gudDiSuQMhPMpojJ/+WHJUF5MpNZd4 cKOJ919t8ZKBjE+slvFwhkJYVlQa9wP6f9Er1TS5loeuWXsEn9y7IWvV7OLYIk34LUr8 uhNJchO2S+dD4xgXofxdway2XkC9fUc0DwoXbaSgUgrdeE3OYRQocKM2jNEIC2B7ACQz KLDg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id m8si2641211pgr.85.2018.04.12.11.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Apr 2018 11:48:20 -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; 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 Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B6249226EAC82; Thu, 12 Apr 2018 11:48:17 -0700 (PDT) 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=217.140.101.70; helo=foss.arm.com; envelope-from=thomas.abraham@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 603F5226EAC6A for ; Thu, 12 Apr 2018 11:48:16 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3E1C680D; Thu, 12 Apr 2018 11:48:16 -0700 (PDT) Received: from usa.arm.com (a74716-lin.blr.arm.com [10.162.4.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E084D3F5AD; Thu, 12 Apr 2018 11:48:14 -0700 (PDT) From: Thomas Abraham To: edk2-devel@lists.01.org Date: Fri, 13 Apr 2018 00:17:39 +0530 Message-Id: <1523558863-5427-3-git-send-email-thomas.abraham@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523558863-5427-1-git-send-email-thomas.abraham@arm.com> References: <1523558863-5427-1-git-send-email-thomas.abraham@arm.com> Subject: [edk2] [PATCH edk2-platforms v2 2/6] Platform/ARM/Sgi: add NOR flash platform library implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Vishwanatha HG Add a initial NOR flash driver platform wrapper as part of the platform library. Access to NOR fash 0 is enabled in this initial implementation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vishwanatha HG Signed-off-by: Thomas Abraham --- Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c | 60 ++++++++++++++++++++++ .../ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf | 33 ++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c create mode 100644 Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c new file mode 100644 index 0000000..5d7efea --- /dev/null +++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlash.c @@ -0,0 +1,60 @@ +/** @file + + Copyright (c) 2018, ARM 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. + + **/ + +#include +#include +#include +#include +#include + +STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = { + { + SGI_EXP_SMC_CS0_BASE, + SGI_EXP_SMC_CS0_BASE, + SIZE_256KB * 255, + SIZE_256KB, + {0xEBF0B9DF, 0x17d0, 0x4812, { 0xA9, 0x59, 0xCF, 0xD7, 0x92, 0xEE, 0x31, 0x13} } + }, + { + SGI_EXP_SMC_CS0_BASE, + SGI_EXP_SMC_CS0_BASE + SIZE_256KB * 255, + SIZE_64KB * 4, + SIZE_64KB, + {0x98C111C6, 0xB322, 0x4C33, { 0x95, 0xD5, 0xAF, 0x56, 0xAF, 0x90, 0x18, 0x6A } } + }, +}; + +EFI_STATUS +NorFlashPlatformInitialization ( + VOID + ) +{ + return EFI_SUCCESS; +} + +EFI_STATUS +NorFlashPlatformGetDevices ( + OUT NOR_FLASH_DESCRIPTION **NorFlashDevices, + OUT UINT32 *Count + ) +{ + if ((NorFlashDevices == NULL) || (Count == NULL)) { + return EFI_INVALID_PARAMETER; + } + + *NorFlashDevices = mNorFlashDevices; + *Count = sizeof (mNorFlashDevices) / sizeof (NOR_FLASH_DESCRIPTION); + + return EFI_SUCCESS; +} diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf new file mode 100644 index 0000000..a860e5c --- /dev/null +++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf @@ -0,0 +1,33 @@ +#/** @file +# +# Copyright (c) 2018, ARM 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] + INF_VERSION = 0x00010005 + BASE_NAME = NorFlashSgiLib + FILE_GUID = 3f021755-6d74-4065-9ee4-98225267b36e + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = NorFlashPlatformLib + +[Sources.common] + NorFlash.c + +[Packages] + MdePkg/MdePkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + +[LibraryClasses] + BaseLib + DebugLib + IoLib