From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d41; helo=mail-io1-xd41.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 05F952118A5AD for ; Mon, 12 Nov 2018 02:27:58 -0800 (PST) Received: by mail-io1-xd41.google.com with SMTP id u19so1582444ioc.2 for ; Mon, 12 Nov 2018 02:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ANDxoajFV7qppizTgGU+WMM7oePNMM6HOGp6rlxuvZ0=; b=EzRkZ+8CV1T0nNScr2qVMEmFlzh0eZl1tmqGgA0Y1vVPJNP+aSpXvLNFmKs3J/Kgje 0P6SW3IDZ3NoWQ3MdUtlXJ1YX+KaeXlie2VfnnmrWMFOgFOo04Xf00aAyvw+w6Fpe8Xv eaNb86a95J0iPO4iGEuPnEusIwhgB8aryQ5bA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ANDxoajFV7qppizTgGU+WMM7oePNMM6HOGp6rlxuvZ0=; b=svJC6W+Fu4yBbpRxQ+dquf2UHj4I24FIzoPZhfvu7z+C5F/i4qN4GCwnrJnUZ8Rqll 6v5PGUF1dy1aG0RkfGFNu+25E0wpLqxG/AqR7smfVG8nN1q5KSKmdjMGOqv5hZrhr0kT IiBddOgi4DGzTZId65K7fS1fI25dBFgv+IWSWrCegF3fniZSlb/9HDAZId+4Y23ivzqz 9QVNdX2uKYXRthLx/sKfIpszdBzF0eXCVm+dacHcDBhxxBWzL8QL9LkQV5d9z5ohepP5 lyYjmQgfN62dPlyeGQciAcJU0yZJ3HVfwwygdAHUmmXe4VEwsiGCL716+w5gblcFmRyI hLgw== X-Gm-Message-State: AGRZ1gKgam3romcVWbiWIKubRC2A6UvUKJty2mrSI4opgoozJfgLpMDD fdooORwU9m9LtyTm40G45dDGO/FBnbnfLHXJ6rnmKw== X-Google-Smtp-Source: AJdET5cWrojvBrHqIqW8PAm9nQTtm/zoNLaN7lOTP6Ws0QPpmtww0mdzQ/NvXLHaK7Ts9LI6TgGS9TgMP8/yY3fjAyE= X-Received: by 2002:a6b:37c2:: with SMTP id e185-v6mr231002ioa.173.1542018478238; Mon, 12 Nov 2018 02:27:58 -0800 (PST) MIME-Version: 1.0 References: <1541804508-27499-1-git-send-email-mw@semihalf.com> <1541804508-27499-5-git-send-email-mw@semihalf.com> In-Reply-To: <1541804508-27499-5-git-send-email-mw@semihalf.com> From: Ard Biesheuvel Date: Mon, 12 Nov 2018 11:27:46 +0100 Message-ID: To: Marcin Wojtas Cc: "edk2-devel@lists.01.org" , Leif Lindholm , "Wu, Hao A" , Nadav Haklai , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Grzegorz Jaszczyk , Kostya Porotchkin , Tomasz Michalec Subject: Re: [platforms: PATCH v4 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: Mon, 12 Nov 2018 10:27:59 -0000 Content-Type: text/plain; charset="UTF-8" On Sat, 10 Nov 2018 at 00:02, Marcin Wojtas wrote: > > 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; > + } > + Same as previous patch: change 'IN OUT' -> 'OUT' and move output param assignments after the error return for: Reviewed-by: Ard Biesheuvel > + return EFI_SUCCESS; > +} > -- > 2.7.4 >