ReactOS  0.4.15-dev-3165-gdf6fff7
hwinfo.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Boot Loader
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: boot/armllb/hw/omap3-zoom2/hwinfo.c
5  * PURPOSE: LLB Hardware Info Routines for OMAP3 ZOOM2
6  * PROGRAMMERS: ReactOS Portable Systems Group
7  */
8 
9 #include "precomp.h"
10 
12 
13 #define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))
14 
15 ULONG
16 NTAPI
18 {
19  return MACH_TYPE_OMAP_ZOOM2;
20 }
21 
22 ULONG
23 NTAPI
25 {
26  return 48000000;
27 }
28 
29 ULONG
30 NTAPI
32 {
33  return 0x48318000;
34 }
35 
36 ULONG
37 NTAPI
39 {
40  return 0;
41 }
42 
43 ULONG
45 {
46  /* Issue the GET_TIME request on the RTC control register */
47  LlbHwOmap3TwlWrite1(0x4B, 0x29, 0x41);
48 
49  /* Read the BCD registers and convert them */
52  LlbTime.Hour = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1E));
53  LlbTime.Day = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1F));
54  LlbTime.Month = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x20));
55  LlbTime.Year = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x21));
56  LlbTime.Year += (LlbTime.Year > 80) ? 1900 : 2000;
57  return 0;
58 }
59 
60 /* EOF */
TIMEINFO LlbTime
Definition: hwinfo.c:11
#define BCD_INT(bcd)
Definition: hwinfo.c:13
USHORT Second
Definition: fw.h:16
USHORT Month
Definition: fw.h:12
USHORT Minute
Definition: fw.h:15
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
Definition: fw.h:9
ULONG NTAPI LlbHwGetSerialUart(VOID)
Definition: hwinfo.c:34
#define MACH_TYPE_OMAP_ZOOM2
Definition: machtype.h:30
VOID NTAPI LlbHwOmap3TwlWrite1(IN UCHAR ChipAddress, IN UCHAR RegisterAddress, IN UCHAR Value)
Definition: hwtwl40x.c:61
ULONG NTAPI LlbHwGetPClk(VOID)
Definition: hwinfo.c:20
USHORT Year
Definition: fw.h:11
USHORT Hour
Definition: fw.h:14
ULONG NTAPI LlbHwGetTmr0Base(VOID)
Definition: hwinfo.c:27
unsigned int ULONG
Definition: retypes.h:1
ULONG LlbHwRtcRead(VOID)
Definition: hwinfo.c:132
USHORT Day
Definition: fw.h:13
ULONG NTAPI LlbHwGetBoardType(VOID)
Definition: hwinfo.c:13
UCHAR NTAPI LlbHwOmap3TwlRead1(IN UCHAR ChipAddress, IN UCHAR RegisterAddress)
Definition: hwtwl40x.c:15