]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
serial: implement common uart post test
authorMike Frysinger <vapier@gentoo.org>
Sat, 14 May 2011 06:56:15 +0000 (06:56 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 26 Jul 2011 14:39:03 +0000 (16:39 +0200)
commit7b826c2f3510eaf185c7b4b0d709b9e766831bd6
treec4ce1e32b13bb7fb0095004db23602e8a9b2be85
parent1c9a5606d8ff0c664c9e83de38e93d5602312d79
serial: implement common uart post test

The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data.  If we ignore
the loop back part, the rest can be built upon the existing common serial
API.  So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it.  This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over.  So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
common/serial.c
include/serial.h