Move UART support to PTY driver

Different servo interfaces inherit from pty_driver, and all of them
could potentially provide access to the UART channel available over
this driver.

This change refactors the code such that the UART support is provided
by the base class (pty_driver.py), and as such is available to all
devices deriving from it.

The configuration changes add the uart_cmd functionality for the CPU
UART port.

BUG=chromium-os:15610
TEST=manual
  . build new servod image and start it up on a servo connected to a
    Snow device running in u-boot console mode

   enter the following commands:

    $ dut-control cpu_uart_regexp:'["mmcinfo",]'
    $ dut-control  cpu_uart_cmd:help
    $ dut-control cpu_uart_regexp:'["mmcinfx",]'
    $ dut-control  cpu_uart_cmd:help
    Problem setting 'cpu_uart_cmd' to 'help' :: Timeout waiting for EC response.

   observe proper target behavior: it shows the 'help' output on the screen

  . verify that EC keys are still processed properly (the following
    test succeeds)

  $ ~/trunk/src/scripts/run_remote_tests.sh --board=link --servo --remote=192.168.1.23 \
    firmware_ECKeyboard --args='board=link'

Change-Id: I16fe0d9472dbc3c653f5c3f24eca6c665e966ea7
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42454
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
4 files changed