From patchwork Tue Aug 14 08:08:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144138 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4050350ljj; Tue, 14 Aug 2018 01:12:06 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzQPnco7qXTyjIH3RdIxVcHaZ3c8KUDrJnDtURdn9a6F8ZGIHDrtHwqvTd8EMV73/2yE/wT X-Received: by 2002:a17:902:22:: with SMTP id 31-v6mr19558815pla.190.1534234326340; Tue, 14 Aug 2018 01:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534234326; cv=none; d=google.com; s=arc-20160816; b=vdM0/n1yt9hHwxEJrmNq0MNe17CDbJwGhDYBshN72fz87dTNtl5kBdv2PDwgmoRkw/ 79oJjvgYli5BZLRSLuXaBRCexAewe/fKAQPMcuddq9yfpXWMcBa/XMG2tyBV8qugcUuI /7+MUjoshmHCEItfeVw5EyMj8yemqpq+Hnjj/VsSWuust00SM7dpHLIyosElR1LHg+GS /xK6Ghwf0vQ7DJaSYMTtPhR9/p8HqoZ2nvhcqApxbF9+5k9O7vsrgQCYey+DTIz8XNUj 6/VtlmahNKd3AUT8hIi5N8PxGXu1jm9f8BV8GK/DF2ifrB1Ri7sVeRjawTSqzJMBx7aJ Aklw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=2BcbnOhW3pauMvF1KPPyd4DVO6qptPSyzA5ju7jvEM0=; b=gk4U1l3vX0biTDBL8dHn7cM2HZlu0RBxT0qPwZ1TogSmO+xiSHuqdL7pjDKCFqzbHq f8esT0nor/lqf/utQsTFMxn0SYbNGxOL+/7jy/9t6/8sMPAodOzvIYDekEKXzgCVwMcg E1RjUDkeAkw47gdbQsVr0jTnZwxMHjiXvEbQT8XZJ/57ibteZY0R7UEHu29oukbNscn7 iymPm2t0II6fH7HhQ4w81RewTk2fIPvCpgRp/ogXgera94TQIGZPRkhPYUf05bIYM/PE +sQIibanAVbXFKs6GynTkRjhO/JioEeciOs7a7uc22u27Ain0+ouvgMnXbr/xqWMIarm spMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="PqT/aghb"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id b6-v6si18524422pgm.644.2018.08.14.01.12.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 01:12:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="PqT/aghb"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2EDE0210F2010; Tue, 14 Aug 2018 01:11:11 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (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 D6407210F1573 for ; Tue, 14 Aug 2018 01:11:09 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id l9-v6so8921230pff.9 for ; Tue, 14 Aug 2018 01:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IzqbhRv00nZwR++GvEPgvXV+U4MJWLu6SEHCN+7d6ro=; b=PqT/aghbyd0GHBpl50eUvUgb3tJIYHmS2Xdm1fLv3c8u6Sf6GzZaf0mnSsV4VcPqOx EHEmTXlxsO+6oBPKpqyKf7Hw1kNz1CaELtuwNhbhBZE20zhwc1B4WBlcBY3HVGR6pJoN DD3hrPa9dmKwFY9jdSjJ9cezBLtBAZXFhg6dY= 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=IzqbhRv00nZwR++GvEPgvXV+U4MJWLu6SEHCN+7d6ro=; b=IA9ACVpGe5Vuk9kzY4iPyFYX1iHh5Sj1cZJB8eObCHa804UXyDjmS06oTvL8yaPYpM ftEy89fMdQzKmYI2VKiLKAES3p1acsh6zCYkQKAXrPTteLxoXx5XhZbxO3MfRYhD21Ra UCZQBXQ7q92ad9fzkSkKLxWZPE18YXI+pqpf1yTu0rKHtf+j6evp0BI8phqjDn4i0GYx y+AIWrVtnCR5J9X6iaUucBImkPdGZPCke11fuotCsgE/tupnfDXHZRDz5SfE9SYcO4Qo nRgBw1v6IMQj3v0ceVPR0o1Ubd0IG5SqiBb9qzBgJj+XjoVEDVeYkUGHTL3CDRBdpPSc QmiQ== X-Gm-Message-State: AOUpUlGh3pLWqun6xLSjbH95RwdexkDviXvtrJvgU0WaZEkRwSbwQC7p lvJn4OiLCFA0+1q3lvVzy7zOsA== X-Received: by 2002:a62:a649:: with SMTP id t70-v6mr22477995pfe.149.1534234269488; Tue, 14 Aug 2018 01:11:09 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id h130-v6sm72905670pgc.88.2018.08.14.01.11.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Aug 2018 01:11:08 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Tue, 14 Aug 2018 16:08:50 +0800 Message-Id: <20180814080903.50466-31-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180814080903.50466-1-ming.huang@linaro.org> References: <20180814080903.50466-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v2 30/43] Platform/Hisilicon/D06: Add OemNicConfig2P Driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangming23@huawei.com, xinliang.liu@linaro.org, john.garry@huawei.com, zhangjinsong2@huawei.com, guoheyi@huawei.com, huangdaode@hisilicon.com, michael.d.kinney@intel.com, lersek@redhat.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This Driver provide Get/Set Mac function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ming Huang --- Platform/Hisilicon/D06/D06.dsc | 2 +- Platform/Hisilicon/D06/D06.fdf | 2 +- Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf | 43 ++++++++++++ Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h | 25 +++++++ Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c | 71 ++++++++++++++++++++ 5 files changed, 141 insertions(+), 2 deletions(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc index e18badf3b3..5571028f42 100644 --- a/Platform/Hisilicon/D06/D06.dsc +++ b/Platform/Hisilicon/D06/D06.dsc @@ -285,7 +285,7 @@ # ArmPkg/Drivers/CpuDxe/CpuDxe.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf - + Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf !if $(SECURE_BOOT_ENABLE) == TRUE MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf index 5bb779d2e4..184d5d4dcf 100644 --- a/Platform/Hisilicon/D06/D06.fdf +++ b/Platform/Hisilicon/D06/D06.fdf @@ -174,7 +174,7 @@ READ_LOCK_STATUS = TRUE INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf - + INF Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf INF Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf diff --git a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf new file mode 100644 index 0000000000..a91f2b6005 --- /dev/null +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf @@ -0,0 +1,43 @@ +#/** @file +# +# Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved. +# Copyright (c) 2016-2018, Linaro Limited. All rights reserved. +# +# 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 = OemNicConfigPangea + FILE_GUID = edc95319-ebe9-4c38-96af-1d203fb85231 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = OemNicConfigEntry + +[Sources.common] + OemNicConfig2P.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Hisilicon/HisiPkg.dec + +[Protocols] + gHisiBoardNicProtocolGuid ##Produce + +[LibraryClasses] + DebugLib + IoLib + OemNicLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[Depex] + TRUE diff --git a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h new file mode 100644 index 0000000000..35228fdf1d --- /dev/null +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h @@ -0,0 +1,25 @@ +/** @file +* +* Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved. +* Copyright (c) 2016-2018, Linaro Limited. All rights reserved. +* +* 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. +* +**/ + +#ifndef __OEM_NIC_CONFIG_H__ +#define __OEM_NIC_CONFIG_H__ + +#include +#include +#include +#include +#include +#include +#endif diff --git a/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c new file mode 100644 index 0000000000..c01c49150a --- /dev/null +++ b/Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c @@ -0,0 +1,71 @@ +/** @file +* +* Copyright (c) 2016-2018, Hisilicon Limited. All rights reserved. +* Copyright (c) 2016-2018, Linaro Limited. All rights reserved. +* +* 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 + + +EFI_STATUS +EFIAPI OemGetMac2P ( + IN OUT EFI_MAC_ADDRESS *Mac, + IN UINTN Port + ) +{ + OemGetMac (Mac, Port); + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI OemSetMac2P ( + IN EFI_MAC_ADDRESS *Mac, + IN UINTN Port + ) +{ + OemSetMac (Mac, Port); + + return EFI_SUCCESS; +} + +HISI_BOARD_NIC_PROTOCOL mHisiBoardNicProtocol2P = { + .GetMac = OemGetMac2P, + .SetMac = OemSetMac2P, +}; + + +EFI_STATUS +EFIAPI +OemNicConfigEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + Status = gBS->InstallProtocolInterface ( + &ImageHandle, + &gHisiBoardNicProtocolGuid, + EFI_NATIVE_INTERFACE, + &mHisiBoardNicProtocol2P + ); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Install Protocol failed %r\n", + __FUNCTION__, __LINE__, Status)); + return Status; + } + + return EFI_SUCCESS; +} +