Revision: 17343
          http://sourceforge.net/p/edk2/code/17343
Author:   oliviermartin
Date:     2015-05-06 11:15:44 +0000 (Wed, 06 May 2015)
Log Message:
-----------
EmbeddedPkg: Remove dependency on TimerLib

UEFI drivers should not depend on TimerLib. They should
use BS.Stall() instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]>
Reviewed-by: Ronald Cron <[email protected]>

Modified Paths:
--------------
    trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c
    trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
    trunk/edk2/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
    trunk/edk2/EmbeddedPkg/EmbeddedPkg.dsc
    trunk/edk2/EmbeddedPkg/Universal/MmcDxe/Mmc.h
    trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
    trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
    trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c

Modified: trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c
===================================================================
--- trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c        
2015-05-06 11:14:28 UTC (rev 17342)
+++ trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c        
2015-05-06 11:15:44 UTC (rev 17343)
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -12,7 +12,6 @@
 
 **/
 
-#include <Library/TimerLib.h>
 #include <Library/DebugLib.h>
 #include <Library/UefiBootServicesTableLib.h>
 #include <Library/UefiDriverEntryPoint.h>

Modified: trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
===================================================================
--- trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf      
2015-05-06 11:14:28 UTC (rev 17342)
+++ trunk/edk2/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf      
2015-05-06 11:15:44 UTC (rev 17343)
@@ -1,6 +1,6 @@
 #/** @file
 #
-#  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -27,7 +27,6 @@
   DebugLib
   IoLib
   MemoryAllocationLib
-  TimerLib
   UefiBootServicesTableLib
   UefiDriverEntryPoint
 

Modified: trunk/edk2/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
===================================================================
--- trunk/edk2/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf    2015-05-06 
11:14:28 UTC (rev 17342)
+++ trunk/edk2/EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf    2015-05-06 
11:15:44 UTC (rev 17343)
@@ -1,7 +1,7 @@
 #/** @file
 #  INF file for the LAN9118 Network Controller Driver.
 #
-#  Copyright (c) 2012-2014, ARM Limited. All rights reserved.
+#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -40,7 +40,6 @@
   BaseMemoryLib
   ArmLib
   IoLib
-  TimerLib
   DevicePathLib
 
 [Protocols]

Modified: trunk/edk2/EmbeddedPkg/EmbeddedPkg.dsc
===================================================================
--- trunk/edk2/EmbeddedPkg/EmbeddedPkg.dsc      2015-05-06 11:14:28 UTC (rev 
17342)
+++ trunk/edk2/EmbeddedPkg/EmbeddedPkg.dsc      2015-05-06 11:15:44 UTC (rev 
17343)
@@ -59,8 +59,6 @@
   
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
   EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf
 
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
-
   
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
 
   
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
@@ -265,14 +263,25 @@
   EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
   EmbeddedPkg/SerialDxe/SerialDxe.inf
   EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf
-  EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
+  EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf {
+    <LibraryClasses>
+      
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
+  }
 
   EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
 
   # FDT installation
-  EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
+  EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
+    <LibraryClasses>
+      # It depends on BdsLib that depends on TimerLib
+      
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
+  }
 
-  EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf
+  EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf {
+    <LibraryClasses>
+      # It depends on BdsLib that depends on TimerLib
+      
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
+  }
   
EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
   
EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf
 

Modified: trunk/edk2/EmbeddedPkg/Universal/MmcDxe/Mmc.h
===================================================================
--- trunk/edk2/EmbeddedPkg/Universal/MmcDxe/Mmc.h       2015-05-06 11:14:28 UTC 
(rev 17342)
+++ trunk/edk2/EmbeddedPkg/Universal/MmcDxe/Mmc.h       2015-05-06 11:15:44 UTC 
(rev 17343)
@@ -1,7 +1,7 @@
 /** @file
   Main Header file for the MMC DXE driver
 
-  Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -25,6 +25,7 @@
 
 #include <Library/UefiLib.h>
 #include <Library/DebugLib.h>
+#include <Library/UefiBootServicesTableLib.h>
 
 #define MMC_TRACE(txt)  DEBUG((EFI_D_BLKIO, "MMC: " txt "\n"))
 

Modified: trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
===================================================================
--- trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c        2015-05-06 
11:14:28 UTC (rev 17342)
+++ trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c        2015-05-06 
11:15:44 UTC (rev 17343)
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -13,7 +13,6 @@
 **/
 
 #include <Library/BaseMemoryLib.h>
-#include <Library/TimerLib.h>
 
 #include "Mmc.h"
 
@@ -268,7 +267,7 @@
           break;  // Prevents delay once finished
         }
       }
-      NanoSecondDelay (100);
+      gBS->Stall (1);
     }
 
     Status = MmcNotifyState (MmcHostInstance, MmcTransferState);

Modified: trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
===================================================================
--- trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf  2015-05-06 11:14:28 UTC 
(rev 17342)
+++ trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf  2015-05-06 11:15:44 UTC 
(rev 17343)
@@ -1,7 +1,7 @@
 #/** @file
 #  Build file for the MMC DXE driver
 #
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -39,7 +39,6 @@
   UefiLib
   UefiDriverEntryPoint
   BaseMemoryLib
-  TimerLib
 
 [Protocols]
   gEfiDiskIoProtocolGuid

Modified: trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
===================================================================
--- trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c 2015-05-06 
11:14:28 UTC (rev 17342)
+++ trunk/edk2/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c 2015-05-06 
11:15:44 UTC (rev 17343)
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -12,8 +12,6 @@
 *
 **/
 
-#include <Library/TimerLib.h>
-
 #include "Mmc.h"
 
 typedef union {
@@ -322,7 +320,7 @@
 
     if (!EFI_ERROR (Status)) {
       if (!MmcHostInstance->CardInfo.OCRData.PowerUp) {
-        MicroSecondDelay (1);
+        gBS->Stall (1);
         Timeout--;
       } else {
         if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && 
(MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) {
@@ -332,7 +330,7 @@
         break;  // The MMC/SD card is ready. Continue the Identification Mode
       }
     } else {
-      MicroSecondDelay (1);
+      gBS->Stall (1);
       Timeout--;
     }
   }


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to