From patchwork Tue Jul 24 07:09:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142727 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6937062ljj; Tue, 24 Jul 2018 00:19:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcH5y2fAzjQgk1nU/PvvsPhu8xT/ENLiZwZwQy20BLJ87DRmeVzjGxzcx0A2raGSc2LfpJK X-Received: by 2002:a62:dc1d:: with SMTP id t29-v6mr16657581pfg.244.1532416774465; Tue, 24 Jul 2018 00:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532416774; cv=none; d=google.com; s=arc-20160816; b=BkaWXQwkEFA/QrAZX/Z47cRIDQm4jk4p33a7ARs9n33qyro1hEhboBPTYIuXeu+NeZ b4TTd2FYwzmBSdbRj/0ovWdfaM8NUYbfRDcug/0wM2eO+ybIOdaoBSQ0qROtGaSSfUMM S+MFgPS4R5iCsifWfXWGE4PB/vmL0QzCHiZ4jLM2U202ymrLPCOYCN1gddcdvN7x1XVj v75r8aP7UIwnonKELdJetvICetfR8qJqLPjoKZH3MZNnsgNsnldCYFwiixwhbzBoRujU DIeA4JC4GfvvUOjXUl+wVFckKofb3G+/8zZab3KfQpOlibbbbxjHiPxiyVPFimMkXgef URuw== 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=iAeSWz+cMene4T5m1FCAa+FJ9KYFrUUilGPGPjsNnQI=; b=scyfwQMP/o6zzvGWGTVuraADPGJguws/6rP1xXwnZTW6/rNvN9V4bz6yi5reutqPFz 0zv0TyzRDmzENyYmisHJQkq5SDTfKzHXIjwmzJGdUNGbxjezSTd2w8tES3Z4mPUV7nwN tupBl9Wx/NdEBYwXuw0819dJ5rLy8K4I9j/C9aQEv/D8fVw0rAhHRou7GvDl8dBp//qE rYaw0vLv0nMK8zpdQ96/PD9t+OEK3dw0rTpXlPQXSLti7gz2BRjU8du1hWmLRf7Fv4T2 VA+8nuyjZOHnd8RZzwGy4rWOcycuwe7r3CaTnVbmL25dDuvxrgkPy7+nMJWn2XGI/Dhp sWNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=U6tCfr2q; 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 x6-v6si10827528pgk.597.2018.07.24.00.19.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 00:19:34 -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=U6tCfr2q; 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 1393C210C1250; Tue, 24 Jul 2018 00:19:34 -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:400e:c01::244; helo=mail-pl0-x244.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::244]) (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 17528210C1232 for ; Tue, 24 Jul 2018 00:19:33 -0700 (PDT) Received: by mail-pl0-x244.google.com with SMTP id t17-v6so1350550ply.13 for ; Tue, 24 Jul 2018 00:19:33 -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=FFFm09b0d1a0qpXJo0g5joe9tCMuD/yG9o0NSZvribE=; b=U6tCfr2qM9Cxq0b0V5xfntW57Nu/muh8e0vRWsFm3lRidiwkNw1BjI8K+f2Yyry9cq Q09GIDLdpsx5hwigTgtFb9u47hjFFerynuCBgTOqkEZuDww3Xn0GeztUPmHL5N7VSL+s qDwzNLu3SKHbeAKprrX6oIr32lV3QJlvnDpt4= 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=FFFm09b0d1a0qpXJo0g5joe9tCMuD/yG9o0NSZvribE=; b=fJjOEXaMeUKj9pvVB27IEF0hUJo1zk9cFZjMfvemCW+ZdrsTCwfjFLRBwTWOzdZM73 bXkoyRvrWQVUqvRD2d7NX0Y25ml0kjAttuEpr+ncCYnVM649ohhyeF3vtFqxNmHw9SU4 Grh9DYLuzx9A+vQPtLh4y7KeOa8W29NoZJ7QMQQlI6HQgI413rHjnnXDYkIpGuXcdryN VqC1mISAOZUF01XSdy7tdrny0vkTM3TCW7V40oE25Wvw8yG7bKVTRUvUDluJce49aHcG kIFb0r3eMCwrTR4gQLQEUFqhOmMVfcQb7PxIRJTG1CX52qWWXj4CBSIPNmpf8SBr8OK3 fmhA== X-Gm-Message-State: AOUpUlEFpBmnt3W4213vZkfjJk0u8RHlXEcYga+BoapaFR45nFDKGeS0 i0BTTYK5DYkGKUIUu7N6NEe4hUQAQFE= X-Received: by 2002:a17:902:8d98:: with SMTP id v24-v6mr15860582plo.250.1532416772676; Tue, 24 Jul 2018 00:19:32 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:19:32 -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:07 +0800 Message-Id: <20180724070922.63362-24-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 23/38] Hisilicon/D0X: Rename the global variable gDS3231RtcDevice 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, huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The global variable gDS3231RtcDevice is used by several modules included common module in other Pkg. Renaming it with a general name is proper. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c | 8 ++++---- Platform/Hisilicon/D03/Library/OemMiscLib2P/BoardFeature2PHi1610.c | 2 +- Platform/Hisilicon/D05/Library/OemMiscLibD05/BoardFeatureD05.c | 2 +- Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c | 8 ++++---- Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf | 1 + Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c | 2 +- Silicon/Hisilicon/Include/Library/OemMiscLib.h | 2 +- Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c | 8 ++++---- 8 files changed, 17 insertions(+), 16 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/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c b/Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c index 07fa52aa78..ed866e46b5 100644 --- a/Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c +++ b/Platform/Hisilicon/D03/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c @@ -41,7 +41,7 @@ #include #include -extern I2C_DEVICE gDS3231RtcDevice; +extern I2C_DEVICE gRtcDevice; STATIC BOOLEAN mDS3231Initialized = FALSE; @@ -117,7 +117,7 @@ InitializeDS3231 ( // Prepare the hardware (VOID)IdentifyDS3231(); - (VOID) CopyMem(&Dev, &gDS3231RtcDevice, sizeof(Dev)); + (VOID) CopyMem(&Dev, &gRtcDevice, sizeof(Dev)); Status = I2CInit(Dev.Socket,Dev.Port,Normal); if (EFI_ERROR (Status)) { @@ -199,7 +199,7 @@ LibGetTime ( } } - (VOID) CopyMem(&Dev, &gDS3231RtcDevice, sizeof(Dev)); + (VOID) CopyMem(&Dev, &gRtcDevice, sizeof(Dev)); Status |= I2CRead(&Dev,DS3231_REGADDR_MONTH,1,&Temp); @@ -299,7 +299,7 @@ LibSetTime ( } } - (VOID) CopyMem(&Dev, &gDS3231RtcDevice, sizeof(Dev)); + (VOID) CopyMem(&Dev, &gRtcDevice, sizeof(Dev)); Temp = ((Time->Second/10)<<4) | (Time->Second%10); MicroSecondDelay(1000); diff --git a/Platform/Hisilicon/D03/Library/OemMiscLib2P/BoardFeature2PHi1610.c b/Platform/Hisilicon/D03/Library/OemMiscLib2P/BoardFeature2PHi1610.c index 66d62895a6..4771cb900c 100644 --- a/Platform/Hisilicon/D03/Library/OemMiscLib2P/BoardFeature2PHi1610.c +++ b/Platform/Hisilicon/D03/Library/OemMiscLib2P/BoardFeature2PHi1610.c @@ -25,7 +25,7 @@ #include #include -I2C_DEVICE gDS3231RtcDevice = { +I2C_DEVICE gRtcDevice = { .Socket = 0, .Port = 6, .DeviceType = DEVICE_TYPE_SPD, diff --git a/Platform/Hisilicon/D05/Library/OemMiscLibD05/BoardFeatureD05.c b/Platform/Hisilicon/D05/Library/OemMiscLibD05/BoardFeatureD05.c index 15a509be5d..ae4c194070 100644 --- a/Platform/Hisilicon/D05/Library/OemMiscLibD05/BoardFeatureD05.c +++ b/Platform/Hisilicon/D05/Library/OemMiscLibD05/BoardFeatureD05.c @@ -26,7 +26,7 @@ #include -I2C_DEVICE gDS3231RtcDevice = { +I2C_DEVICE gRtcDevice = { .Socket = 0, .Port = 4, .DeviceType = DEVICE_TYPE_SPD, diff --git a/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c b/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c index 9b1d7c00e8..d680dd0393 100644 --- a/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c +++ b/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c @@ -32,7 +32,7 @@ #include #include "M41T83RealTimeClock.h" -extern I2C_DEVICE gDS3231RtcDevice; +extern I2C_DEVICE gRtcDevice; EFI_STATUS SwitchRtcI2cChannelAndLock ( @@ -108,7 +108,7 @@ RtcRead ( { EFI_STATUS Status; - Status = I2CRead (&gDS3231RtcDevice, Address, Size, Data); + Status = I2CRead (&gRtcDevice, Address, Size, Data); MicroSecondDelay (1000); return Status; } @@ -131,7 +131,7 @@ RtcWrite ( { EFI_STATUS Status; - Status = I2CWrite(&gDS3231RtcDevice, Address, Size, Data); + Status = I2CWrite(&gRtcDevice, Address, Size, Data); MicroSecondDelay (1000); return Status; } @@ -162,7 +162,7 @@ InitializeM41T83 ( EfiAcquireLock (&mRtcLock); } - Status = I2CInit (gDS3231RtcDevice.Socket, gDS3231RtcDevice.Port, Normal); + Status = I2CInit (gRtcDevice.Socket, gRtcDevice.Port, Normal); MicroSecondDelay (1000); if (EFI_ERROR (Status)) { if (!EfiAtRuntime ()) { diff --git a/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf b/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf index 0d0bb37557..1337fae19d 100644 --- a/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf +++ b/Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf @@ -36,6 +36,7 @@ DebugLib I2CLib IoLib + OemMiscLib PcdLib TimerLib UefiLib diff --git a/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c b/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c index c8f6cd0e29..9d3f12e42f 100644 --- a/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c +++ b/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c @@ -26,7 +26,7 @@ #include -I2C_DEVICE gDS3231RtcDevice = { +I2C_DEVICE gRtcDevice = { .Socket = 0, .Port = 5, .DeviceType = DEVICE_TYPE_SPD, diff --git a/Silicon/Hisilicon/Include/Library/OemMiscLib.h b/Silicon/Hisilicon/Include/Library/OemMiscLib.h index 53e7a37a68..517111e762 100644 --- a/Silicon/Hisilicon/Include/Library/OemMiscLib.h +++ b/Silicon/Hisilicon/Include/Library/OemMiscLib.h @@ -34,7 +34,7 @@ extern REPORT_PCIEDIDVID2BMC PcieDeviceToReport[PCIEDEVICE_REPORT_MAX]; BOOLEAN OemIsSocketPresent (UINTN Socket); VOID CoreSelectBoot(VOID); VOID OemPcieResetAndOffReset(void); -extern I2C_DEVICE gDS3231RtcDevice; +extern I2C_DEVICE gRtcDevice; UINTN OemGetSocketNumber(VOID); UINTN OemGetDdrChannel (VOID); diff --git a/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c b/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c index 02d6d7f14d..8ad807f000 100644 --- a/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c +++ b/Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.c @@ -39,7 +39,7 @@ #include #include "DS3231RealTimeClock.h" -extern I2C_DEVICE gDS3231RtcDevice; +extern I2C_DEVICE gRtcDevice; STATIC BOOLEAN mDS3231Initialized = FALSE; @@ -67,7 +67,7 @@ InitializeDS3231 ( // Prepare the hardware (VOID)IdentifyDS3231(); - (VOID) CopyMem(&Dev, &gDS3231RtcDevice, sizeof(Dev)); + (VOID) CopyMem(&Dev, &gRtcDevice, sizeof(Dev)); Status = I2CInit(Dev.Socket,Dev.Port,Normal); if (EFI_ERROR (Status)) { @@ -143,7 +143,7 @@ LibGetTime ( } } - (VOID) CopyMem(&Dev, &gDS3231RtcDevice, sizeof(Dev)); + (VOID) CopyMem(&Dev, &gRtcDevice, sizeof(Dev)); Status |= I2CRead(&Dev,DS3231_REGADDR_MONTH,1,&Temp); @@ -233,7 +233,7 @@ LibSetTime ( } } - (VOID) CopyMem(&Dev, &gDS3231RtcDevice, sizeof(Dev)); + (VOID) CopyMem(&Dev, &gRtcDevice, sizeof(Dev)); Temp = ((Time->Second/10)<<4) | (Time->Second%10); MicroSecondDelay(1000);