From patchwork Tue Jul 24 07:09:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142728 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6937398ljj; Tue, 24 Jul 2018 00:19:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf9py/YdEOFdLMdMTa5ELfiQ8gt2O6U7Hay94hMWCxcYxvdE5UkbsQeWPFPlCH2gxC8hY0t X-Received: by 2002:a63:a543:: with SMTP id r3-v6mr15219018pgu.336.1532416797840; Tue, 24 Jul 2018 00:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532416797; cv=none; d=google.com; s=arc-20160816; b=QeulmlfuVAjICjGBTHrdlkOFmxUvBsDhKhnceCdb2b6CHTmJrKiJ9NKRmMrGi2zMa8 M/Rmq/beSnoC5FJ3kdlWSwu5UM4GjMZ6I4tGDFal7dR2pRhIXHCGrZqgb1h/DksjWrNp cMve2VfGYeIpmIVXRcZiHEMGSZaYOOYUIzJK4vj1FcqkRe5IIU8zNIFr9VOwU7QF1CA4 13OmTzZtvkAtJKsn6CGuKe0vAkp1ez5Pxppa4YUmTeOkQ3UXryig4EAMr4YgakV+I8fa /yBD3/1JwbxmnPd4smMPK7u5X2sEcI0+FRFQmGUcYPPWQ0EiHk/nfwLt5l6mI9DBe7qU oZTA== 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=GdEMDk1eB5TC0YWr2JuBi2mqhBZrRSdnC5q1rfxxQj8=; b=OYS4EeXpjOHlu9NgERTA42ua3BLbpcYm0qymcXQ9VsjdWxZryxQeNdZc5qYdxJSwGB U6UFvea9AoT134nW6mS9n+AEmnsRHo7wpGwp+1cVdJwhjbJIu0yDJc68unQSXAA8q7jj S6zHtJe4InYxmu5Ia9Fkd1N6TAmRZCB1mcttGqWhCYVrdq2PZzBWrp8CicX7KVij/vtj beK03Mpqpjo6i/13hOff7uLgrEowf7RZKgK0nkiVMoSoLmLfV0jIS2tfvU237jrcsD0f LHtTud+cBppH5VB0HK3yzq/9/vSiRi8/UkwJRP0b+kIwyXdAZlxN9rCy/recI1jtpxZ0 I4yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gAm7wUsn; 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 q11-v6si11992340pli.86.2018.07.24.00.19.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 00:19:57 -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=gAm7wUsn; 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 4675A210C124C; Tue, 24 Jul 2018 00:19:57 -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::541; helo=mail-pg1-x541.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (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 98995210C1232 for ; Tue, 24 Jul 2018 00:19:55 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id y4-v6so2224320pgp.9 for ; Tue, 24 Jul 2018 00:19:55 -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=nKpVGUiMnqb1JvmwrN+Z0CcBzx9GdBC8J8uRFmhqWDQ=; b=gAm7wUsnSDcdqkQQHPd9xBCRYEqlPogThcO922nRwKbTrpIohJCoXa3Z9jwCvhkli5 uknK5li+XkLlj5khDPyltM6q9Yi7DdaGKFiOT/eMU9ioqIubq5M9magPHOXltYE2ekPs 2X6agbUPL6DX84WYt8/UPtSTT17rcplUyBSOs= 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=nKpVGUiMnqb1JvmwrN+Z0CcBzx9GdBC8J8uRFmhqWDQ=; b=nlcsFrTPQvq2Iw7UzTnFBMacx2Yv6koQXUpSNySYj5PTwm0ZpzzF3mj9B7d29FC4xf iu5BHlCkIZl8R0BChOP7Hbf14TthzcqdHGhM53hBScgNo63EbjEbbWVLP2UHhWeT91g0 yjIhlS4ujjbbWD0N5FF/g3nCp31xGEfrPIiI5UQJqaoaNPBVgxceD5VPtJaE+R/7N4hR /2GyxcXZMjUs7vQayBlgx+zfZLLJuiNpgRIpGWa1K6CoiD5auJTMG+BJCGwcmyAOui0Y n34l1hoQCWPIP71kLkyZjIbDJ5+T/DdUr+5tKwsaXoCT2+DTjbpQhhcjVk9vHUik9bmV BVjA== X-Gm-Message-State: AOUpUlGmlEk7CsQtqf4CNohxoqoiPB5aVMen3CF2sRxwdfYEb1dpDsSV FO6KoSNyknLiU81Lj0rwCPjrqA== X-Received: by 2002:a63:f449:: with SMTP id p9-v6mr15574025pgk.213.1532416795269; Tue, 24 Jul 2018 00:19:55 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id t14-v6sm11449788pgu.0.2018.07.24.00.19.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:19:54 -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, 24 Jul 2018 15:09:08 +0800 Message-Id: <20180724070922.63362-25-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180724070922.63362-1-ming.huang@linaro.org> References: <20180724070922.63362-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v1 24/38] 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, shaochangliang , huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: shaochangliang This Driver provide Get/Set Mac function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shaochangliang Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Platform/Hisilicon/D06/D06.dsc | 2 +- Platform/Hisilicon/D06/D06.fdf | 2 +- Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig.h | 25 +++++++ Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.c | 71 ++++++++++++++++++++ Platform/Hisilicon/D06/Drivers/OemNicConfig2PHi1620/OemNicConfig2P.inf | 43 ++++++++++++ 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 744a4a0d6d..49322f8304 100644 --- a/Platform/Hisilicon/D06/D06.dsc +++ b/Platform/Hisilicon/D06/D06.dsc @@ -289,7 +289,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 1c6ee4e0e4..e65dddd4e9 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/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..7e2cee3b86 --- /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; +} + 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