blob: 3640d24c2847197dea82c7a79308fa4128b9a584 [file] [log] [blame]
Tomas Hlavacek2208b042012-08-08 01:42:29 +00001=============================
2RTC device subsystem analysis
3=============================
4
5Tomas Hlavacek <tmshlvck@gmail.com>
62012-03-10
7
8I) Overview
9-----------
10
11U-Boot currently implements one common API for RTC devices. The interface
12is defined in include/rtc.h and comprises of functions and structures:
13
14 struct rtc_time {
Wolfgang Denkec7fbf52013-10-04 17:43:24 +020015 int tm_sec;
16 int tm_min;
17 int tm_hour;
18 int tm_mday;
19 int tm_mon;
20 int tm_year;
21 int tm_wday;
22 int tm_yday;
23 int tm_isdst;
Tomas Hlavacek2208b042012-08-08 01:42:29 +000024 };
25
26 int rtc_get (struct rtc_time *);
27 int rtc_set (struct rtc_time *);
28 void rtc_reset (void);
29
30The functions are implemented by a proper device driver in drivers/rtc
31directory and the driver to be compiled in is selected in a Makefile.
32Drivers are mutually exclusive.
33
34Drivers depends on date code in drivers/rtc/date.c and naturally on board
35specific data.
36
37II) Approach
38------------
39
40 1) New API
41 ----------
42 In the UDM each rtc driver would register itself by a function
43
44 int rtc_device_register(struct instance *i,
Wolfgang Denkec7fbf52013-10-04 17:43:24 +020045 struct rtc_device_ops *o);
Tomas Hlavacek2208b042012-08-08 01:42:29 +000046
47 The structure being defined as follows:
48
49 struct rtc_device_ops {
Wolfgang Denkec7fbf52013-10-04 17:43:24 +020050 int (*get_time)(struct instance *i, struct rtc_time *t);
51 int (*set_time)(struct instance *i, struct rtc_time *t);
52 int (*reset)(struct instance *i);
Tomas Hlavacek2208b042012-08-08 01:42:29 +000053 };
54
55
56 2) Conversion thougths
57 ----------------------
58 U-Boot RTC drivers exports the same functions and therefore the conversion
59 of the drivers is straight-forward. There is no initialization needed.
60
61
62III) Analysis of in-tree drivers
63--------------------------------
64
Masahiro Yamadaa756da92013-09-24 10:32:04 +090065 drivers/rtc/rv3029.c
66 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +000067 The driver is standard rtc. Simple conversion is possible.
68
69
Masahiro Yamadaa756da92013-09-24 10:32:04 +090070 drivers/rtc/s3c24x0_rtc.c
71 -------------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +000072 The driver is standard rtc. Simple conversion is possible.
73
74
Masahiro Yamadaa756da92013-09-24 10:32:04 +090075 drivers/rtc/pt7c4338.c
76 ----------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +000077 The driver is standard rtc. Simple conversion is possible.
78
79
Masahiro Yamadaa756da92013-09-24 10:32:04 +090080 drivers/rtc/mvrtc.c
81 -------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +000082 The driver is standard rtc. Simple conversion is possible.
83
84
Masahiro Yamadaa756da92013-09-24 10:32:04 +090085 drivers/rtc/ftrtc010.c
86 ----------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +000087 The driver is standard rtc. Simple conversion is possible.
88
89
Masahiro Yamadaa756da92013-09-24 10:32:04 +090090 drivers/rtc/mpc5xxx.c
91 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +000092 The driver is standard rtc. Simple conversion is possible.
93
94
Masahiro Yamadaa756da92013-09-24 10:32:04 +090095 drivers/rtc/ds164x.c
96 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +000097 The driver is standard rtc. Simple conversion is possible.
98
99
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900100 drivers/rtc/rs5c372.c
101 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000102 The driver is standard rtc. Simple conversion is possible.
103
104
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900105 drivers/rtc/m41t94.c
106 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000107 The driver is standard rtc. Simple conversion is possible.
108
109
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900110 drivers/rtc/mc13xxx-rtc.c
111 -------------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000112 The driver is standard rtc. Simple conversion is possible.
113
114
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900115 drivers/rtc/mcfrtc.c
116 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000117 The driver is standard rtc. Simple conversion is possible.
118
119
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900120 drivers/rtc/davinci.c
121 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000122 The driver is standard rtc. Simple conversion is possible.
123
124
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900125 drivers/rtc/rx8025.c
126 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000127 The driver is standard rtc. Simple conversion is possible.
128
129
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900130 drivers/rtc/bfin_rtc.c
131 ----------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000132 The driver is standard rtc. Simple conversion is possible.
133
134
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900135 drivers/rtc/m41t62.c
136 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000137 The driver is standard rtc. Simple conversion is possible.
138
139
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900140 drivers/rtc/ds1306.c
141 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000142 The driver is standard rtc. Simple conversion is possible.
143
144
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900145 drivers/rtc/mpc8xx.c
146 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000147 The driver is standard rtc. Simple conversion is possible.
148
149
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900150 drivers/rtc/ds3231.c
151 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000152 The driver is standard rtc. Simple conversion is possible.
153
154
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900155 drivers/rtc/ds12887.c
156 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000157 The driver is standard rtc. Simple conversion is possible.
158
159
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900160 drivers/rtc/ds1302.c
161 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000162 The driver is standard rtc. Simple conversion is possible.
163
164
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900165 drivers/rtc/ds1374.c
166 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000167 The driver is standard rtc. Simple conversion is possible.
168
169
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900170 drivers/rtc/ds174x.c
171 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000172 The driver is standard rtc. Simple conversion is possible.
173
174
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900175 drivers/rtc/m41t60.c
176 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000177 The driver is standard rtc. Simple conversion is possible.
178
179
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900180 drivers/rtc/m48t35ax.c
181 ----------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000182 The driver is standard rtc. Simple conversion is possible.
183
184
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900185 drivers/rtc/pl031.c
186 -------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000187 The driver is standard rtc. Simple conversion is possible.
188
189
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900190 drivers/rtc/x1205.c
191 -------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000192 The driver is standard rtc. Simple conversion is possible.
193
194
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900195 drivers/rtc/m41t11.c
196 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000197 The driver is standard rtc. Simple conversion is possible.
198
199
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900200 drivers/rtc/pcf8563.c
201 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000202 The driver is standard rtc. Simple conversion is possible.
203
204
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900205 drivers/rtc/mk48t59.c
206 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000207 Macros needs cleanup. Besides that the driver is standard rtc.
208 Simple conversion is possible.
209
210
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900211 drivers/rtc/mxsrtc.c
212 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000213 The driver is standard rtc. Simple conversion is possible.
214
215
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900216 drivers/rtc/ds1307.c
217 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000218 The driver is standard rtc. Simple conversion is possible.
219
220
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900221 drivers/rtc/ds1556.c
222 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000223 The driver is standard rtc. Simple conversion is possible.
224
225
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900226 drivers/rtc/rtc4543.c
227 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000228 The driver is standard rtc. Simple conversion is possible.
229
230
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900231 drivers/rtc/ds1337.c
232 --------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000233 The driver is standard rtc. Simple conversion is possible.
234
235
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900236 drivers/rtc/isl1208.c
237 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000238 The driver is standard rtc. Simple conversion is possible.
239
240
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900241 drivers/rtc/max6900.c
242 ---------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000243 The driver is standard rtc. Simple conversion is possible.
244
245
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900246 drivers/rtc/mc146818.c
247 ----------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000248 The driver is standard rtc. Simple conversion is possible.
249
250
Masahiro Yamadaa756da92013-09-24 10:32:04 +0900251 drivers/rtc/at91sam9_rtt.c
252 --------------------------
Tomas Hlavacek2208b042012-08-08 01:42:29 +0000253 The driver is standard rtc. Simple conversion is possible.