diff options
Diffstat (limited to 'arch/ppc64/kernel/pSeries_setup.c')
-rw-r--r-- | arch/ppc64/kernel/pSeries_setup.c | 103 |
1 files changed, 1 insertions, 102 deletions
diff --git a/arch/ppc64/kernel/pSeries_setup.c b/arch/ppc64/kernel/pSeries_setup.c index c5f3ccac7cd1..41e6de2c9158 100644 --- a/arch/ppc64/kernel/pSeries_setup.c +++ b/arch/ppc64/kernel/pSeries_setup.c | |||
@@ -375,107 +375,6 @@ static void __init pSeries_init_early(void) | |||
375 | } | 375 | } |
376 | 376 | ||
377 | 377 | ||
378 | static void pSeries_progress(char *s, unsigned short hex) | ||
379 | { | ||
380 | struct device_node *root; | ||
381 | int width, *p; | ||
382 | char *os; | ||
383 | static int display_character, set_indicator; | ||
384 | static int max_width; | ||
385 | static DEFINE_SPINLOCK(progress_lock); | ||
386 | static int pending_newline = 0; /* did last write end with unprinted newline? */ | ||
387 | |||
388 | if (!rtas.base) | ||
389 | return; | ||
390 | |||
391 | if (max_width == 0) { | ||
392 | if ((root = find_path_device("/rtas")) && | ||
393 | (p = (unsigned int *)get_property(root, | ||
394 | "ibm,display-line-length", | ||
395 | NULL))) | ||
396 | max_width = *p; | ||
397 | else | ||
398 | max_width = 0x10; | ||
399 | display_character = rtas_token("display-character"); | ||
400 | set_indicator = rtas_token("set-indicator"); | ||
401 | } | ||
402 | |||
403 | if (display_character == RTAS_UNKNOWN_SERVICE) { | ||
404 | /* use hex display if available */ | ||
405 | if (set_indicator != RTAS_UNKNOWN_SERVICE) | ||
406 | rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex); | ||
407 | return; | ||
408 | } | ||
409 | |||
410 | spin_lock(&progress_lock); | ||
411 | |||
412 | /* | ||
413 | * Last write ended with newline, but we didn't print it since | ||
414 | * it would just clear the bottom line of output. Print it now | ||
415 | * instead. | ||
416 | * | ||
417 | * If no newline is pending, print a CR to start output at the | ||
418 | * beginning of the line. | ||
419 | */ | ||
420 | if (pending_newline) { | ||
421 | rtas_call(display_character, 1, 1, NULL, '\r'); | ||
422 | rtas_call(display_character, 1, 1, NULL, '\n'); | ||
423 | pending_newline = 0; | ||
424 | } else { | ||
425 | rtas_call(display_character, 1, 1, NULL, '\r'); | ||
426 | } | ||
427 | |||
428 | width = max_width; | ||
429 | os = s; | ||
430 | while (*os) { | ||
431 | if (*os == '\n' || *os == '\r') { | ||
432 | /* Blank to end of line. */ | ||
433 | while (width-- > 0) | ||
434 | rtas_call(display_character, 1, 1, NULL, ' '); | ||
435 | |||
436 | /* If newline is the last character, save it | ||
437 | * until next call to avoid bumping up the | ||
438 | * display output. | ||
439 | */ | ||
440 | if (*os == '\n' && !os[1]) { | ||
441 | pending_newline = 1; | ||
442 | spin_unlock(&progress_lock); | ||
443 | return; | ||
444 | } | ||
445 | |||
446 | /* RTAS wants CR-LF, not just LF */ | ||
447 | |||
448 | if (*os == '\n') { | ||
449 | rtas_call(display_character, 1, 1, NULL, '\r'); | ||
450 | rtas_call(display_character, 1, 1, NULL, '\n'); | ||
451 | } else { | ||
452 | /* CR might be used to re-draw a line, so we'll | ||
453 | * leave it alone and not add LF. | ||
454 | */ | ||
455 | rtas_call(display_character, 1, 1, NULL, *os); | ||
456 | } | ||
457 | |||
458 | width = max_width; | ||
459 | } else { | ||
460 | width--; | ||
461 | rtas_call(display_character, 1, 1, NULL, *os); | ||
462 | } | ||
463 | |||
464 | os++; | ||
465 | |||
466 | /* if we overwrite the screen length */ | ||
467 | if (width <= 0) | ||
468 | while ((*os != 0) && (*os != '\n') && (*os != '\r')) | ||
469 | os++; | ||
470 | } | ||
471 | |||
472 | /* Blank to end of line. */ | ||
473 | while (width-- > 0) | ||
474 | rtas_call(display_character, 1, 1, NULL, ' '); | ||
475 | |||
476 | spin_unlock(&progress_lock); | ||
477 | } | ||
478 | |||
479 | static int pSeries_check_legacy_ioport(unsigned int baseport) | 378 | static int pSeries_check_legacy_ioport(unsigned int baseport) |
480 | { | 379 | { |
481 | struct device_node *np; | 380 | struct device_node *np; |
@@ -535,7 +434,7 @@ struct machdep_calls __initdata pSeries_md = { | |||
535 | .get_rtc_time = rtas_get_rtc_time, | 434 | .get_rtc_time = rtas_get_rtc_time, |
536 | .set_rtc_time = rtas_set_rtc_time, | 435 | .set_rtc_time = rtas_set_rtc_time, |
537 | .calibrate_decr = generic_calibrate_decr, | 436 | .calibrate_decr = generic_calibrate_decr, |
538 | .progress = pSeries_progress, | 437 | .progress = rtas_progress, |
539 | .check_legacy_ioport = pSeries_check_legacy_ioport, | 438 | .check_legacy_ioport = pSeries_check_legacy_ioport, |
540 | .system_reset_exception = pSeries_system_reset_exception, | 439 | .system_reset_exception = pSeries_system_reset_exception, |
541 | .machine_check_exception = pSeries_machine_check_exception, | 440 | .machine_check_exception = pSeries_machine_check_exception, |