snapgear.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_IPR_POS 3
  21. #define IRL0_PRIORITY 13
  22. #define IRL1_IRQ 5
  23. #define IRL1_IPR_POS 2
  24. #define IRL1_PRIORITY 10
  25. #define IRL2_IRQ 8
  26. #define IRL2_IPR_POS 1
  27. #define IRL2_PRIORITY 7
  28. #define IRL3_IRQ 11
  29. #define IRL3_IPR_POS 0
  30. #define IRL3_PRIORITY 4
  31. #endif
  32. #define __IO_PREFIX snapgear
  33. #include <asm/io_generic.h>
  34. #ifdef CONFIG_SH_SECUREEDGE5410
  35. /*
  36. * We need to remember what was written to the ioport as some bits
  37. * are shared with other functions and you cannot read back what was
  38. * written :-|
  39. *
  40. * Bit Read Write
  41. * -----------------------------------------------
  42. * D0 DCD on ttySC1 power
  43. * D1 Reset Switch heatbeat
  44. * D2 ttySC0 CTS (7100) LAN
  45. * D3 - WAN
  46. * D4 ttySC0 DCD (7100) CONSOLE
  47. * D5 - ONLINE
  48. * D6 - VPN
  49. * D7 - DTR on ttySC1
  50. * D8 - ttySC0 RTS (7100)
  51. * D9 - ttySC0 DTR (7100)
  52. * D10 - RTC SCLK
  53. * D11 RTC DATA RTC DATA
  54. * D12 - RTS RESET
  55. */
  56. #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
  57. extern unsigned short secureedge5410_ioport;
  58. #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
  59. (secureedge5410_ioport = \
  60. ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
  61. #define SECUREEDGE_READ_IOPORT() \
  62. ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
  63. #endif
  64. #endif /* _ASM_SH_IO_SNAPGEAR_H */