UDM-twserial.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ==================================
  2. TWserial device subsystem analysis
  3. ==================================
  4. Tomas Hlavacek<tmshlvck@gmail.com>
  5. 2012-03-21
  6. I) Overview
  7. -----------
  8. U-Boot currently implements one common API for TWSerial devices. The interface
  9. is defined in include/tws.h and comprises of functions:
  10. int tws_read(uchar *buffer, int len);
  11. int tws_write(uchar *buffer, int len);
  12. The functions are implemented by a proper device driver in drivers/twserial
  13. directory and the driver to be compiled in is selected in a Makefile. There is
  14. only one driver present now.
  15. The driver depends on ad-hoc code in board specific data, namely functions:
  16. void tws_ce(unsigned bit);
  17. void tws_wr(unsigned bit);
  18. void tws_clk(unsigned bit);
  19. void tws_data(unsigned bit);
  20. unsigned tws_data_read(void);
  21. void tws_data_config_output(unsigned output);
  22. implemented in include/configs/inka4x0.h .
  23. II) Approach
  24. ------------
  25. U-Boot TWserial drivers exports two simple functions and therefore the conversion
  26. of the driver and creating a core for it is not needed. It should be consolidated
  27. with include/configs/inka4x0.h and taken to the misc/ dir.
  28. III) Analysis of in-tree drivers
  29. --------------------------------
  30. 1) drivers/twserial/soft_tws.c
  31. ------------------------------
  32. The driver is the only TWserial driver. The ad-hoc part in
  33. include/configs/inka4x0.h and the core soft_tws driver should be consolidated
  34. to one compact driver and moved to misc/ .