1 The U-Boot Driver Model Project
2 ===============================
3 Watchdog device subsystem analysis
4 ==================================
6 Tomas Hlavacek <tmshlvck@gmail.com>
12 U-Boot currently implements an API for HW watchdog devices as explicit drivers
13 in drivers/watchdog directory. There are also drivers for both hardware and
14 software watchdog on particular CPUs implemented in arch/*/cpu/*/cpu.c. There
15 are macros in include/watchdog.h that selects between SW and HW watchdog and
16 assembly SW implementation.
18 The current common interface comprises of one set out of these two possible
22 void watchdog_reset(void);
23 int watchdog_disable(void);
24 int watchdog_init(void);
27 void hw_watchdog_reset(void);
28 void hw_watchdog_init(void);
30 The watchdog implementations are also spread through board/*/*.c that in
31 some cases. The API and semantics is in most cases same as the above
32 mentioned common functions.
41 In the UDM each watchdog driver would register itself by a function
43 int watchdog_device_register(struct instance *i,
44 const struct watchdog_device_ops *o);
46 The structure being defined as follows:
48 struct watchdog_device_ops {
49 int (*disable)(struct instance *i);
50 void (*reset)(struct instance *i);
53 The watchdog_init() function will be dissolved into probe() function.
55 2) Conversion thougths
56 ----------------------
58 Conversion of watchdog implementations to a new API could be divided
59 to three subsections: a) HW implementations, which are mostly compliant
60 to the above mentioned API; b) SW implementations, which are compliant
61 to the above mentioned API and c) SW implementations that are not compliant
62 to the API and has to be rectified or partially rewritten.
64 III) Analysis of in-tree drivers
65 --------------------------------
67 1) drivers/watchdog/at91sam9_wdt.c
68 ----------------------------------
69 The driver is standard HW watchdog. Simple conversion is possible.
72 2) drivers/watchdog/ftwdt010_wdt.c
73 ----------------------------------
74 The driver is ad-hoc HW watchdog. Conversion has to take into account
75 driver parts spread in include/faraday/*. Restructuring the driver and
76 code cleanup has to be considered.
79 3) arch/arm/cpu/arm1136/mx31/timer.c
80 ------------------------------------
81 The driver is semi-standard ad-hoc HW watchdog. Conversion has to take
82 into account driver parts spread in the timer.c file.
85 4) arch/arm/cpu/arm926ejs/davinci/timer.c
86 -----------------------------------------
87 The driver is ad-hoc semi-standard HW watchdog. Conversion has to take
88 into account driver parts spread in the timer.c file.
91 5) arch/arm/cpu/armv7/omap-common/hwinit-common.c
92 -------------------------------------------------
93 The driver is non-standard ad-hoc HW watchdog. Conversion is possible
94 but functions has to be renamed and constants moved to another places.
97 6) arch/arm/cpu/armv7/omap3/board.c
98 -----------------------------------
99 The driver is non-standard ad-hoc HW watchdog. Conversion is possible
100 but functions has to be renamed and constants moved to another places.
103 7) arch/blackfin/cpu/watchdog.c
104 -------------------------------
105 The driver is standard HW watchdog. Simple conversion is possible.
108 8) arch/m68k/cpu/mcf523x/cpu.c
109 ------------------------------
110 The driver is standard HW watchdog. Simple conversion is possible.
113 9) arch/m68k/cpu/mcf52x2/cpu.c
114 ------------------------------
115 The driver is standard HW watchdog. Simple conversion is possible.
118 10) arch/m68k/cpu/mcf532x/cpu.c
119 -------------------------------
120 The driver is standard HW watchdog. Simple conversion is possible.
123 11) arch/m68k/cpu/mcf547x_8x/cpu.c
124 ----------------------------------
125 The driver is standard HW watchdog (there is slight naming convention
126 violation that has to be rectified). Simple conversion is possible.
129 12) arch/powerpc/cpu/74xx_7xx/cpu.c
130 -----------------------------------
131 The driver is standard HW watchdog. Simple conversion is possible.
134 13) arch/powerpc/cpu/mpc512x/cpu.c
135 ----------------------------------
136 The driver is standard HW watchdog. Simple conversion is possible.
139 14) arch/powerpc/cpu/mpc5xx/cpu.c
140 ---------------------------------
141 The driver is standard HW watchdog. Simple conversion is possible.
144 15) arch/powerpc/cpu/mpc5xxx/cpu.c
145 ----------------------------------
146 The driver is standard HW watchdog. Simple conversion is possible.
149 16) arch/powerpc/cpu/mpc8260/cpu.c
150 ----------------------------------
151 The driver is standard HW watchdog. Simple conversion is possible.
154 17) arch/powerpc/cpu/mpc83xx/cpu.c
155 ----------------------------------
156 The driver is standard HW watchdog. Simple conversion is possible.
159 18) arch/powerpc/cpu/mpc85xx/cpu.c
160 ----------------------------------
161 The driver is standard HW watchdog. Simple conversion is possible.
164 19) arch/powerpc/cpu/mpc86xx/cpu.c
165 ----------------------------------
166 The driver is standard HW watchdog. Simple conversion is possible.
169 20) arch/powerpc/cpu/mpc8xx/cpu.c
171 The driver is standard HW watchdog. Simple conversion is possible.
174 21) arch/powerpc/cpu/ppc4xx/cpu.c
175 ---------------------------------
176 The driver is standard HW watchdog. Simple conversion is possible.
179 22) arch/sh/cpu/sh2/watchdog.c
180 ------------------------------
181 The driver is standard HW watchdog. Simple conversion is possible.
184 23) arch/sh/cpu/sh3/watchdog.c
185 ------------------------------
186 The driver is standard HW watchdog. Simple conversion is possible.
189 24) arch/sh/cpu/sh4/watchdog.c
190 ------------------------------
191 The driver is standard HW watchdog. Simple conversion is possible.
194 25) board/amcc/luan/luan.c
195 --------------------------
196 The driver is standard HW watchdog. Simple conversion is possible.
199 26) board/amcc/yosemite/yosemite.c
200 ----------------------------------
201 The driver is standard HW watchdog. Simple conversion is possible.
204 27) board/apollon/apollon.c
205 ---------------------------
206 The driver is standard HW watchdog however the watchdog_init()
207 function is called in early initialization. Simple conversion is possible.
210 28) board/bmw/m48t59y.c
211 -----------------------
212 Special watchdog driver. Dead code. To be removed.
215 29) board/davedenx/qong/qong.c
216 ------------------------------
217 The driver is standard HW watchdog. Simple conversion is possible.
220 30) board/dvlhost/watchdog.c
221 ----------------------------
222 The driver is standard HW watchdog. Simple conversion is possible.
225 31) board/eNET/eNET.c
226 ---------------------
227 The driver is standard HW watchdog. Simple conversion is possible.
230 32) board/eltec/elppc/elppc.c
231 -----------------------------
232 The driver is standard HW watchdog. Simple conversion is possible.
235 33) board/enbw/enbw_cmc/enbw_cmc.c
236 ----------------------------------
237 Only function proxy call. Code cleanup needed.
240 34) board/freescale/mx31pdk/mx31pdk.c
241 -------------------------------------
242 Only function proxy call. Code cleanup needed.
245 35) board/gth2/gth2.c
246 ---------------------
247 The driver is standard HW watchdog. Simple conversion is possible.
250 36) board/lwmon5/lwmon5.c
251 -------------------------
252 The driver is standard HW watchdog. Simple conversion is possible.
255 37) board/manroland/mucmc52/mucmc52.c
256 -------------------------------------
257 The driver is standard HW watchdog. Simple conversion is possible.
260 38) board/manroland/uc101/uc101.c
261 ---------------------------------
262 The driver is standard HW watchdog. Simple conversion is possible.
265 39) board/mousse/m48t59y.c
266 --------------------------
267 Special watchdog driver. Dead code. To be removed.
270 40) board/mvblue/mvblue.c
271 -------------------------
272 The driver is standard HW watchdog. Simple conversion is possible.
275 41) board/netphone/netphone.c
276 -----------------------------
277 The driver is standard HW watchdog. Simple conversion is possible.
280 42) board/netta/netta.c
281 -----------------------
282 The driver is standard HW watchdog. Simple conversion is possible.
285 43) board/netta2/netta2.c
286 -------------------------
287 The driver is standard HW watchdog. Simple conversion is possible.
290 44) board/omicron/calimain/calimain.c
291 -------------------------------------
292 Only function proxy call. Code cleanup needed.
295 45) board/pcippc2/pcippc2.c
296 ---------------------------
297 The driver is standard HW watchdog. Simple conversion is possible.
300 46) board/pcs440ep/pcs440ep.c
301 -----------------------------
302 The driver is standard HW watchdog. Simple conversion is possible.
305 47) board/stx/stxxtc/stxxtc.c
306 -----------------------------
307 The driver is standard HW watchdog. Simple conversion is possible.
310 48) board/ti/omap2420h4/omap2420h4.c
311 ------------------------------------
312 The driver is standard HW watchdog. Simple conversion is possible.
315 49) board/ttcontrol/vision2/vision2.c
316 -------------------------------------
317 The driver is standard HW watchdog but namespace is polluted by
318 non-standard macros. Simple conversion is possible, code cleanup
322 50) board/v38b/v38b.c
323 ---------------------
324 The driver is standard HW watchdog. Simple conversion is possible.
327 51) board/ve8313/ve8313.c
328 -------------------------
329 The driver is standard HW watchdog. Simple conversion is possible.
332 52) board/w7o/watchdog.c
333 ------------------------
334 The driver is standard HW watchdog. Simple conversion is possible.