leds.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef _ASM_UNIT_LEDS_H
  12. #define _ASM_UNIT_LEDS_H
  13. #include <asm/pio-regs.h>
  14. #include <asm/cpu-regs.h>
  15. #include <asm/exceptions.h>
  16. #define MN10300_USE_7SEGLEDS 0
  17. #define ASB2364_7SEGLEDS __SYSREG(0xA9001630, u32)
  18. /*
  19. * use the 7-segment LEDs to indicate states
  20. */
  21. #if MN10300_USE_7SEGLEDS
  22. /* flip the 7-segment LEDs between "Gdb-" and "----" */
  23. #define mn10300_set_gdbleds(ONOFF) \
  24. do { \
  25. ASB2364_7SEGLEDS = (ONOFF) ? 0x8543077f : 0x7f7f7f7f; \
  26. } while (0)
  27. #else
  28. #define mn10300_set_gdbleds(ONOFF) do {} while (0)
  29. #endif
  30. #if MN10300_USE_7SEGLEDS
  31. /* indicate double-fault by displaying "db-f" on the LEDs */
  32. #define mn10300_set_dbfleds \
  33. mov 0x43077f1d,d0 ; \
  34. mov d0,(ASB2364_7SEGLEDS)
  35. #else
  36. #define mn10300_set_dbfleds
  37. #endif
  38. #ifndef __ASSEMBLY__
  39. extern void peripheral_leds_display_exception(enum exception_code);
  40. extern void peripheral_leds_led_chase(void);
  41. extern void peripheral_leds7x4_display_dec(unsigned int, unsigned int);
  42. extern void peripheral_leds7x4_display_hex(unsigned int, unsigned int);
  43. extern void debug_to_serial(const char *, int);
  44. #endif /* __ASSEMBLY__ */
  45. #endif /* _ASM_UNIT_LEDS_H */