diff mbox series

[edk2,edk2-platforms,v1,23/38] Hisilicon/D0X: Rename the global variable gDS3231RtcDevice

Message ID 20180724070922.63362-24-ming.huang@linaro.org
State New
Headers show
Series Upload for D06 platform | expand

Commit Message

Ming Huang July 24, 2018, 7:09 a.m. UTC
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 <ming.huang@linaro.org>

Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

---
 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

Comments

Leif Lindholm Aug. 3, 2018, 3:20 p.m. UTC | #1
On Tue, Jul 24, 2018 at 03:09:07PM +0800, Ming Huang wrote:
> The global variable gDS3231RtcDevice is used by several

> modules included common module in other Pkg. Renaming it

> with a general name is proper.


Ah, this was why the variable name did not match the patch set.
Good. MEans I can trust your tree again.

But please do this change _before_ introducing it for D06.

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ming Huang <ming.huang@linaro.org>

> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

> ---

>  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(-)

> 

> 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 <Library/CpldD03.h>

>  #include <Library/CpldIoLib.h>

>  

> -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));


Space before (.

>  

>    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));


Space before (.

>  

>    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));


Space before (.

/
    Leif

>  

>    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 <Library/I2CLib.h>

>  #include <Library/HiiLib.h>

>  

> -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 <Protocol/Smbios.h>

>  

>  

> -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 <Protocol/RealTimeClock.h>

>  #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 <PlatformArch.h>

>  

> -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 <Library/I2CLib.h>

>  #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);

> -- 

> 2.17.0

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ming Huang Aug. 9, 2018, 6:22 a.m. UTC | #2
在 8/3/2018 11:20 PM, Leif Lindholm 写道:
> On Tue, Jul 24, 2018 at 03:09:07PM +0800, Ming Huang wrote:
>> The global variable gDS3231RtcDevice is used by several
>> modules included common module in other Pkg. Renaming it
>> with a general name is proper.
> 
> Ah, this was why the variable name did not match the patch set.
> Good. MEans I can trust your tree again.
> 
> But please do this change _before_ introducing it for D06.
> 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ming Huang <ming.huang@linaro.org>
>> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
>> ---
>>  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(-)
>>
>> 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 <Library/CpldD03.h>
>>  #include <Library/CpldIoLib.h>
>>  
>> -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));
> 
> Space before (.
> 
>>  
>>    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));
> 
> Space before (.
> 
>>  
>>    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));
> 
> Space before (.

All comments will apply in v2.
Thanks.

> 
> /
>     Leif
> 
>>  
>>    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 <Library/I2CLib.h>
>>  #include <Library/HiiLib.h>
>>  
>> -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 <Protocol/Smbios.h>
>>  
>>  
>> -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 <Protocol/RealTimeClock.h>
>>  #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 <PlatformArch.h>
>>  
>> -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 <Library/I2CLib.h>
>>  #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);
>> -- 
>> 2.17.0
>>
diff mbox series

Patch

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 <Library/CpldD03.h>
 #include <Library/CpldIoLib.h>
 
-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 <Library/I2CLib.h>
 #include <Library/HiiLib.h>
 
-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 <Protocol/Smbios.h>
 
 
-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 <Protocol/RealTimeClock.h>
 #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 <PlatformArch.h>
 
-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 <Library/I2CLib.h>
 #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);