From patchwork Thu Aug 16 12:12:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144373 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2001014ljj; Thu, 16 Aug 2018 05:14:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzSKRlyjDOUAf9HI8TfvBPPPbyYIUUUYeKdBN1cVQtEYsey9JarD7cFvdbeEA8bdDaE/Bno X-Received: by 2002:a65:5c4b:: with SMTP id v11-v6mr29167462pgr.445.1534421689159; Thu, 16 Aug 2018 05:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534421689; cv=none; d=google.com; s=arc-20160816; b=yPWppOuSGCFcwe5hPwN8SKBdVgf71d7XxHI/QcSMb4ZH7i7gaHZfxoUSzzlhmoDMLL nxiZJMg2hofe3IRofvq25aDduO1F4DTb4g+NA0Fs8vexBDOxqPqcD3jAsdT5yGNnqS5f rhXT/6PfhsgFoeBlfniqVRebRlPFFxFiCXND9cWi7Jkq9Nfqr2nXoISWF5lBO4uEKkud ZAmEb0ykuu82qUM93GnnqN2gntNB9YevrCx6NtCmwc30qGJnqlfW8pD5ieILlcWQE0n+ KErL/uEF0jN8QLONaJcLnzSU9B7qk4WWiVzH90cxW9VaqEv9MHzk5mDKqGsKzAv0qBJC tJVQ== 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=h5sXQg0Za3S/YBTdu6nEHaGW5y+RSiB0L1RQ9c1pfodL/HeEs67NU3d+J66Y4H8ZGG xsEEE1s5d0khL0OTxObVmW8U3hKxLJ/YEnXogzGNuA3FUSqqJTIEjDP2ILgRgK311UFC qoMBbonnjrCuTAF8BDdNs1UgUuncLhOkj4VZ1Gj9FEy73NNpgk1yv5eXLszhIJ7rpWwL AyseR44+OQbLBXXZopObeP0mTlvQXREnMwZ8Z2AeL44z1t9KMaq9n4yf/exhnAUV7X6q B0e5zBGUKXm6mAykOEMza/n5TeKbKZnIz8VqXjZKUTAr8CyCelriwsMdkZhxbt6I4G1W 2PRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=De7ysD1s; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id g1-v6si21187538plt.77.2018.08.16.05.14.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 05:14:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=De7ysD1s; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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 2D30E210F3D78; Thu, 16 Aug 2018 05:14:24 -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::444; helo=mail-pf1-x444.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (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 3B8D7210F3761 for ; Thu, 16 Aug 2018 05:14:23 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id k21-v6so1942045pff.11 for ; Thu, 16 Aug 2018 05:14:23 -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=De7ysD1sgsDa5QzcZm6gmrZlig7JBHXk8k2awkcM0qMflJ3R51ahPOMtoC2q5kveo2 k7xgKgFEhUfKKoY+2iJ7w5U+zlQWeWt02DwhDwKtQMbvp+AzMkzzjToHE8eHlRUuk4Ud 9xj5/tg2KY/PZhzFa5NZy1m3oY+A4pkfrv/hM= 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=J5luLIHxfXWAJF4JTtaZqucTb7PQzm9vSv0bBtwWS3c2dPzEN0PK2BJplyHQyto+Iz UZfwR05O2kcJ+SJbwBEyAqwwD1OnA3aEVix3hDYrRJB+Tack85waMGOBMU2IAQW93y46 7kNXYRtgKazUl+Jac24NHVctFVZeFQZBSQOyWpV2gdbN/EbaGIkkdeWbSzJuUEbuQGSQ J5cA+MwTlJ+gF8q8F2RRUkDdaTC+9Qfye9Ox1aw2kuU3gNWNGo+OasNEoy/4fYDg9tos 4OSfmNOTbZJY/vml2uVtl6CKmL0omAawMV1zH77OpRJCCnaWnGTYno+dbovB+4ez2wdv rzUg== X-Gm-Message-State: AOUpUlHY7MX0bjwSX5HLld3dF/VNvRQYrRDYdUxVy1fqbTS3z7ypJmSt 1jTz0dCRdp0HOmME6xix3sB/Ow== X-Received: by 2002:a65:5b08:: with SMTP id y8-v6mr28414443pgq.297.1534421662807; Thu, 16 Aug 2018 05:14:22 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id j27-v6sm46736311pfj.91.2018.08.16.05.14.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 05:14:22 -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: Thu, 16 Aug 2018 20:12:26 +0800 Message-Id: <20180816121239.44129-24-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180816121239.44129-1-ming.huang@linaro.org> References: <20180816121239.44129-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v3 23/36] 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 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; +} +