1 The U-Boot Driver Model Project
2 ===============================
5 Marek Vasut <marek.vasut@gmail.com>
11 The serial port support currently requires the driver to export the following
14 serial_putc() ...... Output a character
15 serial_puts() ...... Output string, often done using serial_putc()
16 serial_tstc() ...... Test if incoming character is in a buffer
17 serial_getc() ...... Retrieve incoming character
18 serial_setbrg() .... Configure port options
19 serial_init() ...... Initialize the hardware
21 The simpliest implementation, supporting only one port, simply defines these six
22 functions and calls them. Such calls are scattered all around U-Boot, especiall
23 serial_putc(), serial_puts(), serial_tstc() and serial_getc(). The serial_init()
24 and serial_setbrg() are often called from platform-dependent places.
26 It's important to consider current implementation of CONFIG_SERIAL_MULTI though.
27 This resides in common/serial.c and behaves as a multiplexer for serial ports.
28 This, by calling serial_assign(), allows user to switch I/O from one serial port
29 to another. Though the environmental variables "stdin", "stdout", "stderr"
30 remain set to "serial".
32 These variables are managed by the IOMUX. This resides in common/iomux.c and
33 manages all console input/output from U-Boot. For serial port, only one IOMUX is
34 always registered, called "serial" and the switching of different serial ports
35 is done by code in common/serial.c.
37 On a final note, it's important to mention function default_serial_console(),
38 which is platform specific and reports the default serial console for the
39 platform, unless proper environment variable overrides this.
44 Drivers not using CONFIG_SERIAL_MULTI already will have to be converted to
45 similar approach. The probe() function of a driver will call a function
46 registering the driver with a STDIO subsystem core, stdio_device_register().
48 The serial_init() function will now be replaced by probe() function of the
49 driver, the rest of the components of the driver will be converted to standard
50 STDIO driver calls. See [ UDM-stdio.txt ] for details.
52 The serial_setbrg() function depends on global data pointer. This is wrong,
53 since there is likely to be user willing to configure different baudrate on two
54 different serial ports. The function will be replaced with STDIO's "conf()"
55 call, with STDIO_CONFIG_SERIAL_BAUDRATE argument.
57 III) Analysis of in-tree drivers
58 --------------------------------
62 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
66 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
70 No support for CONFIG_SERIAL_MULTI. Simple conversion possible, unless used
71 with CONFIG_ARM_DCC_MULTI. Then it registers another separate IOMUX.
75 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
79 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
83 This driver seems complicated and certain consideration will need to be made
84 during conversion. This driver is implemented in very universal manner,
85 therefore it'll be necessary to properly design it's platform_data.
89 Unmaintained port. Code got removed.
93 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
97 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
101 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
105 This is a complementary part of NS16550 UART driver, see above.
107 12) serial_clps7111.c
108 ---------------------
109 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
113 No support for CONFIG_SERIAL_MULTI. Simple conversion possible. This driver
114 might be removed in favor of serial_mxc.c .
118 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
122 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
126 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
130 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
134 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
138 No support for CONFIG_SERIAL_MULTI. Simple conversion possible, though this
139 driver in fact contains two drivers in total.
143 This driver is a bit complicated, but due to clean support for
144 CONFIG_SERIAL_MULTI, there are no expected obstructions throughout the
149 This driver, being quite ad-hoc might need some work to bring back to shape.
153 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
157 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
161 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
163 25) serial_xuartlite.c
164 ----------------------
165 No support for CONFIG_SERIAL_MULTI. Simple conversion possible.
169 This driver seems very complicated and entangled with USB framework. The
170 conversion might be complicated here.
172 27) arch/powerpc/cpu/mpc512x/serial.c
173 -------------------------------------
174 This driver supports CONFIG_SERIAL_MULTI. This driver will need to be moved to