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::241; helo=mail-lj1-x241.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) (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 C448F21163244 for ; Fri, 5 Oct 2018 06:26:19 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id 63-v6so11623659ljs.4 for ; Fri, 05 Oct 2018 06:26:19 -0700 (PDT) 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=kwZB3jPUIjFcFmMcSOOvs8wjQsNTAW82XkfxPviOpdE=; b=od8O94Ka9CaXt77jU4c9XCcjKavarYYe+5gXl/qEOrKsqFipQk6jLbq8MymZILYAW6 oNAX1QULuH9Ps7f23IDfoVr/TYmtZuF91QhOZNgfDA/Ur+jgo2Fwo6RXErLkfEB3GWKH bTGZpeIuXMayGfRZ6MmsVeAFSU4ian6P0PPzNwLlVKKJEPVT2k8wB6+id82OygGSmfF0 l5qsMHaXv88Ue7puDVrIyJMeXQCeZawhYL0signs6TSCBdpauD1TBOp8QzPdk+PO3BXM utX9UF/DIV9YGIJD6OmFXV0mlJxAoH6Wrga+rNX6CujML+rZ4DFtem++R6bxWmTOeqFd GyDw== 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=kwZB3jPUIjFcFmMcSOOvs8wjQsNTAW82XkfxPviOpdE=; b=UC1VJlQ0MibtoNaVnfelXc/DyOCLe/AjxS8GX75n6N5urIiOldRoejjqUMaev6ro6j apHrLjUC1Qn35wee07s2jThEzf6Zra6B8/YOGSO/Lsz1zQzBdP3UOkQXiy2wHXmrYEbX t8qac0Xm4VFPN1eZHFp9WKhGFWIIAcNef0efQZJ4UaqtEP9Q5/Kv9HcLNHP7jg76hbp4 wpJddgK6T4Ey1jdF/TyXXgVvXdJFhisLUOP51YfDly3Ir4OnaQeMm0PwqZ7X6SDrlOQY 5I6MzvEu5kgKPM3mp9dcLRxKtcdotVccvVvD3hssPECxcWT4xvFzKkJ5oow+8pNUsZAm 1B1Q== X-Gm-Message-State: ABuFfogCm+9XCESHRuax4I2N88Q+aIBO6LjfZlRWJoYVDvng7dsfaGuh +HJUbhLmItylea4D3eKGf546eDEqMqk= X-Google-Smtp-Source: ACcGV63C2KvQ3AdT7RSeq1AXxmVyqnuy5S2vQ3qz4UMvJiNhwQPiFjyQEK14okeE+X3W+Jgtc0pQUw== X-Received: by 2002:a2e:651d:: with SMTP id z29-v6mr7811730ljb.36.1538745977576; Fri, 05 Oct 2018 06:26:17 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id p130-v6sm1817659lfd.55.2018.10.05.06.26.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Oct 2018 06:26:16 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, hao.a.wu@intel.com, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, tm@semihalf.com Date: Fri, 5 Oct 2018 15:26:05 +0200 Message-Id: <1538745968-22526-5-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538745968-22526-1-git-send-email-mw@semihalf.com> References: <1538745968-22526-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH v2 4/7] Marvell/Armada70x0Db: 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, 05 Oct 2018 13:26:20 -0000 From: Tomasz Michalec This patch implements ArmadaBoarDescLib library for Armada7040 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/Armada70x0Db/Armada70x0Db.dsc | 3 + Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf | 34 ++++++++++ Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c | 66 ++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf create mode 100644 Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc index e0bf447..a935f36 100644 --- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc +++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc @@ -54,6 +54,9 @@ [Components.AARCH64] Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf +[LibraryClasses.common] + ArmadaBoardDescLib|Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf + ################################################################################ # # Pcd Section - list of all EDK II PCD Entries defined by this Platform diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf new file mode 100644 index 0000000..b26f55b --- /dev/null +++ b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.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 = Armada70x0DbBoardDescLib + FILE_GUID = 3164c8d9-19d4-4ad6-8196-cea094b1ddf1 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = ArmadaBoardDescLib + +[Sources] + Armada70x0DbBoardDescLib.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Marvell/Marvell.dec + +[LibraryClasses] + DebugLib + IoLib diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c new file mode 100644 index 0000000..dd5e3a0 --- /dev/null +++ b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.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 */ + FALSE, /* Xenon1v8Enabled */ + FALSE, /* 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 (mSdMmcDescTemplate); + + *SdMmcDesc = AllocateCopyPool (sizeof (mSdMmcDescTemplate), + &mSdMmcDescTemplate); + if (*SdMmcDesc == NULL) { + DEBUG ((DEBUG_ERROR, "%a: Cannot allocate memory\n", __FUNCTION__)); + return EFI_OUT_OF_RESOURCES; + } + + return EFI_SUCCESS; +} -- 2.7.4