From e28e0ad9d7cb0c5ea0d07dd5e7bf3c7cde7e95ba Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Mon, 26 Mar 2012 11:05:25 +0000 Subject: ArmPlatformPkg/SP805WatchdogDxe: Removed late initialization capability from the watchdog The watchdog driver is a UEFI architectural driver. The watchdog controller is always going to be intialized. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13137 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Drivers/SP805WatchdogDxe/SP805Watchdog.c | 43 +++------------------- .../Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf | 4 +- 2 files changed, 8 insertions(+), 39 deletions(-) (limited to 'ArmPlatformPkg/Drivers') diff --git a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c index c2ebffdf38..a9ec88c333 100644 --- a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c +++ b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c @@ -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 @@ -29,8 +29,6 @@ EFI_EVENT EfiExitBootServicesEvent = (EFI_EVENT)NULL; -BOOLEAN mSP805Initialized = FALSE; - EFI_STATUS SP805Identify ( VOID @@ -217,14 +215,6 @@ SP805SetTimerPeriod ( EFI_STATUS Status = EFI_SUCCESS; UINT64 Ticks64bit; - // Initialize the hardware if not already done - if( !mSP805Initialized ) { - Status = SP805Initialize(); - if (EFI_ERROR(Status)) { - goto EXIT; - } - } - SP805Unlock(); if( TimerPeriod == 0 ) { @@ -298,14 +288,6 @@ SP805GetTimerPeriod ( return EFI_INVALID_PARAMETER; } - // Initialize the hardware if not already done - if( !mSP805Initialized ) { - Status = SP805Initialize(); - if (EFI_ERROR(Status)) { - goto EXIT; - } - } - // Check if the watchdog is stopped if ( (MmioRead32(SP805_WDOG_CONTROL_REG) & SP805_WDOG_CTRL_INTEN) == 0 ) { // It is stopped, so return zero. @@ -372,11 +354,14 @@ EFI_WATCHDOG_TIMER_ARCH_PROTOCOL gWatchdogTimer = { **/ EFI_STATUS +EFIAPI SP805Initialize ( - VOID + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; + EFI_HANDLE Handle; // Check if the SP805 hardware watchdog module exists on board Status = SP805Identify(); @@ -398,23 +383,7 @@ SP805Initialize ( // Prohibit any rogue access to SP805 registers SP805Lock(); - - mSP805Initialized = TRUE; - - EXIT: - return Status; -} - -EFI_STATUS -EFIAPI -SP805InstallProtocol ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - EFI_HANDLE Handle; - + // // Make sure the Watchdog Timer Architectural Protocol has not been installed in the system yet. // This will avoid conflicts with the universal watchdog diff --git a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf index 7cacf69f4f..ffcd501aae 100644 --- a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf +++ b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf @@ -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 @@ -19,7 +19,7 @@ MODULE_TYPE = DXE_DRIVER VERSION_STRING = 1.0 - ENTRY_POINT = SP805InstallProtocol + ENTRY_POINT = SP805Initialize [Sources.common] SP805Watchdog.c -- cgit v1.2.3