wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | #include <common.h> |
| 25 | #include <console.h> |
| 26 | #include <watchdog.h> |
| 27 | #include <post.h> |
| 28 | |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 29 | #ifdef CONFIG_LOGBUFFER |
| 30 | #include <logbuff.h> |
| 31 | #endif |
| 32 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 33 | DECLARE_GLOBAL_DATA_PTR; |
| 34 | |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 35 | #define POST_MAX_NUMBER 32 |
| 36 | |
| 37 | #define BOOTMODE_MAGIC 0xDEAD0000 |
| 38 | |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 39 | int post_init_f (void) |
| 40 | { |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 41 | int res = 0; |
| 42 | unsigned int i; |
| 43 | |
| 44 | for (i = 0; i < post_list_size; i++) { |
| 45 | struct post_test *test = post_list + i; |
| 46 | |
| 47 | if (test->init_f && test->init_f()) { |
| 48 | res = -1; |
| 49 | } |
| 50 | } |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 51 | |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 52 | gd->post_init_f_time = post_time_ms(0); |
| 53 | if (!gd->post_init_f_time) |
| 54 | { |
| 55 | printf("post/post.c: post_time_ms seems not to be implemented\n"); |
| 56 | } |
| 57 | |
| 58 | return res; |
| 59 | } |
| 60 | |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 61 | void post_bootmode_init (void) |
| 62 | { |
| 63 | int bootmode = post_bootmode_get (0); |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 64 | int newword; |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 65 | |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 66 | if (post_hotkeys_pressed() && !(bootmode & POST_POWERTEST)) { |
| 67 | newword = BOOTMODE_MAGIC | POST_SLOWTEST; |
wdenk | 6dff552 | 2003-07-15 07:45:49 +0000 | [diff] [blame] | 68 | } else if (bootmode == 0) { |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 69 | newword = BOOTMODE_MAGIC | POST_POWERON; |
wdenk | 6dff552 | 2003-07-15 07:45:49 +0000 | [diff] [blame] | 70 | } else if (bootmode == POST_POWERON || bootmode == POST_SLOWTEST) { |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 71 | newword = BOOTMODE_MAGIC | POST_NORMAL; |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 72 | } else { |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 73 | /* Use old value */ |
| 74 | newword = post_word_load () & ~POST_COLDBOOT; |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 75 | } |
| 76 | |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 77 | if (bootmode == 0) |
| 78 | { |
| 79 | /* We are booting after power-on */ |
| 80 | newword |= POST_COLDBOOT; |
| 81 | } |
| 82 | |
| 83 | post_word_store (newword); |
| 84 | |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 85 | /* Reset activity record */ |
| 86 | gd->post_log_word = 0; |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | int post_bootmode_get (unsigned int *last_test) |
| 90 | { |
| 91 | unsigned long word = post_word_load (); |
| 92 | int bootmode; |
| 93 | |
| 94 | if ((word & 0xFFFF0000) != BOOTMODE_MAGIC) { |
| 95 | return 0; |
| 96 | } |
| 97 | |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 98 | bootmode = word & 0x7F; |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 99 | |
| 100 | if (last_test && (bootmode & POST_POWERTEST)) { |
| 101 | *last_test = (word >> 8) & 0xFF; |
| 102 | } |
| 103 | |
| 104 | return bootmode; |
| 105 | } |
| 106 | |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 107 | /* POST tests run before relocation only mark status bits .... */ |
| 108 | static void post_log_mark_start ( unsigned long testid ) |
| 109 | { |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 110 | gd->post_log_word |= (testid)<<16; |
| 111 | } |
| 112 | |
| 113 | static void post_log_mark_succ ( unsigned long testid ) |
| 114 | { |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 115 | gd->post_log_word |= testid; |
| 116 | } |
| 117 | |
| 118 | /* ... and the messages are output once we are relocated */ |
| 119 | void post_output_backlog ( void ) |
| 120 | { |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 121 | int j; |
| 122 | |
| 123 | for (j = 0; j < post_list_size; j++) { |
| 124 | if (gd->post_log_word & (post_list[j].testid<<16)) { |
| 125 | post_log ("POST %s ", post_list[j].cmd); |
| 126 | if (gd->post_log_word & post_list[j].testid) |
| 127 | post_log ("PASSED\n"); |
wdenk | 63e73c9 | 2004-02-23 22:22:28 +0000 | [diff] [blame] | 128 | else { |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 129 | post_log ("FAILED\n"); |
Heiko Schocher | fad6340 | 2007-07-13 09:54:17 +0200 | [diff] [blame] | 130 | show_boot_progress (-31); |
wdenk | 63e73c9 | 2004-02-23 22:22:28 +0000 | [diff] [blame] | 131 | } |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 136 | static void post_bootmode_test_on (unsigned int last_test) |
| 137 | { |
| 138 | unsigned long word = post_word_load (); |
| 139 | |
| 140 | word |= POST_POWERTEST; |
| 141 | |
| 142 | word |= (last_test & 0xFF) << 8; |
| 143 | |
| 144 | post_word_store (word); |
| 145 | } |
| 146 | |
| 147 | static void post_bootmode_test_off (void) |
| 148 | { |
| 149 | unsigned long word = post_word_load (); |
| 150 | |
| 151 | word &= ~POST_POWERTEST; |
| 152 | |
| 153 | post_word_store (word); |
| 154 | } |
| 155 | |
| 156 | static void post_get_flags (int *test_flags) |
| 157 | { |
Yuri Tikhonov | e262efe | 2008-02-04 14:11:03 +0100 | [diff] [blame] | 158 | int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST, |
| 159 | POST_CRITICAL }; |
| 160 | char *var[] = { "post_poweron", "post_normal", "post_slowtest", |
| 161 | "post_critical" }; |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 162 | int varnum = sizeof (var) / sizeof (var[0]); |
| 163 | char list[128]; /* long enough for POST list */ |
| 164 | char *name; |
| 165 | char *s; |
| 166 | int last; |
| 167 | int i, j; |
| 168 | |
| 169 | for (j = 0; j < post_list_size; j++) { |
| 170 | test_flags[j] = post_list[j].flags; |
| 171 | } |
| 172 | |
| 173 | for (i = 0; i < varnum; i++) { |
| 174 | if (getenv_r (var[i], list, sizeof (list)) <= 0) |
| 175 | continue; |
| 176 | |
| 177 | for (j = 0; j < post_list_size; j++) { |
| 178 | test_flags[j] &= ~flag[i]; |
| 179 | } |
| 180 | |
| 181 | last = 0; |
| 182 | name = list; |
| 183 | while (!last) { |
| 184 | while (*name && *name == ' ') |
| 185 | name++; |
| 186 | if (*name == 0) |
| 187 | break; |
| 188 | s = name + 1; |
| 189 | while (*s && *s != ' ') |
| 190 | s++; |
| 191 | if (*s == 0) |
| 192 | last = 1; |
| 193 | else |
| 194 | *s = 0; |
| 195 | |
| 196 | for (j = 0; j < post_list_size; j++) { |
| 197 | if (strcmp (post_list[j].cmd, name) == 0) { |
| 198 | test_flags[j] |= flag[i]; |
| 199 | break; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | if (j == post_list_size) { |
| 204 | printf ("No such test: %s\n", name); |
| 205 | } |
| 206 | |
| 207 | name = s + 1; |
| 208 | } |
| 209 | } |
wdenk | 6dff552 | 2003-07-15 07:45:49 +0000 | [diff] [blame] | 210 | |
| 211 | for (j = 0; j < post_list_size; j++) { |
| 212 | if (test_flags[j] & POST_POWERON) { |
| 213 | test_flags[j] |= POST_SLOWTEST; |
| 214 | } |
| 215 | } |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | static int post_run_single (struct post_test *test, |
| 219 | int test_flags, int flags, unsigned int i) |
| 220 | { |
| 221 | if ((flags & test_flags & POST_ALWAYS) && |
| 222 | (flags & test_flags & POST_MEM)) { |
| 223 | WATCHDOG_RESET (); |
| 224 | |
| 225 | if (!(flags & POST_REBOOT)) { |
| 226 | if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) { |
Yuri Tikhonov | e262efe | 2008-02-04 14:11:03 +0100 | [diff] [blame] | 227 | post_bootmode_test_on ( |
| 228 | (gd->flags & GD_FLG_POSTFAIL) ? |
| 229 | POST_FAIL_SAVE | i : i); |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 230 | } |
| 231 | |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 232 | if (test_flags & POST_PREREL) |
| 233 | post_log_mark_start ( test->testid ); |
| 234 | else |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 235 | post_log ("POST %s ", test->cmd); |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 236 | } |
| 237 | |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 238 | if (test_flags & POST_PREREL) { |
| 239 | if ((*test->test) (flags) == 0) |
| 240 | post_log_mark_succ ( test->testid ); |
Yuri Tikhonov | 28a3850 | 2008-05-08 15:45:26 +0200 | [diff] [blame] | 241 | else { |
| 242 | if (test_flags & POST_CRITICAL) |
| 243 | gd->flags |= GD_FLG_POSTFAIL; |
| 244 | if (test_flags & POST_STOP) |
| 245 | gd->flags |= GD_FLG_POSTSTOP; |
| 246 | } |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 247 | } else { |
wdenk | 63e73c9 | 2004-02-23 22:22:28 +0000 | [diff] [blame] | 248 | if ((*test->test) (flags) != 0) { |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 249 | post_log ("FAILED\n"); |
Heiko Schocher | fad6340 | 2007-07-13 09:54:17 +0200 | [diff] [blame] | 250 | show_boot_progress (-32); |
Yuri Tikhonov | e262efe | 2008-02-04 14:11:03 +0100 | [diff] [blame] | 251 | if (test_flags & POST_CRITICAL) |
| 252 | gd->flags |= GD_FLG_POSTFAIL; |
Yuri Tikhonov | 28a3850 | 2008-05-08 15:45:26 +0200 | [diff] [blame] | 253 | if (test_flags & POST_STOP) |
| 254 | gd->flags |= GD_FLG_POSTSTOP; |
wdenk | 63e73c9 | 2004-02-23 22:22:28 +0000 | [diff] [blame] | 255 | } |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 256 | else |
| 257 | post_log ("PASSED\n"); |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 258 | } |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 259 | |
| 260 | if ((test_flags & POST_REBOOT) && !(flags & POST_MANUAL)) { |
| 261 | post_bootmode_test_off (); |
| 262 | } |
| 263 | |
| 264 | return 0; |
| 265 | } else { |
| 266 | return -1; |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | int post_run (char *name, int flags) |
| 271 | { |
| 272 | unsigned int i; |
| 273 | int test_flags[POST_MAX_NUMBER]; |
| 274 | |
| 275 | post_get_flags (test_flags); |
| 276 | |
| 277 | if (name == NULL) { |
| 278 | unsigned int last; |
| 279 | |
Yuri Tikhonov | 28a3850 | 2008-05-08 15:45:26 +0200 | [diff] [blame] | 280 | if (gd->flags & GD_FLG_POSTSTOP) |
| 281 | return 0; |
| 282 | |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 283 | if (post_bootmode_get (&last) & POST_POWERTEST) { |
Yuri Tikhonov | e262efe | 2008-02-04 14:11:03 +0100 | [diff] [blame] | 284 | if (last & POST_FAIL_SAVE) { |
| 285 | last &= ~POST_FAIL_SAVE; |
| 286 | gd->flags |= GD_FLG_POSTFAIL; |
| 287 | } |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 288 | if (last < post_list_size && |
| 289 | (flags & test_flags[last] & POST_ALWAYS) && |
| 290 | (flags & test_flags[last] & POST_MEM)) { |
| 291 | |
wdenk | ea909b7 | 2002-11-21 23:11:29 +0000 | [diff] [blame] | 292 | post_run_single (post_list + last, |
| 293 | test_flags[last], |
| 294 | flags | POST_REBOOT, last); |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 295 | |
| 296 | for (i = last + 1; i < post_list_size; i++) { |
Yuri Tikhonov | 28a3850 | 2008-05-08 15:45:26 +0200 | [diff] [blame] | 297 | if (gd->flags & GD_FLG_POSTSTOP) |
| 298 | break; |
wdenk | ea909b7 | 2002-11-21 23:11:29 +0000 | [diff] [blame] | 299 | post_run_single (post_list + i, |
| 300 | test_flags[i], |
| 301 | flags, i); |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 302 | } |
| 303 | } |
| 304 | } else { |
| 305 | for (i = 0; i < post_list_size; i++) { |
Yuri Tikhonov | 28a3850 | 2008-05-08 15:45:26 +0200 | [diff] [blame] | 306 | if (gd->flags & GD_FLG_POSTSTOP) |
| 307 | break; |
wdenk | ea909b7 | 2002-11-21 23:11:29 +0000 | [diff] [blame] | 308 | post_run_single (post_list + i, |
| 309 | test_flags[i], |
| 310 | flags, i); |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 311 | } |
| 312 | } |
| 313 | |
| 314 | return 0; |
| 315 | } else { |
| 316 | for (i = 0; i < post_list_size; i++) { |
| 317 | if (strcmp (post_list[i].cmd, name) == 0) |
| 318 | break; |
| 319 | } |
| 320 | |
| 321 | if (i < post_list_size) { |
Sascha Laue | 5744ddc | 2008-05-30 09:48:14 +0200 | [diff] [blame^] | 322 | WATCHDOG_RESET(); |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 323 | return post_run_single (post_list + i, |
| 324 | test_flags[i], |
| 325 | flags, i); |
| 326 | } else { |
| 327 | return -1; |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | static int post_info_single (struct post_test *test, int full) |
| 333 | { |
| 334 | if (test->flags & POST_MANUAL) { |
| 335 | if (full) |
| 336 | printf ("%s - %s\n" |
| 337 | " %s\n", test->cmd, test->name, test->desc); |
| 338 | else |
| 339 | printf (" %-15s - %s\n", test->cmd, test->name); |
| 340 | |
| 341 | return 0; |
| 342 | } else { |
| 343 | return -1; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | int post_info (char *name) |
| 348 | { |
| 349 | unsigned int i; |
| 350 | |
| 351 | if (name == NULL) { |
| 352 | for (i = 0; i < post_list_size; i++) { |
| 353 | post_info_single (post_list + i, 0); |
| 354 | } |
| 355 | |
| 356 | return 0; |
| 357 | } else { |
| 358 | for (i = 0; i < post_list_size; i++) { |
| 359 | if (strcmp (post_list[i].cmd, name) == 0) |
| 360 | break; |
| 361 | } |
| 362 | |
| 363 | if (i < post_list_size) { |
| 364 | return post_info_single (post_list + i, 1); |
| 365 | } else { |
| 366 | return -1; |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | int post_log (char *format, ...) |
| 372 | { |
| 373 | va_list args; |
| 374 | uint i; |
| 375 | char printbuffer[CFG_PBSIZE]; |
| 376 | |
| 377 | va_start (args, format); |
| 378 | |
| 379 | /* For this to work, printbuffer must be larger than |
| 380 | * anything we ever want to print. |
| 381 | */ |
| 382 | i = vsprintf (printbuffer, format, args); |
| 383 | va_end (args); |
| 384 | |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 385 | #ifdef CONFIG_LOGBUFFER |
wdenk | 228f29a | 2002-12-08 09:53:23 +0000 | [diff] [blame] | 386 | /* Send to the logbuffer */ |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 387 | logbuff_log (printbuffer); |
| 388 | #else |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 389 | /* Send to the stdout file */ |
| 390 | puts (printbuffer); |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 391 | #endif |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 392 | |
| 393 | return 0; |
| 394 | } |
| 395 | |
| 396 | void post_reloc (void) |
| 397 | { |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 398 | unsigned int i; |
| 399 | |
| 400 | /* |
| 401 | * We have to relocate the test table manually |
| 402 | */ |
| 403 | for (i = 0; i < post_list_size; i++) { |
| 404 | ulong addr; |
| 405 | struct post_test *test = post_list + i; |
| 406 | |
| 407 | if (test->name) { |
| 408 | addr = (ulong) (test->name) + gd->reloc_off; |
| 409 | test->name = (char *) addr; |
| 410 | } |
| 411 | |
| 412 | if (test->cmd) { |
| 413 | addr = (ulong) (test->cmd) + gd->reloc_off; |
| 414 | test->cmd = (char *) addr; |
| 415 | } |
| 416 | |
| 417 | if (test->desc) { |
| 418 | addr = (ulong) (test->desc) + gd->reloc_off; |
| 419 | test->desc = (char *) addr; |
| 420 | } |
| 421 | |
| 422 | if (test->test) { |
| 423 | addr = (ulong) (test->test) + gd->reloc_off; |
| 424 | test->test = (int (*)(int flags)) addr; |
| 425 | } |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 426 | |
| 427 | if (test->init_f) { |
| 428 | addr = (ulong) (test->init_f) + gd->reloc_off; |
| 429 | test->init_f = (int (*)(void)) addr; |
| 430 | } |
| 431 | |
| 432 | if (test->reloc) { |
| 433 | addr = (ulong) (test->reloc) + gd->reloc_off; |
| 434 | test->reloc = (void (*)(void)) addr; |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 435 | |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 436 | test->reloc(); |
| 437 | } |
wdenk | a042ac8 | 2002-09-12 22:36:57 +0000 | [diff] [blame] | 438 | } |
| 439 | } |
| 440 | |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 441 | |
| 442 | /* |
| 443 | * Some tests (e.g. SYSMON) need the time when post_init_f started, |
| 444 | * but we cannot use get_timer() at this point. |
| 445 | * |
| 446 | * On PowerPC we implement it using the timebase register. |
| 447 | */ |
| 448 | unsigned long post_time_ms (unsigned long base) |
| 449 | { |
| 450 | #ifdef CONFIG_PPC |
Igor Lisitsin | a11e069 | 2007-03-28 19:06:19 +0400 | [diff] [blame] | 451 | return (unsigned long)(get_ticks () / (get_tbclk () / CFG_HZ)) - base; |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 452 | #else |
Wolfgang Denk | ad5bb45 | 2007-03-06 18:08:43 +0100 | [diff] [blame] | 453 | #warning "Not implemented yet" |
wdenk | 4532cb6 | 2003-04-27 22:52:51 +0000 | [diff] [blame] | 454 | return 0; /* Not implemented yet */ |
| 455 | #endif |
| 456 | } |