]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/Include/Drivers/PL031RealTimeClock.h
ArmPlatformPkg: Minor code changes (comments, misspellings, coding stylei, line endings)
[mirror_edk2.git] / ArmPlatformPkg / Include / Drivers / PL031RealTimeClock.h
CommitLineData
0f4386e7 1/** @file\r
2*\r
3* Copyright (c) 2011, ARM Limited. All rights reserved.\r
4*\r
5* This program and the accompanying materials\r
6* are licensed and made available under the terms and conditions of the BSD License\r
7* which accompanies this distribution. The full text of the license may be found at\r
8* http://opensource.org/licenses/bsd-license.php\r
9*\r
10* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12*\r
13**/\r
14\r
15\r
16#ifndef __PL031_REAL_TIME_CLOCK_H__\r
17#define __PL031_REAL_TIME_CLOCK_H__\r
18\r
0f4386e7 19// PL031 Registers\r
5cc45b70 20#define PL031_RTC_DR_DATA_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x000)\r
21#define PL031_RTC_MR_MATCH_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x004)\r
22#define PL031_RTC_LR_LOAD_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x008)\r
23#define PL031_RTC_CR_CONTROL_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x00C)\r
24#define PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x010)\r
25#define PL031_RTC_RIS_RAW_IRQ_STATUS_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x014)\r
26#define PL031_RTC_MIS_MASKED_IRQ_STATUS_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x018)\r
27#define PL031_RTC_ICR_IRQ_CLEAR_REGISTER ((UINT32)PcdGet32(PcdPL031RtcBase) + 0x01C)\r
28#define PL031_RTC_PERIPH_ID0 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFE0)\r
29#define PL031_RTC_PERIPH_ID1 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFE4)\r
30#define PL031_RTC_PERIPH_ID2 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFE8)\r
31#define PL031_RTC_PERIPH_ID3 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFEC)\r
32#define PL031_RTC_PCELL_ID0 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFF0)\r
33#define PL031_RTC_PCELL_ID1 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFF4)\r
34#define PL031_RTC_PCELL_ID2 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFF8)\r
35#define PL031_RTC_PCELL_ID3 ((UINT32)PcdGet32(PcdPL031RtcBase) + 0xFFC)\r
0f4386e7 36\r
37// PL031 Values\r
38#define PL031_RTC_ENABLED 0x00000001\r
39#define PL031_SET_IRQ_MASK 0x00000001\r
40#define PL031_IRQ_TRIGGERED 0x00000001\r
41#define PL031_CLEAR_IRQ 0x00000001\r
42\r
43#define PL031_COUNTS_PER_SECOND 1\r
44\r
45// Define EPOCH (1970-JANUARY-01) in the Julian Date representation\r
46#define EPOCH_JULIAN_DATE 2440588\r
47\r
48// Seconds per unit\r
49#define SEC_PER_MIN ((UINTN) 60)\r
50#define SEC_PER_HOUR ((UINTN) 3600)\r
51#define SEC_PER_DAY ((UINTN) 86400)\r
52\r
53#define SEC_PER_MONTH ((UINTN) 2,592,000)\r
54#define SEC_PER_YEAR ((UINTN) 31,536,000)\r
55\r
56#endif\r