From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Marcin Wojtas <mw@semihalf.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
"Leif Lindholm" <leif.lindholm@linaro.org>,
"Wu, Hao A" <hao.a.wu@intel.com>,
"Nadav Haklai" <nadavh@marvell.com>,
"Jan Dąbroś" <jsd@semihalf.com>,
"Grzegorz Jaszczyk" <jaz@semihalf.com>,
"Kostya Porotchkin" <kostap@marvell.com>,
"Tomasz Michalec" <tm@semihalf.com>
Subject: Re: [platforms: PATCH v4 3/7] SolidRun/Armada80x0McBin: Introduce board description library
Date: Mon, 12 Nov 2018 11:26:50 +0100 [thread overview]
Message-ID: <CAKv+Gu9MwocZeoh2BhaCmpY-sFG1JzzRhsSnEEpj75zUsOuo5g@mail.gmail.com> (raw)
In-Reply-To: <1541804508-27499-4-git-send-email-mw@semihalf.com>
On Sat, 10 Nov 2018 at 00:02, Marcin Wojtas <mw@semihalf.com> wrote:
>
> From: Tomasz Michalec <tm@semihalf.com>
>
> 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 <mw@semihalf.com>
> ---
> 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<BR>
> +#
> +# 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 <Uefi.h>
> +
> +#include <Library/ArmadaBoardDescLib.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/IoLib.h>
> +#include <Library/MemoryAllocationLib.h>
> +#include <Library/UefiBootServicesTableLib.h>
> +
> +//
> +// 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
There are OUT not IN OUT
> + )
> +{
> + *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;
Please do the checks first, and only assign the outputs when it is
guaranteed that you will return succes.
With those changes:
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> + }
> +
> + return EFI_SUCCESS;
> +}
> --
> 2.7.4
>
next prev parent reply other threads:[~2018-11-12 10:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-09 23:01 [platforms: PATCH v4 0/7] Armada7k8k Xenon driver rework Marcin Wojtas
2018-11-09 23:01 ` [platforms: PATCH v4 1/7] Silicon/SynQuacer/PlatformDxe: adjust to updated SdMmcOverride Marcin Wojtas
2018-11-12 10:24 ` Ard Biesheuvel
2018-11-09 23:01 ` [platforms: PATCH v4 2/7] Marvell/Library: ArmadaBoardDescLib: Extend SDMMC information Marcin Wojtas
2018-11-12 10:24 ` Ard Biesheuvel
2018-11-09 23:01 ` [platforms: PATCH v4 3/7] SolidRun/Armada80x0McBin: Introduce board description library Marcin Wojtas
2018-11-12 10:26 ` Ard Biesheuvel [this message]
2018-11-09 23:01 ` [platforms: PATCH v4 5/7] Marvell/Armada80x0Db: " Marcin Wojtas
2018-11-12 10:28 ` Ard Biesheuvel
2018-11-09 23:01 ` [platforms: PATCH v4 6/7] Marvell/Drivers: MvBoardDesc: Extend information for SdMmc Marcin Wojtas
2018-11-12 10:29 ` Ard Biesheuvel
2018-11-09 23:01 ` [platforms: PATCH v4 7/7] Marvell/Drivers: XenonDxe: Switch to use generic SdMmcPciHcDxe Marcin Wojtas
2018-11-12 10:36 ` Ard Biesheuvel
[not found] ` <1541804508-27499-5-git-send-email-mw@semihalf.com>
2018-11-12 10:27 ` [platforms: PATCH v4 4/7] Marvell/Armada70x0Db: Introduce board description library Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKv+Gu9MwocZeoh2BhaCmpY-sFG1JzzRhsSnEEpj75zUsOuo5g@mail.gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox