nettel.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #include <asm/io.h>
  20. #endif
  21. /*---------------------------------------------------------------------------*/
  22. #if defined(CONFIG_M5307)
  23. /*
  24. * NETtel/5307 based hardware first. DTR/DCD lines are wired to
  25. * GPIO lines. Most of the LED's are driver through a latch
  26. * connected to CS2.
  27. */
  28. #define MCFPP_DCD1 0x0001
  29. #define MCFPP_DCD0 0x0002
  30. #define MCFPP_DTR1 0x0004
  31. #define MCFPP_DTR0 0x0008
  32. #define NETtel_LEDADDR 0x30400000
  33. #ifndef __ASSEMBLY__
  34. extern volatile unsigned short ppdata;
  35. /*
  36. * These functions defined to give quasi generic access to the
  37. * PPIO bits used for DTR/DCD.
  38. */
  39. static __inline__ unsigned int mcf_getppdata(void)
  40. {
  41. volatile unsigned short *pp;
  42. pp = (volatile unsigned short *) MCFSIM_PADAT;
  43. return((unsigned int) *pp);
  44. }
  45. static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
  46. {
  47. volatile unsigned short *pp;
  48. pp = (volatile unsigned short *) MCFSIM_PADAT;
  49. ppdata = (ppdata & ~mask) | bits;
  50. *pp = ppdata;
  51. }
  52. #endif
  53. /*---------------------------------------------------------------------------*/
  54. #elif defined(CONFIG_M5206e)
  55. /*
  56. * NETtel/5206e based hardware has leds on latch on CS3.
  57. * No support modem for lines??
  58. */
  59. #define NETtel_LEDADDR 0x50000000
  60. /*---------------------------------------------------------------------------*/
  61. #elif defined(CONFIG_M5272)
  62. /*
  63. * NETtel/5272 based hardware. DTR/DCD lines are wired to GPB lines.
  64. */
  65. #define MCFPP_DCD0 0x0080
  66. #define MCFPP_DCD1 0x0000 /* Port 1 no DCD support */
  67. #define MCFPP_DTR0 0x0040
  68. #define MCFPP_DTR1 0x0000 /* Port 1 no DTR support */
  69. #ifndef __ASSEMBLY__
  70. /*
  71. * These functions defined to give quasi generic access to the
  72. * PPIO bits used for DTR/DCD.
  73. */
  74. static __inline__ unsigned int mcf_getppdata(void)
  75. {
  76. return readw(MCFSIM_PBDAT);
  77. }
  78. static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
  79. {
  80. writew((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT);
  81. }
  82. #endif
  83. #endif
  84. /*---------------------------------------------------------------------------*/
  85. /****************************************************************************/
  86. #endif /* CONFIG_NETtel */
  87. /****************************************************************************/
  88. #endif /* nettel_h */