Merge branch 'master' into for-linus
[pandora-kernel.git] / arch / mn10300 / unit-asb2303 / include / unit / leds.h
1 /* ASB2303-specific LEDs
2  *
3  * Copyright (C) 2007 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 Licence
8  * as published by the Free Software Foundation; either version
9  * 2 of the Licence, 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 ASB2303_GPIO0DEF        __SYSREG(0xDB000000, u32)
20 #define ASB2303_7SEGLEDS        __SYSREG(0xDB000008, u32)
21
22 /*
23  * use the 7-segment LEDs to indicate states
24  */
25
26 /* flip the 7-segment LEDs between "G" and "-" */
27 #define mn10300_set_gdbleds(ONOFF)                      \
28 do {                                                    \
29         ASB2303_7SEGLEDS = (ONOFF) ? 0x85 : 0x7f;       \
30 } while (0)
31
32 /* indicate double-fault by displaying "d" on the LEDs */
33 #define mn10300_set_dbfleds                     \
34         mov     0x43,d0                 ;       \
35         movbu   d0,(ASB2303_7SEGLEDS)
36
37 #ifndef __ASSEMBLY__
38 extern void peripheral_leds_display_exception(enum exception_code code);
39 extern void peripheral_leds_led_chase(void);
40 extern void debug_to_serial(const char *p, int n);
41 #endif /* __ASSEMBLY__ */
42
43 #endif /* _ASM_UNIT_LEDS_H */