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::142; helo=mail-lf1-x142.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 934152194D3AE for ; Fri, 19 Oct 2018 18:58:10 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id p143-v6so15511344lfp.13 for ; Fri, 19 Oct 2018 18:58:10 -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=DtxD0Sq+VVjk2wxQqJk+yBr5ktzbsu188x3YvuGIsz8=; b=jDMvNqMAC7B3zz7lFQXRwRDFB4owYBTeEzLdwXug4+N7jGu823PfHxms4eQq28AjnX 7VuGCIkGxdpgFRpopYXm0LOKw1HvWbQbpKRihSuiK29SCHXHXe0YUpb9sSn7897GvVe+ WCAAKRBthL2e5rs+rW56SwBy9D9LuUSFWMqSpoLlRFTbfp4PPn8/ipgfkK8SIK3uF5Kf yX8jwJh6amQEHHIgn+CbzoGTITE4vgWwa+aLbsE8LxofsLEiHiV6xbg8rCJnWvx9ucCg ezMb7C7avPl+henwWMK4kMlSyBCwP5HM/hj8pS5HuUPCGAV2wW3YR2es6jRGCo0cSb7V 45Cg== 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=DtxD0Sq+VVjk2wxQqJk+yBr5ktzbsu188x3YvuGIsz8=; b=YsaHN2G0vVQnVinAvKsVTf+55WGpywJgqmX04BUwoGtPEiVarR3vTY8vnXS7VSSI5J 6SXpT8ibBAB810yywMmAN0zdwpshi7phoCBJ1xoOdPGoL0r7jDC4cPnjkYCI+P/1BGhY NAsaFlMo3qA42FX2UQr8Q/O+PPT4V/l0hjlc6TnaxrMFEGH5HO8BBrtPYIYt7XZWJBUU yMJTwE70VXLZU/BLRMvbDDKlRtbdCAOyo8tKWLWo5/YIGMpCzZ0lOjUjNG79mHsGll43 KxPQbIsYtMfF+3b7WS6XwZbwYFvfQN/5PgArzQG+oERYZutdFOvRKmt1uRwdUmvH+L1s J8NA== X-Gm-Message-State: ABuFfoj3Ymy8U1MqsAG25a+I1VtgwytJ3rSfA1bXAcsodnhoAhkNtqW/ ZXAHd0CQBIx16Un7drM8wtCMXs1ilEo= X-Google-Smtp-Source: ACcGV60/xu2z5BGhGvS0/tJun86f+j9Y9sD24iGCZ6UjS6cVFhdljuH95+Vd8uYBlK9x405AxQ8W+A== X-Received: by 2002:a19:d8d1:: with SMTP id r78-v6mr4605677lfi.146.1540000688542; Fri, 19 Oct 2018 18:58:08 -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 p63-v6sm5562777lfg.46.2018.10.19.18.58.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Oct 2018 18:58:07 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com Date: Sat, 20 Oct 2018 03:57:33 +0200 Message-Id: <1540000661-1956-5-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540000661-1956-1-git-send-email-mw@semihalf.com> References: <1540000661-1956-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH 04/12] 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: Sat, 20 Oct 2018 01:58:11 -0000 This patch implements ArmadaBoarDescLib library for Armada70x0Db 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/Armada70x0Db/Armada70x0Db.dsc | 3 ++ Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.inf | 34 ++++++++++++++++ Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c | 43 ++++++++++++++++++++ 3 files changed, 80 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..51e6687 --- /dev/null +++ b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c @@ -0,0 +1,43 @@ +/** +* +* 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 = { + PCA9555_ID, + 0x21, + 0x0, +}; + +EFI_STATUS +EFIAPI +ArmadaBoardDescGpioGet ( + IN OUT MV_I2C_IO_EXPANDER_DESC **I2cIoExpanderDesc, + IN OUT UINTN *I2cIoExpanderCount + ) +{ + *I2cIoExpanderCount = 1; + *I2cIoExpanderDesc = &mI2cIoExpanderDescTemplate; + + return EFI_SUCCESS; +} -- 2.7.4