Path: blob/master/arch/mips/mti-malta/malta-display.c
10818 views
/*1* Carsten Langgaard, [email protected]2* Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.3*4* This program is free software; you can distribute it and/or modify it5* under the terms of the GNU General Public License (Version 2) as6* published by the Free Software Foundation.7*8* This program is distributed in the hope it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* for more details.12*13* You should have received a copy of the GNU General Public License along14* with this program; if not, write to the Free Software Foundation, Inc.,15* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.16*17* Display routines for display messages in MIPS boards ascii display.18*/1920#include <linux/compiler.h>21#include <linux/timer.h>22#include <asm/io.h>23#include <asm/mips-boards/generic.h>24#include <asm/mips-boards/prom.h>2526extern const char display_string[];27static unsigned int display_count;28static unsigned int max_display_count;2930void mips_display_message(const char *str)31{32static unsigned int __iomem *display = NULL;33int i;3435if (unlikely(display == NULL))36display = ioremap(ASCII_DISPLAY_POS_BASE, 16*sizeof(int));3738for (i = 0; i <= 14; i=i+2) {39if (*str)40__raw_writel(*str++, display + i);41else42__raw_writel(' ', display + i);43}44}4546static void scroll_display_message(unsigned long data);47static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0);4849static void scroll_display_message(unsigned long data)50{51mips_display_message(&display_string[display_count++]);52if (display_count == max_display_count)53display_count = 0;5455mod_timer(&mips_scroll_timer, jiffies + HZ);56}5758void mips_scroll_message(void)59{60del_timer_sync(&mips_scroll_timer);61max_display_count = strlen(display_string) + 1 - 8;62mod_timer(&mips_scroll_timer, jiffies + 1);63}646566