leds.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #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 ASB2303_GPIO0DEF __SYSREG(0xDB000000, u32)
  17. #define ASB2303_7SEGLEDS __SYSREG(0xDB000008, u32)
  18. /*
  19. * use the 7-segment LEDs to indicate states
  20. */
  21. /* flip the 7-segment LEDs between "G" and "-" */
  22. #define mn10300_set_gdbleds(ONOFF) \
  23. do { \
  24. ASB2303_7SEGLEDS = (ONOFF) ? 0x85 : 0x7f; \
  25. } while (0)
  26. /* indicate double-fault by displaying "d" on the LEDs */
  27. #define mn10300_set_dbfleds \
  28. mov 0x43,d0 ; \
  29. movbu d0,(ASB2303_7SEGLEDS)
  30. #ifndef __ASSEMBLY__
  31. extern void peripheral_leds_display_exception(enum exception_code code);
  32. extern void peripheral_leds_led_chase(void);
  33. extern void debug_to_serial(const char *p, int n);
  34. #endif /* __ASSEMBLY__ */
  35. #endif /* _ASM_UNIT_LEDS_H */