secureedge5410.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #define __IO_PREFIX snapgear
  14. #include <asm/io_generic.h>
  15. /*
  16. * We need to remember what was written to the ioport as some bits
  17. * are shared with other functions and you cannot read back what was
  18. * written :-|
  19. *
  20. * Bit Read Write
  21. * -----------------------------------------------
  22. * D0 DCD on ttySC1 power
  23. * D1 Reset Switch heatbeat
  24. * D2 ttySC0 CTS (7100) LAN
  25. * D3 - WAN
  26. * D4 ttySC0 DCD (7100) CONSOLE
  27. * D5 - ONLINE
  28. * D6 - VPN
  29. * D7 - DTR on ttySC1
  30. * D8 - ttySC0 RTS (7100)
  31. * D9 - ttySC0 DTR (7100)
  32. * D10 - RTC SCLK
  33. * D11 RTC DATA RTC DATA
  34. * D12 - RTS RESET
  35. */
  36. #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
  37. extern unsigned short secureedge5410_ioport;
  38. #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
  39. (secureedge5410_ioport = \
  40. ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
  41. #define SECUREEDGE_READ_IOPORT() \
  42. ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
  43. #endif /* _ASM_SH_IO_SNAPGEAR_H */