mcfmbus.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /****************************************************************************/
  2. /*
  3. * mcfmbus.h -- Coldfire MBUS support defines.
  4. *
  5. * (C) Copyright 1999, Martin Floeer (mfloeer@axcent.de)
  6. */
  7. /****************************************************************************/
  8. #ifndef mcfmbus_h
  9. #define mcfmbus_h
  10. #define MCFMBUS_BASE 0x280
  11. #define MCFMBUS_IRQ_VECTOR 0x19
  12. #define MCFMBUS_IRQ 0x1
  13. #define MCFMBUS_CLK 0x3f
  14. #define MCFMBUS_IRQ_LEVEL 0x07 /*IRQ Level 1*/
  15. #define MCFMBUS_ADDRESS 0x01
  16. /*
  17. * Define the 5307 MBUS register set addresses
  18. */
  19. #define MCFMBUS_MADR 0x00
  20. #define MCFMBUS_MFDR 0x04
  21. #define MCFMBUS_MBCR 0x08
  22. #define MCFMBUS_MBSR 0x0C
  23. #define MCFMBUS_MBDR 0x10
  24. #define MCFMBUS_MADR_ADDR(a) (((a)&0x7F)<<0x01) /*Slave Address*/
  25. #define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/
  26. /*
  27. * Define bit flags in Control Register
  28. */
  29. #define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */
  30. #define MCFMBUS_MBCR_MIEN (0x40) /* M-Bus Interrupt Enable */
  31. #define MCFMBUS_MBCR_MSTA (0x20) /* Master/Slave Mode Select Bit */
  32. #define MCFMBUS_MBCR_MTX (0x10) /* Transmit/Rcv Mode Select Bit */
  33. #define MCFMBUS_MBCR_TXAK (0x08) /* Transmit Acknowledge Enable */
  34. #define MCFMBUS_MBCR_RSTA (0x04) /* Repeat Start */
  35. /*
  36. * Define bit flags in Status Register
  37. */
  38. #define MCFMBUS_MBSR_MCF (0x80) /* Data Transfer Complete */
  39. #define MCFMBUS_MBSR_MAAS (0x40) /* Addressed as a Slave */
  40. #define MCFMBUS_MBSR_MBB (0x20) /* Bus Busy */
  41. #define MCFMBUS_MBSR_MAL (0x10) /* Arbitration Lost */
  42. #define MCFMBUS_MBSR_SRW (0x04) /* Slave Transmit */
  43. #define MCFMBUS_MBSR_MIF (0x02) /* M-Bus Interrupt */
  44. #define MCFMBUS_MBSR_RXAK (0x01) /* No Acknowledge Received */
  45. /*
  46. * Define bit flags in DATA I/O Register
  47. */
  48. #define MCFMBUS_MBDR_READ (0x01) /* 1=read 0=write MBUS */
  49. #define MBUSIOCSCLOCK 1
  50. #define MBUSIOCGCLOCK 2
  51. #define MBUSIOCSADDR 3
  52. #define MBUSIOCGADDR 4
  53. #define MBUSIOCSSLADDR 5
  54. #define MBUSIOCGSLADDR 6
  55. #define MBUSIOCSSUBADDR 7
  56. #define MBUSIOCGSUBADDR 8
  57. #endif