mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-14 17:07:38 +00:00
566c6e4370
Everytime a dead driver is removed from the list, we must re-number. This is a painful task. Try git showe53232250
-- doc/driver-model/UDM-serial.txt git show6f62f4207
-- doc/driver-model/UDM-serial.txt git showb9f4bc34a
-- doc/driver-model/UDM-serial.txt to see what I mean. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
47 lines
1.5 KiB
Text
47 lines
1.5 KiB
Text
==================================
|
|
TWserial device subsystem analysis
|
|
==================================
|
|
|
|
Tomas Hlavacek<tmshlvck@gmail.com>
|
|
2012-03-21
|
|
|
|
I) Overview
|
|
-----------
|
|
|
|
U-Boot currently implements one common API for TWSerial devices. The interface
|
|
is defined in include/tws.h and comprises of functions:
|
|
|
|
int tws_read(uchar *buffer, int len);
|
|
int tws_write(uchar *buffer, int len);
|
|
|
|
The functions are implemented by a proper device driver in drivers/twserial
|
|
directory and the driver to be compiled in is selected in a Makefile. There is
|
|
only one driver present now.
|
|
|
|
The driver depends on ad-hoc code in board specific data, namely functions:
|
|
|
|
void tws_ce(unsigned bit);
|
|
void tws_wr(unsigned bit);
|
|
void tws_clk(unsigned bit);
|
|
void tws_data(unsigned bit);
|
|
unsigned tws_data_read(void);
|
|
void tws_data_config_output(unsigned output);
|
|
|
|
implemented in include/configs/inka4x0.h .
|
|
|
|
II) Approach
|
|
------------
|
|
|
|
U-Boot TWserial drivers exports two simple functions and therefore the conversion
|
|
of the driver and creating a core for it is not needed. It should be consolidated
|
|
with include/configs/inka4x0.h and taken to the misc/ dir.
|
|
|
|
|
|
III) Analysis of in-tree drivers
|
|
--------------------------------
|
|
|
|
drivers/twserial/soft_tws.c
|
|
---------------------------
|
|
The driver is the only TWserial driver. The ad-hoc part in
|
|
include/configs/inka4x0.h and the core soft_tws driver should be consolidated
|
|
to one compact driver and moved to misc/ .
|