~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/mti-sead3/sead3-display.c

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  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
  4  * for more details.
  5  *
  6  * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
  7  */
  8 #include <linux/timer.h>
  9 #include <linux/io.h>
 10 #include <asm/mips-boards/generic.h>
 11 
 12 static unsigned int display_count;
 13 static unsigned int max_display_count;
 14 
 15 #define LCD_DISPLAY_POS_BASE            0x1f000400
 16 #define DISPLAY_LCDINSTRUCTION          (0*2)
 17 #define DISPLAY_LCDDATA                 (1*2)
 18 #define DISPLAY_CPLDSTATUS              (2*2)
 19 #define DISPLAY_CPLDDATA                (3*2)
 20 #define LCD_SETDDRAM                    0x80
 21 #define LCD_IR_BF                       0x80
 22 
 23 const char display_string[] = "               LINUX ON SEAD3               ";
 24 
 25 static void scroll_display_message(unsigned long data);
 26 static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0);
 27 
 28 static void lcd_wait(unsigned int __iomem *display)
 29 {
 30         /* Wait for CPLD state machine to become idle. */
 31         do { } while (__raw_readl(display + DISPLAY_CPLDSTATUS) & 1);
 32 
 33         do {
 34                 __raw_readl(display + DISPLAY_LCDINSTRUCTION);
 35 
 36                 /* Wait for CPLD state machine to become idle. */
 37                 do { } while (__raw_readl(display + DISPLAY_CPLDSTATUS) & 1);
 38         } while (__raw_readl(display + DISPLAY_CPLDDATA) & LCD_IR_BF);
 39 }
 40 
 41 void mips_display_message(const char *str)
 42 {
 43         static unsigned int __iomem *display;
 44         char ch;
 45         int i;
 46 
 47         if (unlikely(display == NULL))
 48                 display = ioremap_nocache(LCD_DISPLAY_POS_BASE,
 49                         (8 * sizeof(int)));
 50 
 51         for (i = 0; i < 16; i++) {
 52                 if (*str)
 53                         ch = *str++;
 54                 else
 55                         ch = ' ';
 56                 lcd_wait(display);
 57                 __raw_writel((LCD_SETDDRAM | i),
 58                         (display + DISPLAY_LCDINSTRUCTION));
 59                 lcd_wait(display);
 60                 __raw_writel(ch, display + DISPLAY_LCDDATA);
 61         }
 62 }
 63 
 64 static void scroll_display_message(unsigned long data)
 65 {
 66         mips_display_message(&display_string[display_count++]);
 67         if (display_count == max_display_count)
 68                 display_count = 0;
 69         mod_timer(&mips_scroll_timer, jiffies + HZ);
 70 }
 71 
 72 void mips_scroll_message(void)
 73 {
 74         del_timer_sync(&mips_scroll_timer);
 75         max_display_count = strlen(display_string) + 1 - 16;
 76         mod_timer(&mips_scroll_timer, jiffies + 1);
 77 }
 78 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp