/*1* Copyright (C) NEC Electronics Corporation 2004-20062*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA16*/17#include <linux/kernel.h>18#include <linux/types.h>19#include <linux/string.h>20#include <asm/emma/emma2rh.h>2122const unsigned long clear = 0x20202020;2324#define LED_BASE 0xb14000382526void markeins_led_clear(void)27{28emma2rh_out32(LED_BASE, clear);29emma2rh_out32(LED_BASE + 4, clear);30}3132void markeins_led(const char *str)33{34int i;35int len = strlen(str);3637markeins_led_clear();38if (len > 8)39len = 8;4041if (emma2rh_in32(0xb0000800) & (0x1 << 18))42for (i = 0; i < len; i++)43emma2rh_out8(LED_BASE + i, str[i]);44else45for (i = 0; i < len; i++)46emma2rh_out8(LED_BASE + (i & 4) + (3 - (i & 3)),47str[i]);48}4950void markeins_led_hex(u32 val)51{52char str[10];5354sprintf(str, "%08x", val);55markeins_led(str);56}575859