secureedge5410.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0
  2. *
  3. * include/asm-sh/snapgear.h
  4. *
  5. * Modified version of io_se.h for the snapgear-specific functions.
  6. *
  7. * IO functions for a SnapGear
  8. */
  9. #ifndef _ASM_SH_IO_SNAPGEAR_H
  10. #define _ASM_SH_IO_SNAPGEAR_H
  11. #define __IO_PREFIX snapgear
  12. #include <asm/io_generic.h>
  13. /*
  14. * We need to remember what was written to the ioport as some bits
  15. * are shared with other functions and you cannot read back what was
  16. * written :-|
  17. *
  18. * Bit Read Write
  19. * -----------------------------------------------
  20. * D0 DCD on ttySC1 power
  21. * D1 Reset Switch heatbeat
  22. * D2 ttySC0 CTS (7100) LAN
  23. * D3 - WAN
  24. * D4 ttySC0 DCD (7100) CONSOLE
  25. * D5 - ONLINE
  26. * D6 - VPN
  27. * D7 - DTR on ttySC1
  28. * D8 - ttySC0 RTS (7100)
  29. * D9 - ttySC0 DTR (7100)
  30. * D10 - RTC SCLK
  31. * D11 RTC DATA RTC DATA
  32. * D12 - RTS RESET
  33. */
  34. #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
  35. extern unsigned short secureedge5410_ioport;
  36. #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
  37. (secureedge5410_ioport = \
  38. ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
  39. #define SECUREEDGE_READ_IOPORT() \
  40. ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
  41. #endif /* _ASM_SH_IO_SNAPGEAR_H */