- Add PL031 RTC code for Versatile.
[reactos.git] / reactos / boot / armllb / hw / versatile / hwinfo.c
1 /*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: boot/armllb/hw/versatile/hwinfo.c
5 * PURPOSE: LLB Hardware Info Routines
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 #include "precomp.h"
10
11 #define PL031_RTC_DR (LlbHwVersaRtcBase + 0x00)
12 static const ULONG LlbHwVersaRtcBase = 0x101E8000;
13
14 ULONG
15 NTAPI
16 LlbHwGetBoardType(VOID)
17 {
18 return MACH_TYPE_VERSATILE_PB;
19 }
20
21 ULONG
22 NTAPI
23 LlbHwGetPClk(VOID)
24 {
25 return 24000000;
26 }
27
28 ULONG
29 NTAPI
30 LlbHwGetTmr0Base(VOID)
31 {
32 return 0x101E2000;
33 }
34
35 ULONG
36 NTAPI
37 LlbHwGetSerialUart(VOID)
38 {
39 return 0;
40 }
41
42 VOID
43 NTAPI
44 LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
45 {
46 /* Mark MMIO space as reserved */
47 LlbAllocateMemoryEntry(BiosMemoryReserved, 0x10000000, 128 * 1024 * 1024);
48 }
49
50 ULONG
51 LlbHwRtcRead(VOID)
52 {
53 /* Read RTC value */
54 return READ_REGISTER_ULONG(PL031_RTC_DR);
55 }
56 /* EOF */