blob: 5f2c5a3d40ae45c84617e7313d68576be7890b94 [file] [log] [blame]
Tomáš Hlaváčekbfae89a2012-08-08 13:42:30 +02001==================================
2TWserial device subsystem analysis
3==================================
4
5Tomas Hlavacek<tmshlvck@gmail.com>
62012-03-21
7
8I) Overview
9-----------
10
11U-Boot currently implements one common API for TWSerial devices. The interface
12is defined in include/tws.h and comprises of functions:
13
14 int tws_read(uchar *buffer, int len);
15 int tws_write(uchar *buffer, int len);
16
17The functions are implemented by a proper device driver in drivers/twserial
18directory and the driver to be compiled in is selected in a Makefile. There is
19only one driver present now.
20
21The driver depends on ad-hoc code in board specific data, namely functions:
22
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);
29
30implemented in include/configs/inka4x0.h .
31
32II) Approach
33------------
34
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.
38
39
40III) Analysis of in-tree drivers
41--------------------------------
42
Masahiro Yamada566c6e42013-09-24 10:32:04 +090043 drivers/twserial/soft_tws.c
44 ---------------------------
Tomáš Hlaváčekbfae89a2012-08-08 13:42:30 +020045 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/ .