From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::142; helo=mail-lf1-x142.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 0763921A00AE6 for ; Fri, 9 Nov 2018 15:02:15 -0800 (PST) Received: by mail-lf1-x142.google.com with SMTP id v5so2483085lfe.7 for ; Fri, 09 Nov 2018 15:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vfKOKnYNRcovWAplCZR3hKGB8HJUL+ZtqEC5a/yWJwI=; b=TNMP7Rxp4WZNTL3T6HGZFDWHL16e2mrYFusaDTjZ6XzXvdMV2Yo5GO1Mvj+tQH5yr1 aYknb/PgFXFJ29nrXMdQSu8gyWwNM1ED57IU9/AOZ/DliocNw/ZwXmuFd+7WPJFG0XTt BNM94X7M8DKur5WyeIIq7PNGUDkapKhIbU05lFG4oEDtekqWILdi1GYPk0Cg+NSmK8j5 PUrLKC7TjXExN6DLGzsTA+MPYJKUeCW7OXEX2VlYnPwadhPCKBNKwy+oGbd/xPFWCiRM OoNXRrdGAwP8kT6k/diwps8XdP8hXRQwd+8Ao2Tv1KACvBnvSAUI5OJND7Nx3WgsGGp+ gPEA== 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=vfKOKnYNRcovWAplCZR3hKGB8HJUL+ZtqEC5a/yWJwI=; b=TBlUEuDxejBDN13WTFDmmr/j8wgmmGsHXeLe1w9uLvvuBxoZY8YarIbe30tstVCtDp 77Zb1vvikj4eMtmTiraZsIeGcw5Ar7Ef+r2jW/Cgl+hN1rTnzVOX9f9DQk++vYe9uWRk culRbpMWFBmCWm9lSwcaRE0yBimRAlFqQVmNBG7GLLIeSeNyY5bDtfN2MMuFtzDJPWpS blUCgBWu7Tywm5Ts15PUytv3yo1SAbkmz0OhMzXHBhQ/0dQAB+a/2+hv2Wz4kxlSf6g2 mJ0QJFtrzu6A0WQ4Awv2NdSmDfoEiL9XLS19QIH/0EC+uI5cMG7SIp168Ze8A26Z+E5C N1QA== X-Gm-Message-State: AGRZ1gL8uxLILiWEE1XJJXzDBEF94Y4jtDyTRBZr7BEJkwq+uL/UvPko 5QCa9cY3jUUUD27hmI38yiH3JH8+OuE= X-Google-Smtp-Source: AJdET5erUFOLJz4suc2WlN6nVT8pvV1T/rTOP5t2pD/QdI2lifalZTqQd5SzysykCW5fymgU5oDthQ== X-Received: by 2002:a19:920a:: with SMTP id u10mr6400036lfd.122.1541804533882; Fri, 09 Nov 2018 15:02:13 -0800 (PST) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id a127sm1274268lfe.73.2018.11.09.15.02.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Nov 2018 15:02:13 -0800 (PST) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, hao.a.wu@intel.com, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com, tm@semihalf.com Date: Sat, 10 Nov 2018 00:01:44 +0100 Message-Id: <1541804508-27499-4-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541804508-27499-1-git-send-email-mw@semihalf.com> References: <1541804508-27499-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH v4 3/7] SolidRun/Armada80x0McBin: Introduce board description library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 X-List-Received-Date: Fri, 09 Nov 2018 23:02:16 -0000 From: Tomasz Michalec This patch implements ArmadaBoarDescLib library for Armada80x0McBin comunity board and add to it ArmadaBoardDescSdMmcGet function with description of connected Xenon host controllers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc | 3 + Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf | 34 ++++++++++ Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c | 66 ++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf create mode 100644 Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc index 52e2b9b..077224d 100644 --- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc +++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc @@ -55,6 +55,9 @@ [Components.AARCH64] Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf +[LibraryClasses.common] + ArmadaBoardDescLib|Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf + ################################################################################ # # Pcd Section - list of all EDK II PCD Entries defined by this Platform diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf new file mode 100644 index 0000000..63a4f66 --- /dev/null +++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.inf @@ -0,0 +1,34 @@ +## @file +# +# Copyright (C) 2018, Marvell International Ltd. and its affiliates
+# +# 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 = 0x0001001A + BASE_NAME = ArmadaMcBinBoardDescLib + FILE_GUID = 8208558f-5f33-46e2-b5c5-43354384389e + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = ArmadaBoardDescLib + +[Sources] + Armada80x0McBinBoardDescLib.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Marvell/Marvell.dec + +[LibraryClasses] + DebugLib + IoLib diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c new file mode 100644 index 0000000..9e38ce0 --- /dev/null +++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c @@ -0,0 +1,66 @@ +/** +* +* Copyright (C) 2018, Marvell International Ltd. and its affiliates. +* +* 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 +#include +#include + +// +// Order of devices in SdMmcDescTemplate has to be in par with ArmadaSoCDescLib +// +STATIC +MV_BOARD_SDMMC_DESC mMcBinSdMmcDescTemplate[] = { + { /* eMMC 0xF06E0000 */ + 0, /* SOC will be filled by MvBoardDescDxe */ + 0, /* SdMmcDevCount will be filled by MvBoardDescDxe */ + FALSE, /* Xenon1v8Enabled */ + TRUE, /* Xenon8BitBusEnabled */ + TRUE, /* XenonSlowModeEnabled */ + 0x40, /* XenonTuningStepDivisor */ + EmbeddedSlot /* SlotType */ + }, + { /* SD/MMC 0xF2780000 */ + 0, /* SOC will be filled by MvBoardDescDxe */ + 0, /* SdMmcDevCount will be filled by MvBoardDescDxe */ + FALSE, /* Xenon1v8Enabled */ + FALSE, /* Xenon8BitBusEnabled */ + FALSE, /* XenonSlowModeEnabled */ + 0x19, /* XenonTuningStepDivisor */ + EmbeddedSlot /* SlotType */ + } +}; + +EFI_STATUS +EFIAPI +ArmadaBoardDescSdMmcGet ( + IN OUT UINTN *SdMmcDevCount, + IN OUT MV_BOARD_SDMMC_DESC **SdMmcDesc + ) +{ + *SdMmcDevCount = ARRAY_SIZE (mMcBinSdMmcDescTemplate); + + *SdMmcDesc = AllocateCopyPool (sizeof (mMcBinSdMmcDescTemplate), + &mMcBinSdMmcDescTemplate); + if (*SdMmcDesc == NULL) { + DEBUG ((DEBUG_ERROR, "%a: Cannot allocate memory\n", __FUNCTION__)); + return EFI_OUT_OF_RESOURCES; + } + + return EFI_SUCCESS; +} -- 2.7.4