dm355evm_msp.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * dm355evm_msp.h - support MSP430 microcontroller on DM355EVM board
  3. */
  4. #ifndef __LINUX_I2C_DM355EVM_MSP
  5. #define __LINUX_I2C_DM355EVM_MSP
  6. /*
  7. * Written against Spectrum's writeup for the A4 firmware revision,
  8. * and tweaked to match source and rev D2 schematics by removing CPLD
  9. * and NOR flash hooks (which were last appropriate in rev B boards).
  10. *
  11. * Note that the firmware supports a flavor of write posting ... to be
  12. * sure a write completes, issue another read or write.
  13. */
  14. /* utilities to access "registers" emulated by msp430 firmware */
  15. extern int dm355evm_msp_write(u8 value, u8 reg);
  16. extern int dm355evm_msp_read(u8 reg);
  17. /* command/control registers */
  18. #define DM355EVM_MSP_COMMAND 0x00
  19. # define MSP_COMMAND_NULL 0
  20. # define MSP_COMMAND_RESET_COLD 1
  21. # define MSP_COMMAND_RESET_WARM 2
  22. # define MSP_COMMAND_RESET_WARM_I 3
  23. # define MSP_COMMAND_POWEROFF 4
  24. # define MSP_COMMAND_IR_REINIT 5
  25. #define DM355EVM_MSP_STATUS 0x01
  26. # define MSP_STATUS_BAD_OFFSET BIT(0)
  27. # define MSP_STATUS_BAD_COMMAND BIT(1)
  28. # define MSP_STATUS_POWER_ERROR BIT(2)
  29. # define MSP_STATUS_RXBUF_OVERRUN BIT(3)
  30. #define DM355EVM_MSP_RESET 0x02 /* 0 bits == in reset */
  31. # define MSP_RESET_DC5 BIT(0)
  32. # define MSP_RESET_TVP5154 BIT(2)
  33. # define MSP_RESET_IMAGER BIT(3)
  34. # define MSP_RESET_ETHERNET BIT(4)
  35. # define MSP_RESET_SYS BIT(5)
  36. # define MSP_RESET_AIC33 BIT(7)
  37. /* GPIO registers ... bit patterns mostly match the source MSP ports */
  38. #define DM355EVM_MSP_LED 0x03 /* active low (MSP P4) */
  39. #define DM355EVM_MSP_SWITCH1 0x04 /* (MSP P5, masked) */
  40. # define MSP_SWITCH1_SW6_1 BIT(0)
  41. # define MSP_SWITCH1_SW6_2 BIT(1)
  42. # define MSP_SWITCH1_SW6_3 BIT(2)
  43. # define MSP_SWITCH1_SW6_4 BIT(3)
  44. # define MSP_SWITCH1_J1 BIT(4) /* NTSC/PAL */
  45. # define MSP_SWITCH1_MSP_INT BIT(5) /* active low */
  46. #define DM355EVM_MSP_SWITCH2 0x05 /* (MSP P6, masked) */
  47. # define MSP_SWITCH2_SW10 BIT(3)
  48. # define MSP_SWITCH2_SW11 BIT(4)
  49. # define MSP_SWITCH2_SW12 BIT(5)
  50. # define MSP_SWITCH2_SW13 BIT(6)
  51. # define MSP_SWITCH2_SW14 BIT(7)
  52. #define DM355EVM_MSP_SDMMC 0x06 /* (MSP P2, masked) */
  53. # define MSP_SDMMC_0_WP BIT(1)
  54. # define MSP_SDMMC_0_CD BIT(2) /* active low */
  55. # define MSP_SDMMC_1_WP BIT(3)
  56. # define MSP_SDMMC_1_CD BIT(4) /* active low */
  57. #define DM355EVM_MSP_FIRMREV 0x07 /* not a GPIO (out of order) */
  58. #define DM355EVM_MSP_VIDEO_IN 0x08 /* (MSP P3, masked) */
  59. # define MSP_VIDEO_IMAGER BIT(7) /* low == tvp5146 */
  60. /* power supply registers are currently omitted */
  61. /* RTC registers */
  62. #define DM355EVM_MSP_RTC_0 0x12 /* LSB */
  63. #define DM355EVM_MSP_RTC_1 0x13
  64. #define DM355EVM_MSP_RTC_2 0x14
  65. #define DM355EVM_MSP_RTC_3 0x15 /* MSB */
  66. /* input event queue registers; code == ((HIGH << 8) | LOW) */
  67. #define DM355EVM_MSP_INPUT_COUNT 0x16 /* decrement by reading LOW */
  68. #define DM355EVM_MSP_INPUT_HIGH 0x17
  69. #define DM355EVM_MSP_INPUT_LOW 0x18
  70. #endif /* __LINUX_I2C_DM355EVM_MSP */