diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-26 10:58:06 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-26 10:58:06 +0000 |
commit | a12da33bc1cd7a29f3333b94467eb3803bf4d927 (patch) | |
tree | a1f0a39d097f7e40bbc41c45b39add19c030188c /ArmPlatformPkg | |
parent | 7245b435c88d45423e4c5c90fe52a672802376b0 (diff) | |
download | edk2-platforms-a12da33bc1cd7a29f3333b94467eb3803bf4d927.tar.xz |
ArmPlatformPkg/SP805Watchdog.h: Removed the DXE function declarations from the header
The DXE functions are local to the DXE driver.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13132 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r-- | ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c | 87 | ||||
-rw-r--r-- | ArmPlatformPkg/Include/Drivers/SP805Watchdog.h | 43 |
2 files changed, 44 insertions, 86 deletions
diff --git a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c index f8faab735d..c2ebffdf38 100644 --- a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c +++ b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c @@ -27,44 +27,6 @@ #include <Protocol/WatchdogTimer.h> #include <Drivers/SP805Watchdog.h> -/** - Interface structure for the Watchdog Architectural Protocol. - - @par Protocol Description: - This protocol provides a service to set the amount of time to wait - before firing the watchdog timer, and it also provides a service to - register a handler that is invoked when the watchdog timer fires. - - @par When the watchdog timer fires, control will be passed to a handler - if one has been registered. If no handler has been registered, - or the registered handler returns, then the system will be - reset by calling the Runtime Service ResetSystem(). - - @param RegisterHandler - Registers a handler that will be called each time the - watchdogtimer interrupt fires. TimerPeriod defines the minimum - time between timer interrupts, so TimerPeriod will also - be the minimum time between calls to the registered - handler. - NOTE: If the watchdog resets the system in hardware, then - this function will not have any chance of executing. - - @param SetTimerPeriod - Sets the period of the timer interrupt in 100 nS units. - This function is optional, and may return EFI_UNSUPPORTED. - If this function is supported, then the timer period will - be rounded up to the nearest supported timer period. - - @param GetTimerPeriod - Retrieves the period of the timer interrupt in 100 nS units. - -**/ -EFI_WATCHDOG_TIMER_ARCH_PROTOCOL gWatchdogTimer = { - (EFI_WATCHDOG_TIMER_REGISTER_HANDLER) SP805RegisterHandler, - (EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) SP805SetTimerPeriod, - (EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) SP805GetTimerPeriod -}; - EFI_EVENT EfiExitBootServicesEvent = (EFI_EVENT)NULL; BOOLEAN mSP805Initialized = FALSE; @@ -357,11 +319,48 @@ SP805GetTimerPeriod ( *TimerPeriod = ReturnValue; - EXIT: return Status; } /** + Interface structure for the Watchdog Architectural Protocol. + + @par Protocol Description: + This protocol provides a service to set the amount of time to wait + before firing the watchdog timer, and it also provides a service to + register a handler that is invoked when the watchdog timer fires. + + @par When the watchdog timer fires, control will be passed to a handler + if one has been registered. If no handler has been registered, + or the registered handler returns, then the system will be + reset by calling the Runtime Service ResetSystem(). + + @param RegisterHandler + Registers a handler that will be called each time the + watchdogtimer interrupt fires. TimerPeriod defines the minimum + time between timer interrupts, so TimerPeriod will also + be the minimum time between calls to the registered + handler. + NOTE: If the watchdog resets the system in hardware, then + this function will not have any chance of executing. + + @param SetTimerPeriod + Sets the period of the timer interrupt in 100 nS units. + This function is optional, and may return EFI_UNSUPPORTED. + If this function is supported, then the timer period will + be rounded up to the nearest supported timer period. + + @param GetTimerPeriod + Retrieves the period of the timer interrupt in 100 nS units. + +**/ +EFI_WATCHDOG_TIMER_ARCH_PROTOCOL gWatchdogTimer = { + (EFI_WATCHDOG_TIMER_REGISTER_HANDLER) SP805RegisterHandler, + (EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) SP805SetTimerPeriod, + (EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) SP805GetTimerPeriod +}; + +/** Initialize the state information for the Watchdog Timer Architectural Protocol. @param ImageHandle of the loaded driver @@ -381,20 +380,20 @@ SP805Initialize ( // Check if the SP805 hardware watchdog module exists on board Status = SP805Identify(); - if (EFI_ERROR( Status )) { + if (EFI_ERROR(Status)) { Status = EFI_DEVICE_ERROR; goto EXIT; } // Unlock access to the SP805 registers - SP805Unlock(); + SP805Unlock (); // Stop the watchdog from triggering unexpectedly - SP805Stop(); + SP805Stop (); // Set the watchdog to reset the board when triggered - if ( (MmioRead32(SP805_WDOG_CONTROL_REG) & SP805_WDOG_CTRL_RESEN) == 0 ) { - MmioOr32(SP805_WDOG_CONTROL_REG, SP805_WDOG_CTRL_RESEN); + if ((MmioRead32(SP805_WDOG_CONTROL_REG) & SP805_WDOG_CTRL_RESEN) == 0) { + MmioOr32 (SP805_WDOG_CONTROL_REG, SP805_WDOG_CTRL_RESEN); } // Prohibit any rogue access to SP805 registers diff --git a/ArmPlatformPkg/Include/Drivers/SP805Watchdog.h b/ArmPlatformPkg/Include/Drivers/SP805Watchdog.h index 60c02be139..4d5e145d8b 100644 --- a/ArmPlatformPkg/Include/Drivers/SP805Watchdog.h +++ b/ArmPlatformPkg/Include/Drivers/SP805Watchdog.h @@ -1,6 +1,6 @@ /** @file
*
-* Copyright (c) 2011, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2012, 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
@@ -45,45 +45,4 @@ #define SP805_WDOG_LOCK_IS_LOCKED 0x00000001
#define SP805_WDOG_SPECIAL_UNLOCK_CODE 0x1ACCE551
-VOID
-EFIAPI
-ExitBootServicesEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
-);
-
-EFI_STATUS
-EFIAPI
-SP805SetTimerPeriod (
- IN CONST EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
- IN UINT64 TimerPeriod // In 100ns units
-);
-
-EFI_STATUS
-EFIAPI
-SP805GetTimerPeriod (
- IN CONST EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
- OUT UINT64 *TimerPeriod
-);
-
-EFI_STATUS
-EFIAPI
-SP805RegisterHandler (
- IN CONST EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
- IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
-);
-
-EFI_STATUS
-SP805Initialize (
- VOID
-);
-
-EFI_STATUS
-EFIAPI
-SP805InstallProtocol (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
-);
-
-
#endif // __SP805_WATCHDOG_H__
|