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::543; helo=mail-ed1-x543.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (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 DA46C2194D3AE for ; Tue, 13 Nov 2018 04:33:35 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id d3so9705546edx.7 for ; Tue, 13 Nov 2018 04:33:35 -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=tzA/ooqmYzi0uQyH3hcuuG27rxLtRJFv1192VC0qazA=; b=vbx32CHsZZokvt75N4Uo82Px8oq/PAEpCGZFXfNqWQRI/qvCDKDIh5EYruu6mZ8+qt F4vhalowZn0mOi1wH334ddQVFucZSO/JOpmFnPUA7VvFUwRnbJXo9ej3jO/Gxvu8uCge 6xhro7cuoObBbJTDr62IgMhTFPPQt5Oi/DV/k476WbNdXslM/FLclOm2L6ZNgLvMiCKZ 6oJ4P7VgrjhZhc6y96WgX6x2+VWN584+T+XTinXho6bX3EC0vp9aHXFsf9TAmlow/Gws Px+bLqNLi1mmHjppEs/P/dKqLN3tYOCU8jqL2y+ZFQVQcNJpNcyPgqefgqFt3ot/bofC opzA== 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=tzA/ooqmYzi0uQyH3hcuuG27rxLtRJFv1192VC0qazA=; b=cgG5qiVOY5j0M8Ftw/QauStUHZLqZbTp7RiKtriekc2QIlPooVTyRH++pdpbaVGVBM l8i2uFCcg7KiSs/XvYmD9aEWPhkAT3yrMUdW0FGha05vr2eetarDra/oF173xOS8Julh I/6gI/lt3prL6E/cx6VITKcAZM7Tg799SA9CbkhlDezppjHwjhx+EZ0jW08jIADsEB+T xdgsOChZYAyGRGRWRF3QUEVsIxKYlPuWLvX1Dt3fjSR5AuazdLbqDDQ924WJK2s6vQCX 29TK9QxQxTDJmWGto26O5cOaQCwSfo38DsSD3bmXOXej7Io3/zTsWH5f7Y0XE0juiXQq 228g== X-Gm-Message-State: AGRZ1gLOZOlhDrcvs1l74ze7k4lojPQYUCHfLmAHsfvSptFHTfOSC41d WpaKyCHyQX6MPjqsAT9szYqtQ6szlTk= X-Google-Smtp-Source: AJdET5deRtaBJbAwJztN8dHv1PmKFEtE7n2T17xSrQz0twf16kzmr9X8y9/XUgB+6I9FnmtDHtA8zQ== X-Received: by 2002:a17:906:2cd3:: with SMTP id r19-v6mr12463301ejr.38.1542112414184; Tue, 13 Nov 2018 04:33:34 -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 h28-v6sm5298083ede.49.2018.11.13.04.33.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Nov 2018 04:33:33 -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: Tue, 13 Nov 2018 13:32:48 +0100 Message-Id: <1542112371-32546-6-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542112371-32546-1-git-send-email-mw@semihalf.com> References: <1542112371-32546-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH v5 5/8] Marvell/Armada80x0Db: 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: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 X-List-Received-Date: Tue, 13 Nov 2018 12:33:36 -0000 From: Tomasz Michalec This patch implements ArmadaBoarDescLib library for Armada8040 Development 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/Marvell/Armada80x0Db/Armada80x0Db.dsc | 3 + Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.inf | 34 ++++++++++ Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c | 66 ++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.inf create mode 100644 Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc index 92e2dc8..42f7bd3 100644 --- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc +++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc @@ -54,6 +54,9 @@ [Components.AARCH64] Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf +[LibraryClasses.common] + ArmadaBoardDescLib|Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.inf + ################################################################################ # # Pcd Section - list of all EDK II PCD Entries defined by this Platform diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.inf b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.inf new file mode 100644 index 0000000..2d39d96 --- /dev/null +++ b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.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 = Armada80x0DbBoardDescLib + FILE_GUID = fee9e874-1481-4b4f-9882-966bd0d1310f + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = ArmadaBoardDescLib + +[Sources] + Armada80x0DbBoardDescLib.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Marvell/Marvell.dec + +[LibraryClasses] + DebugLib + IoLib diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c new file mode 100644 index 0000000..3b69c6b --- /dev/null +++ b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.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 mSdMmcDescTemplate[] = { + { /* eMMC 0xF06E0000 */ + 0, /* SOC will be filled by MvBoardDescDxe */ + 0, /* SdMmcDevCount will be filled by MvBoardDescDxe */ + TRUE, /* 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 ( + OUT UINTN *SdMmcDevCount, + OUT MV_BOARD_SDMMC_DESC **SdMmcDesc + ) +{ + *SdMmcDesc = AllocateCopyPool (sizeof (mSdMmcDescTemplate), + &mSdMmcDescTemplate); + if (*SdMmcDesc == NULL) { + DEBUG ((DEBUG_ERROR, "%a: Cannot allocate memory\n", __FUNCTION__)); + return EFI_OUT_OF_RESOURCES; + } + + *SdMmcDevCount = ARRAY_SIZE (mSdMmcDescTemplate); + + return EFI_SUCCESS; +} -- 2.7.4