3 * Copyright (c) 2011, ARM Limited. All rights reserved.
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __SP805_WATCHDOG_H__
17 #define __SP805_WATCHDOG_H__
20 #include <ArmPlatform.h>
22 // SP805 Watchdog Registers
23 #define SP805_WDOG_LOAD_REG (SP805_WDOG_BASE + 0x000)
24 #define SP805_WDOG_CURRENT_REG (SP805_WDOG_BASE + 0x004)
25 #define SP805_WDOG_CONTROL_REG (SP805_WDOG_BASE + 0x008)
26 #define SP805_WDOG_INT_CLR_REG (SP805_WDOG_BASE + 0x00C)
27 #define SP805_WDOG_RAW_INT_STS_REG (SP805_WDOG_BASE + 0x010)
28 #define SP805_WDOG_MSK_INT_STS_REG (SP805_WDOG_BASE + 0x014)
29 #define SP805_WDOG_LOCK_REG (SP805_WDOG_BASE + 0xC00)
31 #define SP805_WDOG_PERIPH_ID0 (SP805_WDOG_BASE + 0xFE0)
32 #define SP805_WDOG_PERIPH_ID1 (SP805_WDOG_BASE + 0xFE4)
33 #define SP805_WDOG_PERIPH_ID2 (SP805_WDOG_BASE + 0xFE8)
34 #define SP805_WDOG_PERIPH_ID3 (SP805_WDOG_BASE + 0xFEC)
36 #define SP805_WDOG_PCELL_ID0 (SP805_WDOG_BASE + 0xFF0)
37 #define SP805_WDOG_PCELL_ID1 (SP805_WDOG_BASE + 0xFF4)
38 #define SP805_WDOG_PCELL_ID2 (SP805_WDOG_BASE + 0xFF8)
39 #define SP805_WDOG_PCELL_ID3 (SP805_WDOG_BASE + 0xFFC)
41 // Timer control register bit definitions
42 #define SP805_WDOG_CTRL_INTEN BIT0
43 #define SP805_WDOG_CTRL_RESEN BIT1
44 #define SP805_WDOG_RAW_INT_STS_WDOGRIS BIT0
45 #define SP805_WDOG_MSK_INT_STS_WDOGMIS BIT0
47 #define SP805_WDOG_LOCK_IS_UNLOCKED 0x00000000
48 #define SP805_WDOG_LOCK_IS_LOCKED 0x00000001
49 #define SP805_WDOG_SPECIAL_UNLOCK_CODE 0x1ACCE551
53 ExitBootServicesEvent (
61 IN CONST EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
62 IN UINT64 TimerPeriod
// In 100ns units
68 IN CONST EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
69 OUT UINT64
*TimerPeriod
74 SP805RegisterHandler (
75 IN CONST EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*This
,
76 IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
86 SP805InstallProtocol (
87 IN EFI_HANDLE ImageHandle
,
88 IN EFI_SYSTEM_TABLE
*SystemTable
92 #endif // __SP805_WATCHDOG_H__