Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[pandora-kernel.git] / arch / mn10300 / unit-asb2364 / include / unit / leds.h
1 /* Unit-specific leds
2  *
3  * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells (dhowells@redhat.com)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version
9  * 2 of the License, or (at your option) any later version.
10  */
11
12 #ifndef _ASM_UNIT_LEDS_H
13 #define _ASM_UNIT_LEDS_H
14
15 #include <asm/pio-regs.h>
16 #include <asm/cpu-regs.h>
17 #include <asm/exceptions.h>
18
19 #define MN10300_USE_7SEGLEDS    0
20
21 #define ASB2364_7SEGLEDS        __SYSREG(0xA9001630, u32)
22
23 /*
24  * use the 7-segment LEDs to indicate states
25  */
26
27 #if MN10300_USE_7SEGLEDS
28 /* flip the 7-segment LEDs between "Gdb-" and "----" */
29 #define mn10300_set_gdbleds(ONOFF)                                      \
30         do {                                                            \
31                 ASB2364_7SEGLEDS = (ONOFF) ? 0x8543077f : 0x7f7f7f7f;   \
32         } while (0)
33 #else
34 #define mn10300_set_gdbleds(ONOFF) do {} while (0)
35 #endif
36
37 #if MN10300_USE_7SEGLEDS
38 /* indicate double-fault by displaying "db-f" on the LEDs */
39 #define mn10300_set_dbfleds                     \
40         mov     0x43077f1d,d0           ;       \
41         mov     d0,(ASB2364_7SEGLEDS)
42 #else
43 #define mn10300_set_dbfleds
44 #endif
45
46 #ifndef __ASSEMBLY__
47 extern void peripheral_leds_display_exception(enum exception_code);
48 extern void peripheral_leds_led_chase(void);
49 extern void peripheral_leds7x4_display_dec(unsigned int, unsigned int);
50 extern void peripheral_leds7x4_display_hex(unsigned int, unsigned int);
51 extern void debug_to_serial(const char *, int);
52 #endif /* __ASSEMBLY__ */
53
54 #endif /* _ASM_UNIT_LEDS_H */