nettel.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /****************************************************************************/
  3. /*
  4. * nettel.h -- Lineo (formerly Moreton Bay) NETtel support.
  5. *
  6. * (C) Copyright 1999-2000, Moreton Bay (www.moretonbay.com)
  7. * (C) Copyright 2000-2001, Lineo Inc. (www.lineo.com)
  8. * (C) Copyright 2001-2002, SnapGear Inc., (www.snapgear.com)
  9. */
  10. /****************************************************************************/
  11. #ifndef nettel_h
  12. #define nettel_h
  13. /****************************************************************************/
  14. /****************************************************************************/
  15. #ifdef CONFIG_NETtel
  16. /****************************************************************************/
  17. #ifdef CONFIG_COLDFIRE
  18. #include <asm/coldfire.h>
  19. #include <asm/mcfsim.h>
  20. #include <asm/io.h>
  21. #endif
  22. /*---------------------------------------------------------------------------*/
  23. #if defined(CONFIG_M5307)
  24. /*
  25. * NETtel/5307 based hardware first. DTR/DCD lines are wired to
  26. * GPIO lines. Most of the LED's are driver through a latch
  27. * connected to CS2.
  28. */
  29. #define MCFPP_DCD1 0x0001
  30. #define MCFPP_DCD0 0x0002
  31. #define MCFPP_DTR1 0x0004
  32. #define MCFPP_DTR0 0x0008
  33. #define NETtel_LEDADDR 0x30400000
  34. #ifndef __ASSEMBLY__
  35. extern volatile unsigned short ppdata;
  36. /*
  37. * These functions defined to give quasi generic access to the
  38. * PPIO bits used for DTR/DCD.
  39. */
  40. static __inline__ unsigned int mcf_getppdata(void)
  41. {
  42. volatile unsigned short *pp;
  43. pp = (volatile unsigned short *) MCFSIM_PADAT;
  44. return((unsigned int) *pp);
  45. }
  46. static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
  47. {
  48. volatile unsigned short *pp;
  49. pp = (volatile unsigned short *) MCFSIM_PADAT;
  50. ppdata = (ppdata & ~mask) | bits;
  51. *pp = ppdata;
  52. }
  53. #endif
  54. /*---------------------------------------------------------------------------*/
  55. #elif defined(CONFIG_M5206e)
  56. /*
  57. * NETtel/5206e based hardware has leds on latch on CS3.
  58. * No support modem for lines??
  59. */
  60. #define NETtel_LEDADDR 0x50000000
  61. /*---------------------------------------------------------------------------*/
  62. #elif defined(CONFIG_M5272)
  63. /*
  64. * NETtel/5272 based hardware. DTR/DCD lines are wired to GPB lines.
  65. */
  66. #define MCFPP_DCD0 0x0080
  67. #define MCFPP_DCD1 0x0000 /* Port 1 no DCD support */
  68. #define MCFPP_DTR0 0x0040
  69. #define MCFPP_DTR1 0x0000 /* Port 1 no DTR support */
  70. #ifndef __ASSEMBLY__
  71. /*
  72. * These functions defined to give quasi generic access to the
  73. * PPIO bits used for DTR/DCD.
  74. */
  75. static __inline__ unsigned int mcf_getppdata(void)
  76. {
  77. return readw(MCFSIM_PBDAT);
  78. }
  79. static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
  80. {
  81. writew((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT);
  82. }
  83. #endif
  84. #endif
  85. /*---------------------------------------------------------------------------*/
  86. /****************************************************************************/
  87. #endif /* CONFIG_NETtel */
  88. /****************************************************************************/
  89. #endif /* nettel_h */