From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::341; helo=mail-wm1-x341.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 3E1D521196206 for ; Tue, 4 Dec 2018 07:31:30 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id y139so10004861wmc.5 for ; Tue, 04 Dec 2018 07:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZQ+CGLkE6/U7qt21ztdLsVQE3xwBIopAmgeeJeSGcB8=; b=CQDgTriV8lv43SsCUSrkDi2Hd8dKKr4aj7jL6uqojMMWJkQSi0ACpnwMzYryKprOxQ u3EMEixi7fXjTKU0ccTPjdO5LuMr7TseVbZBkkqbn+CssgnYlA62kJXkgj/6T+fDrvb2 1UkCzPXQ8aTyn/loTdMEgHsozqfhf8wGMumzQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZQ+CGLkE6/U7qt21ztdLsVQE3xwBIopAmgeeJeSGcB8=; b=DTPWYb+K2rYxeVmJiYRc8+twNgEPK47Fh6ZPH9HBpB+qBc1N4hYmvcu10rFtvUOY8N 6MwyNW35uXIKJBNJ0J795d2OXmESf7vgP+o2Lra8HV9x/8WWxZXmZs2I2KDwhiKgv6tG 5AMz+LSgo4968f879jiHMT6P+ZD3M/l/eFh/ieRZmb0+CybmTonMLQFMUn231QOVPejE e8z0XuJ9FghHVU1mL8tI/2y1zgeFsev0oyTjvkLRdJrCSOf4/x0c170Gs1MXx6E96cAg rZYgakPbEFPQf+V1MsX6B7SfbcYX4eO68pki9Ymsa7k2qqGGTDvda5gyttthuJOyRT+V bPDQ== X-Gm-Message-State: AA+aEWZfdhgSYlu9sZ3eV8FbRrBPdWrW2aNdOaZ2SNn0GFjMAEg01Ilo iZ+pxX+/xC4Q4ZqIU+OybqIomQ== X-Google-Smtp-Source: AFSGD/UF9bQ3lv2dt8MH4aSOUPT4eGI2h2tAn6asKNQ1KPlk5g2QZElw6dOG8xpzWZQQq/WU0oGtjg== X-Received: by 2002:a1c:5892:: with SMTP id m140mr12897040wmb.60.1543937488710; Tue, 04 Dec 2018 07:31:28 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id q2sm18185721wru.56.2018.12.04.07.31.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Dec 2018 07:31:27 -0800 (PST) Date: Tue, 4 Dec 2018 15:31:26 +0000 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com Message-ID: <20181204153126.y4nmmytdqsem7zaz@bivouac.eciton.net> References: <1540000661-1956-1-git-send-email-mw@semihalf.com> <1540000661-1956-6-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1540000661-1956-6-git-send-email-mw@semihalf.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH 05/12] 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, 04 Dec 2018 15:31:31 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 20, 2018 at 03:57:34AM +0200, Marcin Wojtas wrote: > This patch implements ArmadaBoarDescLib library for > Armada80x0Db and introduces ArmadaBoardDescGpioGet > routine with per-board I2C IO expander description. > > 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 | 50 ++++++++++++++++++++ > 3 files changed, 87 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..16561bc > --- /dev/null > +++ b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c > @@ -0,0 +1,50 @@ > +/** > +* > +* 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 > + > +#include > + > +STATIC MV_I2C_IO_EXPANDER_DESC mI2cIoExpanderDescTemplate[] = { No objection to the above (apart from the I2c bit, see previous patches), but: this is a STATIC array - it doesn't need to worry about namespace. And it isn't really a template - it is the actual description. So ... you could just call it mGpioExpanders or something. Same I2c -> GPIO comment as for preceding patches. > + { > + PCA9555_ID, > + 0x21, > + 0x0, > + }, > + { > + PCA9555_ID, > + 0x25, > + 0x0, > + }, > +}; > + > +EFI_STATUS > +EFIAPI > +ArmadaBoardDescGpioGet ( > + IN OUT MV_I2C_IO_EXPANDER_DESC **I2cIoExpanderDesc, > + IN OUT UINTN *I2cIoExpanderCount > + ) > +{ > + *I2cIoExpanderCount = ARRAY_SIZE (mI2cIoExpanderDescTemplate); > + *I2cIoExpanderDesc = mI2cIoExpanderDescTemplate; > + > + return EFI_SUCCESS; > +} > -- > 2.7.4 >