2 * arch/mips/emma2rh/markeins/led.c
3 * This file defines the led display for Mark-eins.
5 * Copyright (C) NEC Electronics Corporation 2004-2006
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <linux/kernel.h>
22 #include <linux/types.h>
23 #include <linux/string.h>
24 #include <asm/emma/emma2rh.h>
26 const unsigned long clear = 0x20202020;
28 #define LED_BASE 0xb1400038
30 void markeins_led_clear(void)
32 emma2rh_out32(LED_BASE, clear);
33 emma2rh_out32(LED_BASE + 4, clear);
36 void markeins_led(const char *str)
39 int len = strlen(str);
45 if (emma2rh_in32(0xb0000800) & (0x1 << 18))
46 for (i = 0; i < len; i++)
47 emma2rh_out8(LED_BASE + i, str[i]);
49 for (i = 0; i < len; i++)
50 emma2rh_out8(LED_BASE + (i & 4) + (3 - (i & 3)),
54 void markeins_led_hex(u32 val)
58 sprintf(str, "%08x", val);