2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Display routines for display messages in MIPS boards ascii display.
8 * Copyright (C) 1999,2000,2012 MIPS Technologies, Inc.
10 * Authors: Carsten Langgaard <carstenl@mips.com>
11 * Steven J. Hill <sjhill@mips.com>
13 #include <linux/compiler.h>
14 #include <linux/timer.h>
17 #include <asm/mips-boards/generic.h>
19 extern const char display_string
[];
20 static unsigned int display_count
;
21 static unsigned int max_display_count
;
23 void mips_display_message(const char *str
)
25 static unsigned int __iomem
*display
= NULL
;
28 if (unlikely(display
== NULL
))
29 display
= ioremap(ASCII_DISPLAY_POS_BASE
, 16*sizeof(int));
31 for (i
= 0; i
<= 14; i
+= 2) {
33 __raw_writel(*str
++, display
+ i
);
35 __raw_writel(' ', display
+ i
);
39 static void scroll_display_message(struct timer_list
*unused
);
40 static DEFINE_TIMER(mips_scroll_timer
, scroll_display_message
);
42 static void scroll_display_message(struct timer_list
*unused
)
44 mips_display_message(&display_string
[display_count
++]);
45 if (display_count
== max_display_count
)
48 mod_timer(&mips_scroll_timer
, jiffies
+ HZ
);
51 void mips_scroll_message(void)
53 del_timer_sync(&mips_scroll_timer
);
54 max_display_count
= strlen(display_string
) + 1 - 8;
55 mod_timer(&mips_scroll_timer
, jiffies
+ 1);