Commit 39ff7d5f4cc547a2034a8bfc2a5b5f4b62fd5c20
Committed by
Wolfgang Denk
1 parent
2a49bf3149
Exists in
master
and in
54 other branches
POST: Remove duplicated post_hotkey_pressed() functions
This patch introduces a weak default function for post_hotkey_pressed(), returning 0, for boards without hotkey support. The long-running tests won't be started on those boards. This default function was implemented in many board directories. By implementing this weak default we can remove all those duplicate versions. Boards with hotkey support, can override this weak default function by defining one in their board specific code. Signed-off-by: Stefan Roese <sr@denx.de>
Showing 22 changed files with 16 additions and 232 deletions Side-by-side Diff
- board/amcc/katmai/katmai.c
- board/amcc/kilauea/kilauea.c
- board/amcc/makalu/makalu.c
- board/amcc/ocotea/ocotea.c
- board/amcc/sequoia/sequoia.c
- board/amcc/taishan/taishan.c
- board/amcc/yucca/yucca.c
- board/cm5200/cm5200.c
- board/esd/pmc440/pmc440.c
- board/gen860t/gen860t.c
- board/korat/korat.c
- board/kup/common/kup.c
- board/mpl/mip405/mip405.c
- board/netstal/hcu4/hcu4.c
- board/netstal/hcu5/hcu5.c
- board/netstal/mcu25/mcu25.c
- board/netta/netta.c
- board/prodrive/alpr/alpr.c
- board/sacsng/sacsng.c
- board/ssv/adnpesc1/adnpesc1.c
- board/uc100/uc100.c
- post/post.c
board/amcc/katmai/katmai.c
... | ... | @@ -279,17 +279,6 @@ |
279 | 279 | } |
280 | 280 | #endif /* defined(CONFIG_PCI) */ |
281 | 281 | |
282 | -#ifdef CONFIG_POST | |
283 | -/* | |
284 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
285 | - * Called from board_init_f(). | |
286 | - */ | |
287 | -int post_hotkeys_pressed(void) | |
288 | -{ | |
289 | - return (ctrlc()); | |
290 | -} | |
291 | -#endif | |
292 | - | |
293 | 282 | int board_eth_init(bd_t *bis) |
294 | 283 | { |
295 | 284 | cpu_eth_init(bis); |
board/amcc/kilauea/kilauea.c
... | ... | @@ -284,15 +284,4 @@ |
284 | 284 | |
285 | 285 | return (0); |
286 | 286 | } |
287 | - | |
288 | -#if defined(CONFIG_POST) | |
289 | -/* | |
290 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
291 | - * Called from board_init_f(). | |
292 | - */ | |
293 | -int post_hotkeys_pressed(void) | |
294 | -{ | |
295 | - return 0; /* No hotkeys supported */ | |
296 | -} | |
297 | -#endif /* CONFIG_POST */ |
board/amcc/makalu/makalu.c
... | ... | @@ -236,15 +236,4 @@ |
236 | 236 | |
237 | 237 | return (0); |
238 | 238 | } |
239 | - | |
240 | -#if defined(CONFIG_POST) | |
241 | -/* | |
242 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
243 | - * Called from board_init_f(). | |
244 | - */ | |
245 | -int post_hotkeys_pressed(void) | |
246 | -{ | |
247 | - return 0; /* No hotkeys supported */ | |
248 | -} | |
249 | -#endif /* CONFIG_POST */ |
board/amcc/ocotea/ocotea.c
... | ... | @@ -400,16 +400,4 @@ |
400 | 400 | |
401 | 401 | return; |
402 | 402 | } |
403 | - | |
404 | -#ifdef CONFIG_POST | |
405 | -/* | |
406 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
407 | - * Called from board_init_f(). | |
408 | - */ | |
409 | -int post_hotkeys_pressed(void) | |
410 | -{ | |
411 | - | |
412 | - return (ctrlc()); | |
413 | -} | |
414 | -#endif |
board/amcc/sequoia/sequoia.c
... | ... | @@ -370,17 +370,6 @@ |
370 | 370 | } |
371 | 371 | #endif |
372 | 372 | |
373 | -#if defined(CONFIG_POST) | |
374 | -/* | |
375 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
376 | - * Called from board_init_f(). | |
377 | - */ | |
378 | -int post_hotkeys_pressed(void) | |
379 | -{ | |
380 | - return 0; /* No hotkeys supported */ | |
381 | -} | |
382 | -#endif /* CONFIG_POST */ | |
383 | - | |
384 | 373 | #if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_SYS_RAMBOOT) |
385 | 374 | /* |
386 | 375 | * On NAND-booting sequoia, we need to patch the chips select numbers |
board/amcc/taishan/taishan.c
... | ... | @@ -209,17 +209,6 @@ |
209 | 209 | return (0); |
210 | 210 | } |
211 | 211 | |
212 | -#ifdef CONFIG_POST | |
213 | -/* | |
214 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
215 | - * Called from board_init_f(). | |
216 | - */ | |
217 | -int post_hotkeys_pressed(void) | |
218 | -{ | |
219 | - return (ctrlc()); | |
220 | -} | |
221 | -#endif | |
222 | - | |
223 | 212 | int board_eth_init(bd_t *bis) |
224 | 213 | { |
225 | 214 | cpu_eth_init(bis); |
board/amcc/yucca/yucca.c
... | ... | @@ -708,17 +708,6 @@ |
708 | 708 | return; |
709 | 709 | } |
710 | 710 | |
711 | -#ifdef CONFIG_POST | |
712 | -/* | |
713 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
714 | - * Called from board_init_f(). | |
715 | - */ | |
716 | -int post_hotkeys_pressed(void) | |
717 | -{ | |
718 | - return (ctrlc()); | |
719 | -} | |
720 | -#endif | |
721 | - | |
722 | 711 | /*---------------------------------------------------------------------------+ |
723 | 712 | | onboard_pci_arbiter_selected => from EPLD |
724 | 713 | +---------------------------------------------------------------------------*/ |
board/cm5200/cm5200.c
board/esd/pmc440/pmc440.c
... | ... | @@ -677,17 +677,6 @@ |
677 | 677 | } |
678 | 678 | #endif /* defined(CONFIG_PCI) */ |
679 | 679 | |
680 | -#if defined(CONFIG_POST) | |
681 | -/* | |
682 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
683 | - * Called from board_init_f(). | |
684 | - */ | |
685 | -int post_hotkeys_pressed(void) | |
686 | -{ | |
687 | - return 0; /* No hotkeys supported */ | |
688 | -} | |
689 | -#endif /* CONFIG_POST */ | |
690 | - | |
691 | 680 | #ifdef CONFIG_RESET_PHY_R |
692 | 681 | void reset_phy(void) |
693 | 682 | { |
board/gen860t/gen860t.c
... | ... | @@ -292,15 +292,4 @@ |
292 | 292 | puts ("### Please power off the board ###\n"); |
293 | 293 | while (1); |
294 | 294 | } |
295 | - | |
296 | -#ifdef CONFIG_POST | |
297 | -/* | |
298 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
299 | - * Called from board_init_f(). | |
300 | - */ | |
301 | -int post_hotkeys_pressed (void) | |
302 | -{ | |
303 | - return 0; /* No hotkeys supported */ | |
304 | -} | |
305 | -#endif |
board/korat/korat.c
... | ... | @@ -622,17 +622,6 @@ |
622 | 622 | } |
623 | 623 | #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */ |
624 | 624 | |
625 | -#if defined(CONFIG_POST) | |
626 | -/* | |
627 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
628 | - * Called from board_init_f(). | |
629 | - */ | |
630 | -int post_hotkeys_pressed(void) | |
631 | -{ | |
632 | - return 0; /* No hotkeys supported */ | |
633 | -} | |
634 | -#endif /* CONFIG_POST */ | |
635 | - | |
636 | 625 | #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) |
637 | 626 | void ft_board_setup(void *blob, bd_t *bd) |
638 | 627 | { |
board/kup/common/kup.c
... | ... | @@ -70,15 +70,4 @@ |
70 | 70 | else |
71 | 71 | setenv ("key1", "on"); |
72 | 72 | } |
73 | - | |
74 | -#ifdef CONFIG_POST | |
75 | -/* | |
76 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
77 | - * Called from board_init_f(). | |
78 | - */ | |
79 | -int post_hotkeys_pressed (void) | |
80 | -{ | |
81 | - return (0); | |
82 | -} | |
83 | -#endif |
board/mpl/mip405/mip405.c
... | ... | @@ -706,17 +706,6 @@ |
706 | 706 | } |
707 | 707 | |
708 | 708 | |
709 | -#ifdef CONFIG_POST | |
710 | -/* | |
711 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
712 | - * Called from board_init_f(). | |
713 | - */ | |
714 | -int post_hotkeys_pressed(void) | |
715 | -{ | |
716 | - return 0; /* No hotkeys supported */ | |
717 | -} | |
718 | -#endif | |
719 | - | |
720 | 709 | extern int mk_date (char *, struct rtc_time *); |
721 | 710 | |
722 | 711 | int last_stage_init (void) |
board/netstal/hcu4/hcu4.c
... | ... | @@ -174,17 +174,6 @@ |
174 | 174 | return dram_size; |
175 | 175 | } |
176 | 176 | |
177 | -#if defined(CONFIG_POST) | |
178 | -/* | |
179 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
180 | - * Called from board_init_f(). | |
181 | - */ | |
182 | -int post_hotkeys_pressed(void) | |
183 | -{ | |
184 | - return 0; /* No hotkeys supported */ | |
185 | -} | |
186 | -#endif /* CONFIG_POST */ | |
187 | - | |
188 | 177 | #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) |
189 | 178 | void ft_board_setup(void *blob, bd_t *bd) |
190 | 179 | { |
board/netstal/hcu5/hcu5.c
... | ... | @@ -390,17 +390,6 @@ |
390 | 390 | } |
391 | 391 | #endif /* defined(CONFIG_PCI) */ |
392 | 392 | |
393 | -#if defined(CONFIG_POST) | |
394 | -/* | |
395 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
396 | - * Called from board_init_f(). | |
397 | - */ | |
398 | -int post_hotkeys_pressed(void) | |
399 | -{ | |
400 | - return 0; /* No hotkeys supported */ | |
401 | -} | |
402 | -#endif /* CONFIG_POST */ | |
403 | - | |
404 | 393 | #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) |
405 | 394 | void ft_board_setup(void *blob, bd_t *bd) |
406 | 395 | { |
board/netstal/mcu25/mcu25.c
... | ... | @@ -173,17 +173,6 @@ |
173 | 173 | return dram_size; |
174 | 174 | } |
175 | 175 | |
176 | -#if defined(CONFIG_POST) | |
177 | -/* | |
178 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
179 | - * Called from board_init_f(). | |
180 | - */ | |
181 | -int post_hotkeys_pressed(void) | |
182 | -{ | |
183 | - return 0; /* No hotkeys supported */ | |
184 | -} | |
185 | -#endif /* CONFIG_POST */ | |
186 | - | |
187 | 176 | #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) |
188 | 177 | void ft_board_setup(void *blob, bd_t *bd) |
189 | 178 | { |
board/netta/netta.c
... | ... | @@ -564,17 +564,6 @@ |
564 | 564 | |
565 | 565 | #endif |
566 | 566 | |
567 | -#ifdef CONFIG_POST | |
568 | -/* | |
569 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
570 | - * Called from board_init_f(). | |
571 | - */ | |
572 | -int post_hotkeys_pressed(void) | |
573 | -{ | |
574 | - return 0; /* No hotkeys supported */ | |
575 | -} | |
576 | -#endif | |
577 | - | |
578 | 567 | #ifdef CONFIG_HW_WATCHDOG |
579 | 568 | |
580 | 569 | void hw_watchdog_reset(void) |
board/prodrive/alpr/alpr.c
... | ... | @@ -228,16 +228,4 @@ |
228 | 228 | out32r(PCIL0_POM1SA, ~(0x10000000 - 1) | 1); /* 256MB + enable region */ |
229 | 229 | } |
230 | 230 | #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_MASTER_INIT) */ |
231 | - | |
232 | -#ifdef CONFIG_POST | |
233 | -/* | |
234 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
235 | - * Called from board_init_f(). | |
236 | - */ | |
237 | -int post_hotkeys_pressed(void) | |
238 | -{ | |
239 | - | |
240 | - return (ctrlc()); | |
241 | -} | |
242 | -#endif |
board/sacsng/sacsng.c
... | ... | @@ -869,16 +869,4 @@ |
869 | 869 | #endif |
870 | 870 | |
871 | 871 | #endif /* CONFIG_MISC_INIT_R */ |
872 | - | |
873 | -#ifdef CONFIG_POST | |
874 | -/* | |
875 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
876 | - * Called from board_init_f(). | |
877 | - */ | |
878 | -int post_hotkeys_pressed(void) | |
879 | -{ | |
880 | - return 0; /* No hotkeys supported */ | |
881 | -} | |
882 | - | |
883 | -#endif |
board/ssv/adnpesc1/adnpesc1.c
... | ... | @@ -91,17 +91,6 @@ |
91 | 91 | |
92 | 92 | #endif |
93 | 93 | |
94 | -#if defined(CONFIG_POST) | |
95 | -/* | |
96 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
97 | - * Called from board_init_f(). | |
98 | - */ | |
99 | -int post_hotkeys_pressed(void) | |
100 | -{ | |
101 | - return 0; /* No hotkeys supported */ | |
102 | -} | |
103 | -#endif /* CONFIG_POST */ | |
104 | - | |
105 | 94 | #ifdef CONFIG_CMD_NET |
106 | 95 | int board_eth_init(bd_t *bis) |
107 | 96 | { |
board/uc100/uc100.c
... | ... | @@ -268,16 +268,4 @@ |
268 | 268 | |
269 | 269 | return 0; |
270 | 270 | } |
271 | - | |
272 | - | |
273 | -#ifdef CONFIG_POST | |
274 | -/* | |
275 | - * Returns 1 if keys pressed to start the power-on long-running tests | |
276 | - * Called from board_init_f(). | |
277 | - */ | |
278 | -int post_hotkeys_pressed (void) | |
279 | -{ | |
280 | - return 0; /* No hotkeys supported */ | |
281 | -} | |
282 | -#endif |
post/post.c
... | ... | @@ -58,6 +58,22 @@ |
58 | 58 | return res; |
59 | 59 | } |
60 | 60 | |
61 | +/* | |
62 | + * Supply a default implementation for post_hotkeys_pressed() for boards | |
63 | + * without hotkey support. We always return 0 here, so that the | |
64 | + * long-running tests won't be started. | |
65 | + * | |
66 | + * Boards with hotkey support can override this weak default function | |
67 | + * by defining one in their board specific code. | |
68 | + */ | |
69 | +int __post_hotkeys_pressed(void) | |
70 | +{ | |
71 | + return 0; /* No hotkeys supported */ | |
72 | +} | |
73 | +int post_hotkeys_pressed(void) | |
74 | + __attribute__((weak, alias("__post_hotkeys_pressed"))); | |
75 | + | |
76 | + | |
61 | 77 | void post_bootmode_init (void) |
62 | 78 | { |
63 | 79 | int bootmode = post_bootmode_get (0); |