snapgear.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * include/asm-sh/snapgear.h
  3. *
  4. * Modified version of io_se.h for the snapgear-specific functions.
  5. *
  6. * May be copied or modified under the terms of the GNU General Public
  7. * License. See linux/COPYING for more information.
  8. *
  9. * IO functions for a SnapGear
  10. */
  11. #ifndef _ASM_SH_IO_SNAPGEAR_H
  12. #define _ASM_SH_IO_SNAPGEAR_H
  13. #if defined(CONFIG_CPU_SH4)
  14. /*
  15. * The external interrupt lines, these take up ints 0 - 15 inclusive
  16. * depending on the priority for the interrupt. In fact the priority
  17. * is the interrupt :-)
  18. */
  19. #define IRL0_IRQ 2
  20. #define IRL0_PRIORITY 13
  21. #define IRL1_IRQ 5
  22. #define IRL1_PRIORITY 10
  23. #define IRL2_IRQ 8
  24. #define IRL2_PRIORITY 7
  25. #define IRL3_IRQ 11
  26. #define IRL3_PRIORITY 4
  27. #endif
  28. #define __IO_PREFIX snapgear
  29. #include <asm/io_generic.h>
  30. #ifdef CONFIG_SH_SECUREEDGE5410
  31. /*
  32. * We need to remember what was written to the ioport as some bits
  33. * are shared with other functions and you cannot read back what was
  34. * written :-|
  35. *
  36. * Bit Read Write
  37. * -----------------------------------------------
  38. * D0 DCD on ttySC1 power
  39. * D1 Reset Switch heatbeat
  40. * D2 ttySC0 CTS (7100) LAN
  41. * D3 - WAN
  42. * D4 ttySC0 DCD (7100) CONSOLE
  43. * D5 - ONLINE
  44. * D6 - VPN
  45. * D7 - DTR on ttySC1
  46. * D8 - ttySC0 RTS (7100)
  47. * D9 - ttySC0 DTR (7100)
  48. * D10 - RTC SCLK
  49. * D11 RTC DATA RTC DATA
  50. * D12 - RTS RESET
  51. */
  52. #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
  53. extern unsigned short secureedge5410_ioport;
  54. #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
  55. (secureedge5410_ioport = \
  56. ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
  57. #define SECUREEDGE_READ_IOPORT() \
  58. ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
  59. #endif
  60. #endif /* _ASM_SH_IO_SNAPGEAR_H */