nettel.h 3.1 KB

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