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 (, and as such is available to all
devices deriving from it.

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

  . 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/ --board=link --servo --remote= \
    firmware_ECKeyboard --args='board=link'

Change-Id: I16fe0d9472dbc3c653f5c3f24eca6c665e966ea7
Signed-off-by: Vadim Bendebury <>
Reviewed-by: Tom Wai-Hong Tam <>
Reviewed-by: Vic Yang <>
Reviewed-by: Todd Broch <>
4 files changed