source:
rtems/c/src/lib/libbsp/powerpc/ppcn_60x/nvram/mk48t18.h
@
eba2e4f
Last change on this file since eba2e4f was 0c04c377, checked in by Joel Sherrill <joel.sherrill@…>, on 02/18/99 at 16:48:14 | |
---|---|
|
|
File size: 2.8 KB |
Line | |
---|---|
1 | /* |
2 | * COPYRIGHT (c) 1998 by Radstone Technology |
3 | * |
4 | * |
5 | * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY |
6 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE |
7 | * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK |
8 | * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. |
9 | * |
10 | * You are hereby granted permission to use, copy, modify, and distribute |
11 | * this file, provided that this notice, plus the above copyright notice |
12 | * and disclaimer, appears in all copies. Radstone Technology will provide |
13 | * no support for this code. |
14 | * |
15 | */ |
16 | |
17 | /* |
18 | * Definitions for the mk48t18 RTC/NvRAM |
19 | */ |
20 | |
21 | #ifndef _MK48T18_H |
22 | #define _MK48T18_H |
23 | |
24 | #include "prepnvr.h" |
25 | |
26 | /* |
27 | * This structure maps to the top of the NvRAM. It is based on the standard |
28 | * CMOS.h file for the ds1385. Feature and system dependant areas are preserved |
29 | * for potential compatibility issues. |
30 | * |
31 | * The CRC's are computed with x**16+x**12+x**5 + 1 polynomial |
32 | * The clock is kept in 24 hour BCD mode and should be set to UT(GMT) |
33 | */ |
34 | |
35 | typedef struct _MK48T18_CMOS_MAP { |
36 | unsigned8 SystemDependentArea2[8]; |
37 | unsigned8 FeatureByte0[1]; |
38 | unsigned8 FeatureByte1[1]; |
39 | unsigned8 Century; /* century byte in BCD */ |
40 | unsigned8 FeatureByte3[1]; |
41 | unsigned8 FeatureByte4[1]; |
42 | unsigned8 FeatureByte5[1]; |
43 | unsigned8 FeatureByte6[1]; |
44 | unsigned8 FeatureByte7[1]; |
45 | unsigned8 BootPW[14]; |
46 | rtems_unsigned16 BootCrc; /* CRC on BootPW */ |
47 | unsigned8 ConfigPW[14]; |
48 | rtems_unsigned16 ConfigCrc; /* CRC on ConfigPW */ |
49 | unsigned8 SystemDependentArea1[8]; |
50 | /* |
51 | * The following are the RTC registers |
52 | */ |
53 | volatile unsigned8 Control; |
54 | volatile unsigned8 Second:7; /* 0-59 */ |
55 | volatile unsigned8 Stop:1; |
56 | volatile unsigned8 Minute; /* 0-59 */ |
57 | volatile unsigned8 Hour; /* 0-23 */ |
58 | volatile unsigned8 Day:3; /* 1-7 */ |
59 | volatile unsigned8 Resvd1:3; /* 0 */ |
60 | volatile unsigned8 FT:1; /* Frequency test bit - must be 0 */ |
61 | volatile unsigned8 Resvd2:1; /* 0 */ |
62 | volatile unsigned8 Date; /* 1-31 */ |
63 | volatile unsigned8 Month; /* 1-12 */ |
64 | volatile unsigned8 Year; /* 0-99 */ |
65 | } MK48T18_CMOS_MAP, *PMK48T18_CMOS_MAP; |
66 | |
67 | /* |
68 | * Control register definitions |
69 | */ |
70 | #define MK48T18_CTRL_WRITE 0x80 |
71 | #define MK48T18_CTRL_READ 0x40 |
72 | #define MK48T18_CTRL_SIGN 0x20 |
73 | |
74 | #define MK48T18_NVSIZE 8192-sizeof(MK48T18_CMOS_MAP) |
75 | #define MK48T18_GESIZE (MK48T18_NVSIZE-CONFSIZE-OSAREASIZE-sizeof(HEADER)) |
76 | #define MK48T18_BASE (PMK48T18_NVRAM_MAP)((unsigned8 *)PCI_MEM_BASE+0x00800000) |
77 | |
78 | /* Here is the whole map of the MK48T18 NVRAM */ |
79 | typedef struct _MK48T18_NVRAM_MAP { |
80 | HEADER Header; |
81 | unsigned8 GEArea[MK48T18_GESIZE]; |
82 | unsigned8 OSArea[OSAREASIZE]; |
83 | unsigned8 ConfigArea[CONFSIZE]; |
84 | MK48T18_CMOS_MAP CMOS; |
85 | } MK48T18_NVRAM_MAP, *PMK48T18_NVRAM_MAP; |
86 | |
87 | #endif /* _MK48T18_H */ |
Note: See TracBrowser
for help on using the repository browser.