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