David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 1 | /* ASB2305-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 ASB2305_7SEGLEDS __SYSREG(0xA6F90000, u32) |
| 20 | |
| 21 | /* perform a hard reset by driving PIO06 low */ |
| 22 | #define mn10300_unit_hard_reset() \ |
| 23 | do { \ |
| 24 | P0OUT &= 0xbf; \ |
| 25 | P0MD = (P0MD & P0MD_6) | P0MD_6_OUT; \ |
| 26 | } while (0) |
| 27 | |
| 28 | /* |
| 29 | * use the 7-segment LEDs to indicate states |
| 30 | */ |
| 31 | /* indicate double-fault by displaying "db-f" on the LEDs */ |
| 32 | #define mn10300_set_dbfleds \ |
| 33 | mov 0x43077f1d,d0 ; \ |
| 34 | mov d0,(ASB2305_7SEGLEDS) |
| 35 | |
| 36 | /* flip the 7-segment LEDs between "Gdb-" and "----" */ |
| 37 | #define mn10300_set_gdbleds(ONOFF) \ |
| 38 | do { \ |
| 39 | ASB2305_7SEGLEDS = (ONOFF) ? 0x8543077f : 0x7f7f7f7f; \ |
| 40 | } while (0) |
| 41 | |
| 42 | #ifndef __ASSEMBLY__ |
| 43 | extern void peripheral_leds_display_exception(enum exception_code); |
| 44 | extern void peripheral_leds_led_chase(void); |
| 45 | extern void peripheral_leds7x4_display_dec(unsigned int, unsigned int); |
| 46 | extern void peripheral_leds7x4_display_hex(unsigned int, unsigned int); |
| 47 | extern void peripheral_leds7x4_display_minssecs(unsigned int, unsigned int); |
| 48 | extern void peripheral_leds7x4_display_rtc(void); |
| 49 | #endif /* __ASSEMBLY__ */ |
| 50 | |
| 51 | #endif /* _ASM_UNIT_LEDS_H */ |