mirror of
https://github.com/Dasharo/edk2.git
synced 2026-03-06 14:47:27 -08:00
ArmPlatformPkg/PL031RealTimeClockLib: Implement PL031 RTC drive
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11793 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -92,6 +92,9 @@
|
||||
#define SP804_TIMER2_BASE (ARM_EB_BOARD_PERIPH_BASE + 0x12000)
|
||||
#define SP804_TIMER3_BASE (ARM_EB_BOARD_PERIPH_BASE + 0x12020)
|
||||
|
||||
// PL301 RTC
|
||||
#define PL031_RTC_BASE (ARM_EB_BOARD_PERIPH_BASE + 0x17000)
|
||||
|
||||
// Dynamic Memory Controller Base
|
||||
#define ARM_EB_DMC_BASE 0x10018000
|
||||
|
||||
@@ -119,6 +122,10 @@
|
||||
//#define ARM_EB_L2x0_CTLR_BASE 0x1E00A000*/
|
||||
|
||||
|
||||
// PL031 RTC - Other settings
|
||||
#define PL031_PPM_ACCURACY 300000000
|
||||
|
||||
|
||||
/*******************************************
|
||||
// EFI Memory Map in Permanent Memory (DRAM)
|
||||
*******************************************/
|
||||
|
||||
@@ -126,6 +126,9 @@
|
||||
#define ARM_VE_DECPROT_BIT_NMC_TZASC_LOCK (1 << 4)
|
||||
#define ARM_VE_DECPROT_BIT_SMC_TZASC_LOCK (1 << 5)
|
||||
|
||||
// PL031 RTC - Other settings
|
||||
#define PL031_PPM_ACCURACY 300000000
|
||||
|
||||
|
||||
// PL111 Lcd
|
||||
#define PL111_CLCD_CORE_TILE_VIDEO_MODE_OSC_ID 1
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011, 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
|
||||
* which accompanies this distribution. The full text of the license may be found at
|
||||
* http://opensource.org/licenses/bsd-license.php
|
||||
*
|
||||
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
#ifndef __PL031_REAL_TIME_CLOCK_H__
|
||||
#define __PL031_REAL_TIME_CLOCK_H__
|
||||
|
||||
#include <Base.h>
|
||||
#include <ArmPlatform.h>
|
||||
|
||||
// PL031 Registers
|
||||
#define PL031_RTC_DR_DATA_REGISTER (PL031_RTC_BASE + 0x000)
|
||||
#define PL031_RTC_MR_MATCH_REGISTER (PL031_RTC_BASE + 0x004)
|
||||
#define PL031_RTC_LR_LOAD_REGISTER (PL031_RTC_BASE + 0x008)
|
||||
#define PL031_RTC_CR_CONTROL_REGISTER (PL031_RTC_BASE + 0x00C)
|
||||
#define PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGISTER (PL031_RTC_BASE + 0x010)
|
||||
#define PL031_RTC_RIS_RAW_IRQ_STATUS_REGISTER (PL031_RTC_BASE + 0x014)
|
||||
#define PL031_RTC_MIS_MASKED_IRQ_STATUS_REGISTER (PL031_RTC_BASE + 0x018)
|
||||
#define PL031_RTC_ICR_IRQ_CLEAR_REGISTER (PL031_RTC_BASE + 0x01C)
|
||||
#define PL031_RTC_PERIPH_ID0 (PL031_RTC_BASE + 0xFE0)
|
||||
#define PL031_RTC_PERIPH_ID1 (PL031_RTC_BASE + 0xFE4)
|
||||
#define PL031_RTC_PERIPH_ID2 (PL031_RTC_BASE + 0xFE8)
|
||||
#define PL031_RTC_PERIPH_ID3 (PL031_RTC_BASE + 0xFEC)
|
||||
#define PL031_RTC_PCELL_ID0 (PL031_RTC_BASE + 0xFF0)
|
||||
#define PL031_RTC_PCELL_ID1 (PL031_RTC_BASE + 0xFF4)
|
||||
#define PL031_RTC_PCELL_ID2 (PL031_RTC_BASE + 0xFF8)
|
||||
#define PL031_RTC_PCELL_ID3 (PL031_RTC_BASE + 0xFFC)
|
||||
|
||||
// PL031 Values
|
||||
#define PL031_RTC_ENABLED 0x00000001
|
||||
#define PL031_SET_IRQ_MASK 0x00000001
|
||||
#define PL031_IRQ_TRIGGERED 0x00000001
|
||||
#define PL031_CLEAR_IRQ 0x00000001
|
||||
|
||||
#define PL031_COUNTS_PER_SECOND 1
|
||||
|
||||
// Define EPOCH (1970-JANUARY-01) in the Julian Date representation
|
||||
#define EPOCH_JULIAN_DATE 2440588
|
||||
|
||||
// Seconds per unit
|
||||
#define SEC_PER_MIN ((UINTN) 60)
|
||||
#define SEC_PER_HOUR ((UINTN) 3600)
|
||||
#define SEC_PER_DAY ((UINTN) 86400)
|
||||
|
||||
#define SEC_PER_MONTH ((UINTN) 2,592,000)
|
||||
#define SEC_PER_YEAR ((UINTN) 31,536,000)
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,10 @@
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
ArmPlatformPkg/ArmPlatformPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
IoLib
|
||||
UefiLib
|
||||
DebugLib
|
||||
ArmPlatformSysConfigLib
|
||||
|
||||
Reference in New Issue
Block a user