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::141; helo=mail-it1-x141.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x141.google.com (mail-it1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 9058F21163277 for ; Mon, 8 Oct 2018 05:52:32 -0700 (PDT) Received: by mail-it1-x141.google.com with SMTP id 134-v6so11258552itz.2 for ; Mon, 08 Oct 2018 05:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mc3fqDXo3MKQOtR/Du+CN4OnsfTECN0xIeKPVF48EfQ=; b=N3OTZnSLSOOxw67PAT4+xvFS+/UrhLXYD8YpqQIeXbuoKkJJh4rlifrVtuR6HuNHI6 zr9KUK9PEaip/A8OradTG4H6rmPbmYV8jw6m9qv0oFg0kCliGyvi7CJVkulrFIA+UfHS mvyRKZYNcmzl+X9ZVEuYcIwVvxp45AfGMrCRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mc3fqDXo3MKQOtR/Du+CN4OnsfTECN0xIeKPVF48EfQ=; b=oTZJyMHhOy5Ip7mgsTnIkYQJmzWM2E8xaW94RGJko0C14xHDtKvAjZSrmJyq6MZepY UEocZXW530PPMHY5y6EvmN8tJlCAZozYI4fuzw8/DD7XOYWnhfGhkhhDNMHqadsO3srS zySuivISBHp+z4TjB61v1CKVR7PmsNZcllQIIb0jcboney7qT4l11lwrO9vazSNvFGYx 7sVNuNubmOpDCEKFIIPPdbDrBzYHaXQsXK2eBLueMkcwo9ZTWJdhHB1hNnpsgrt2IRNC c+sjRDPPV7tSrWt6c28CU9PWU0IArPfWy4aSm7htHonZqdee5n1aQ81T+9W7Nor/SyRe g8fw== X-Gm-Message-State: ABuFfojCfORM/4Ogr1xj7ec5b0yymVTY6J4CtRE2GncTD1NHds424qKN 7mAjq0hSdeS3zaYGEM8wFpW90Zs7U4SlNSx74vRm3Vhh X-Google-Smtp-Source: ACcGV62g8RIXxGxXT9m1IfCWi9cFVCvUXSgvcyMwHoAORMko7TTlO1SsrHISxzmB8NkTQuUd7up3rTKRX7oBaUBloP0= X-Received: by 2002:a02:b015:: with SMTP id p21-v6mr18156937jah.2.1539003151817; Mon, 08 Oct 2018 05:52:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:5910:0:0:0:0:0 with HTTP; Mon, 8 Oct 2018 05:52:31 -0700 (PDT) In-Reply-To: <1538745968-22526-6-git-send-email-mw@semihalf.com> References: <1538745968-22526-1-git-send-email-mw@semihalf.com> <1538745968-22526-6-git-send-email-mw@semihalf.com> From: Ard Biesheuvel Date: Mon, 8 Oct 2018 14:52:31 +0200 Message-ID: To: Marcin Wojtas Cc: "edk2-devel@lists.01.org" , Leif Lindholm , "Wu, Hao A" , Nadav Haklai , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Tomasz Michalec Subject: Re: [platforms: PATCH v2 5/7] 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: Mon, 08 Oct 2018 12:52:32 -0000 Content-Type: text/plain; charset="UTF-8" On 5 October 2018 at 15:26, Marcin Wojtas wrote: > 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..00d696d > --- /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 */ Isn't the SD removable on MacchiatoBin? Or are we not able to support that in UEFI? > + } > +}; > + > +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 >