chromiumos/third_party/hdctools.git
11 months agoWolf: Add servo overlay. 01/66201/2 master
Dave Parker [Mon, 19 Aug 2013 15:50:27 +0000 (08:50 -0700)]
Wolf: Add servo overlay.

Add servo overlay for wolf platform.

TEST=Confirm success of firmware_FAFTSetup on wolf.
BUG=None

Change-Id: I4e4e84cf70dbde642dbf85f7acd69cc78909bf48
Reviewed-on: https://gerrit.chromium.org/gerrit/66201
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
11 months agoservo: ec: Modify limit_channel to use new EC commands. 40/65340/3
Shawn Nematbakhsh [Fri, 9 Aug 2013 18:26:08 +0000 (11:26 -0700)]
servo: ec: Modify limit_channel to use new EC commands.

limit_channel, the function to limit the output of the EC console, was
previously not reliable because it first parsed EC console output to
determine the active channel mask. New EC commands have now been added,
so saving + restoring the channel mask no longer requires parsing. This
should fix sporadic failures on several EC FAFT tests.

BUG=chrome-os-partner:269758.
TEST=Pass all ec_faft tests on Peppy.

Change-Id: I866f775db8e6885e53c90c4c13a61369e8c02465
Reviewed-on: https://gerrit.chromium.org/gerrit/65340
Reviewed-by: Yusuf Mohsinally <mohsinally@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
11 months agoServo V3: Add version specific interface to params 69/64969/3 release-R30-4537.B
Simran Basi [Wed, 7 Aug 2013 18:54:50 +0000 (11:54 -0700)]
Servo V3: Add version specific interface to params

This change allows params to specify an interface depending on servo
versions. This is required by servoflex_v2_r0_p50 as the pca9534
chip is on a separate i2c bus than the other gpio expanders.

BUG=chromium:268611
TEST=local setup with spring. Tested toggling spi2_buf_on_flex_en.
Ensured servo_v2 still works.

CQ-DEPEND=If4c77c7c654ef1b2ecb39e720b2b6d5a7cb9a41c
Change-Id: Ic6d706b73ade074bb597a40c8c5df62dc2eaa99f
Reviewed-on: https://gerrit.chromium.org/gerrit/64969
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
11 months agoServo V3: Pipe servo board version to servo_server 35/64835/3
Simran Basi [Tue, 6 Aug 2013 21:59:10 +0000 (14:59 -0700)]
Servo V3: Pipe servo board version to servo_server

Refactored parts of servo initialization in order to allow the servo
server to know the servo board version.

This changes also allow xmlrpclib users the ability to determine the
servo board they are using. This is necessary for FAFT tests on V3 as
it has different configs to allow firmware flashing.

BUG=chromium:268534
TEST=local setup, using xmlrpclib, called server.get_version()

Change-Id: If4c77c7c654ef1b2ecb39e720b2b6d5a7cb9a41c
Reviewed-on: https://gerrit.chromium.org/gerrit/64835
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
11 months agoServo V3: Remap fw_wp to gpio. 03/64803/4 stabilize-4512.B
Simran Basi [Tue, 6 Aug 2013 18:55:00 +0000 (11:55 -0700)]
Servo V3: Remap fw_wp to gpio.

fw_wp is no longer controlled via i2c rather it is now a gpio: gpio2_2.

However gpio2_2 is not properly labelled in the omap_muxes. So it's
muxfile needs to be hard-coded rather than found automatically. This
change allows muxfile to be properly piped into the gpio wr_rd function.

BUG=chromium:268611
TEST=dut-control with link at desk. FAFT test failed before to set fw_wp
and now the test works and passes.

Change-Id: Id8b233bd2a317eef19805273058c75c1ee78750b
Reviewed-on: https://gerrit.chromium.org/gerrit/64803
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>

11 months agoServo V3: Use I2C-2 by default. 11/63311/2
Simran Basi [Thu, 25 Jul 2013 02:11:21 +0000 (19:11 -0700)]
Servo V3: Use I2C-2 by default.

Now that we have a working kernel/image that uses I2C-2, use it by
default.

BUG=chromium:245362
TEST=Can access servo I2C through I2C-2 port without jumpers.

Change-Id: I04321b43d85e0e66f769b8a9b7aa2b3c8d6447df
Reviewed-on: https://gerrit.chromium.org/gerrit/63311
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>

11 months agoServo V3: Fix error message formatting. 83/64383/2
Simran Basi [Fri, 2 Aug 2013 21:11:32 +0000 (14:11 -0700)]
Servo V3: Fix error message formatting.

Used incorrect formatting when creating bb_i2c.

BUG=None
TEST=None

Change-Id: Ib918d0c9c3d3b0b4ae582ceedbc1e6ddb3b01aa0
Reviewed-on: https://gerrit.chromium.org/gerrit/64383
Reviewed-by: Fang Deng <fdeng@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>

12 months agoServo V3: Add Init Values to GPIO's 80/63280/3 factory-4455.B factory-pit-4471.B firmware-pit-4482.B
Simran Basi [Wed, 24 Jul 2013 23:51:22 +0000 (16:51 -0700)]
Servo V3: Add Init Values to GPIO's

Noticed that initial values of GPIO's could vary each beaglebone boot,
servod initialization, or by device and setup. To prevent this, we
now force initialize them on servod startup.

Also for V3, the map for usbkey is swapped so over-rode the mapping.

BUG=None
TEST=Using local AFE launched platform_InstallTestImage before the
patch which failed and then succeeded with this patch.

Change-Id: I9cd5618410ba8b2d0889261d2e878749c9256fcd
Reviewed-on: https://gerrit.chromium.org/gerrit/63280
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
12 months agoDo not proceed if board XML file is not found 37/62737/6
Vadim Bendebury [Fri, 19 Jul 2013 22:27:40 +0000 (15:27 -0700)]
Do not proceed if board XML file is not found

With boards multiplying faster than XML files for them, it is better
to be safe than sorry, and stop if the requested board is not found.

A typical problem with continuing is when servod is invoked by
run_remote_tests.sh for pit. servod happily starts even though board
file for pit does not exist, leaving the operator puzzled and confused
(she should have started servod first passing --board=spring).

A board file for pit will be created shortly.

BUG=chrome-os-partner:21116,chromium:263104
TEST=manual
   $ sudo servod --board=peach_pix
   2013-07-24 10:35:06,309 - servod - INFO - Start
   getString params:
           index: 3
           len: 128
           langid: -1
   2013-07-24 10:35:06,312 - servod - INFO - Found servo, vid: 0x18d1 pid: 0x5002 sid: 868534-00014
   getString params:
           index: 3
           len: 128
           langid: -1
   2013-07-24 10:35:06,314 - servod - ERROR - No XML overlay for board peach_pix

Change-Id: I1d80b538870a1e0ad28b594dd111d6fe16e552ae
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62737

12 months agoservod: stout: Add board overlay. 54/63054/3
Todd Broch [Tue, 23 Jul 2013 17:29:13 +0000 (10:29 -0700)]
servod: stout: Add board overlay.

BUG=chromium:263104
TEST=manual

1. sudo emerge hdctools
2. connect servo to mimic flex
3. sudo servod -b stout
   - Starts successfully
   - see stdout Loading XML config /usr/lib64/python2.7/site-packages/servo/data/servo_stout_overlay.xml

Change-Id: I06fa643379e7406605912de156273ccbc56bab0e
Reviewed-on: https://gerrit.chromium.org/gerrit/63054
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
12 months agoAdd board file for peach_pit 60/62760/3 stabilize-4443.B
Vadim Bendebury [Fri, 19 Jul 2013 23:56:47 +0000 (16:56 -0700)]
Add board file for peach_pit

This adds a softlink to servo/data/servo_spring_overlay.xml, as as of
now spring and pit use exactly the same XML files.

Should these platforms deviate, a separate pit xml file could be
introduced.

BUG=chrome-os-partner:21116
TEST=manual
   sudo servod --board=peach_pit
   does not complain about the missing data file anymore.

Change-Id: Ifcbe01317ecbde725b1c71fa09a6a245207b1135
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62760

12 months agoSupport rec_mode for ARM platforms 08/61808/6
Vadim Bendebury [Fri, 12 Jul 2013 23:44:27 +0000 (16:44 -0700)]
Support rec_mode for ARM platforms

Current ARM platform's (spring and pit) recovery mode is controlled by
the EC. This change introduces an ARM ec driver to allow setting
recovery mode on/off on spring and pit.

BRANCH=none
BUG=chrome-os-partner:20138
TEST=manual
  . run 'dut-control rec_mode:{on|off}'
    observe bit 0x4000 toggled in the hostevent output on the DUT's ec
    console and 'dut-control rec_mode' returning the set value.

Change-Id: I52688415b44c7f56b874594dc59d974a3aea2353
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61808

12 months agoSort arm ec controls and driver modules in alphanumerically 07/61807/2
Vadim Bendebury [Fri, 12 Jul 2013 00:44:10 +0000 (17:44 -0700)]
Sort arm ec controls and driver modules in alphanumerically

This is a no-op change rearranging controls and imports for easier
maintenance.

BUG=None
TEST=manual
  . the following command returns the same md5 sum before and after the change:

   $  sort servo/data/arm_ec_common.xml servo/drv/__init__.py | md5sum
   b51db13711178748118d7ea5b910b269  -

Change-Id: I58aabbe0080c82cb552fb6810e2eabe6256395c2
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61807
Reviewed-by: Todd Broch <tbroch@chromium.org>
12 months agoServo: Fix clobber_ok usage. 30/61330/3 factory-pit-4390.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B
Simran Basi [Tue, 9 Jul 2013 21:49:27 +0000 (14:49 -0700)]
Servo: Fix clobber_ok usage.

Clobber_ok allows us to overload signals from different overlays,
i.e. a board may have certain signals other boards will not.

Currently however if a board tries to clobber a signal that does not
exist for all boards then adding of the signal fails. This change
instead only replaces the signal if it already exists and if not
just treats it as a regular new signal.

BUG=chromium:248685
TEST=Ran locally and ensured that clobbering an unexistant signal
now works.

Change-Id: I5f2763531e88253b4cb1e7843c28107648fc9704
Reviewed-on: https://gerrit.chromium.org/gerrit/61330
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
12 months agoservod: peppy: Add ADCs for power measurement. 84/60884/2
Dave Parker [Wed, 3 Jul 2013 17:32:46 +0000 (10:32 -0700)]
servod: peppy: Add ADCs for power measurement.

BUG=none
TEST=manual
1. Emerge it
cros_workon --host start hdctools
sudo emerge hdctools

2. launch servod on servo V1 & swing the mux to the adcs
sudo servod -c peppy.xml
dut-control i2c_mux:loc0

3.  Take measurments
peppy_mv=`dut-control -i | grep _mv | cut -d' ' -f1`
peppy_ma=`dut-control -i | grep _ma | cut -d' ' -f1`
peppy_mw=`dut-control -i | grep _mw | cut -d' ' -f1`
dut-control $peppy_mv
dut-control $peppy_ma
dut-control $peppy_mw

Values read make sense.

Change-Id: Ib7925fb0424d12843087f529eeeb0c5d11164311
Reviewed-on: https://gerrit.chromium.org/gerrit/60884
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
Commit-Queue: Dave Parker <dparker@chromium.org>

13 months ago[hdctools] power cycle USB when switching usb_mux_sel1 and restore power state. 55/59355/7 release-R29-4319.B
Fang Deng [Mon, 3 Jun 2013 22:51:48 +0000 (15:51 -0700)]
[hdctools] power cycle USB when switching usb_mux_sel1 and restore power state.

This CL includes the following changes to
servo/servo_server.py:probe_host_usb_dev.

1. Power cycle the USB stick when switching 'usb_mux_sel1', because the USB
sometimes got wedged when the USB power is on.

2. Record the initial state of prtctl4_pwren and restore it at the end of
the function.

Hopefully, this can fix, or at least reduce, the occurrence of issue 225932.

BUG=chromium:225932
TEST=Test the repair flow from four initial USB mux states
usb_mux_sel1:dut_sees_usbkey prtctl4_pwren:on
usb_mux_sel1:servo_sees_usbkey prtctl4_pwren:on
usb_mux_sel1:dut_sees_usbkey prtctl4_pwren:off
usb_mux_sel1:servo_sees_usbkey prtctl4_pwren:off

Confirm that after each case, the repair job succeeds
and 'dut-control prtctl4_pwren' reports 'prtctl4_pwren:off'

Change-Id: Id9590d4d7a6e9677f27ff5c47a4c09e089b597c5
Reviewed-on: https://gerrit.chromium.org/gerrit/59355
Commit-Queue: Fang Deng <fdeng@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
13 months agoservod: falco: Add ADCs for power measurement. 47/59647/3
Sameer Nanda [Fri, 21 Jun 2013 23:40:27 +0000 (16:40 -0700)]
servod: falco: Add ADCs for power measurement.

BUG=none
TEST=manual
1. Emerge it
sudo emerge hdctools

2. launch servod on servo V1 & swing the mux to the adcs
sudo servod -c falco.xml
dut-control i2c_mux:loc0

3.  Take measurments
falco_mv=`dut-control -i | grep _mv | cut -d' ' -f1`
falco_ma=`dut-control -i | grep _ma | cut -d' ' -f1`
falco_mw=`dut-control -i | grep _mw | cut -d' ' -f1`
dut-control $falco_mv
dut-control $falco_ma
dut-control $falco_mw

Values read make sense.

Change-Id: I3b264ac4dacc1d627824716a1308f19c8b051948
Reviewed-on: https://gerrit.chromium.org/gerrit/59647
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Sameer Nanda <snanda@chromium.org>

13 months agoExcept the EOF exception when flushing PTY 03/59403/2
Tom Wai-Hong Tam [Thu, 20 Jun 2013 09:24:46 +0000 (17:24 +0800)]
Except the EOF exception when flushing PTY

When flushing PTY, we send an empty line and catch the results such that
the result buffer becomes empty. If timeout and EOF exceptions raise, just
ignore them.

BUG=chrome-os-partner:19720
TEST=None, trivial change

Change-Id: Iaef692d7ffccb47d8d214a42d8e3010cb76c5b33
Reviewed-on: https://gerrit.chromium.org/gerrit/59403
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Tom Wai-Hong Tam <waihong@chromium.org>

13 months agopeppy: Add servo overlay. 85/59485/2
Shawn Nematbakhsh [Thu, 20 Jun 2013 22:01:07 +0000 (15:01 -0700)]
peppy: Add servo overlay.

Add servo overlay for peppy platform.

TEST=Confirm success of firmware_FAFTSetup on peppy.
BUG=chrome-os-partner:20363.

Change-Id: I46fe798e1317d9212ff82018aa91fc97928edc13
Reviewed-on: https://gerrit.chromium.org/gerrit/59485
Reviewed-by: Yusuf Mohsinally <mohsinally@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
13 months agoServo V3: Autodetect Servo V3 boards. 54/59454/2
Simran Basi [Thu, 20 Jun 2013 19:20:16 +0000 (12:20 -0700)]
Servo V3: Autodetect Servo V3 boards.

As part of running Servo V3 in the labs, we want servod to be able
to autodetect the V3 board and launch the correct config file for
this specific board.

This change adds the necessary values to the configuration dictionaries
to make this possible.

BUG=chromium:252379
TEST=ran sudo servod without supplying a config and it launched
successfully.

Change-Id: Ia86fbb30c6966d121db0941ec80f18bceb6d2b05
Reviewed-on: https://gerrit.chromium.org/gerrit/59454
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
13 months agoServo V3: Implement Beaglebone Uart 69/57269/6
Simran Basi [Fri, 31 May 2013 22:12:15 +0000 (15:12 -0700)]
Servo V3: Implement Beaglebone Uart

This change implements Servo V3 Uart support through the beaglebone's
UART interfaces.

BUG=chromium:187492
TEST=Ensure that values retrieved by dut-control over UART are correctly
retrieved. Ensured Servo V2 support has not broken. Used cros_write_firmware
running on host against servod running on beaglebone worked for both V2 &
V3. Unit tests.

Change-Id: I88a90803b44b62d631c4b4d0c4dd112ae7e6759c
Reviewed-on: https://gerrit.chromium.org/gerrit/57269
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
13 months agoAdding falco servo overlay. 78/58878/2 factory-4290.B stabilize-4287.B
Gediminas Ramanauskas [Mon, 17 Jun 2013 17:33:51 +0000 (10:33 -0700)]
Adding falco servo overlay.

BUG=chrome-os-partner:20239
TEST=servod -b falco allows to flash firmware using servo

Change-Id: If9d9effd97280323bc545e594283fb8bc56c1d9b
Reviewed-on: https://gerrit.chromium.org/gerrit/58878
Reviewed-by: Jay Kim <yongjaek@chromium.org>
Commit-Queue: Gediminas Ramanauskas <gedis@chromium.org>
Tested-by: Gediminas Ramanauskas <gedis@chromium.org>
13 months agoRefactoring common x86 Chrome EC code to its own xml. 69/57469/3 factory-pit-4280.B
Gediminas Ramanauskas [Mon, 3 Jun 2013 21:30:29 +0000 (14:30 -0700)]
Refactoring common x86 Chrome EC code to its own xml.
Adding FAFT support for Slippy.

BUG=chrome-os-partner:19704
TEST=Basic FAFT tests work on Slippy (firmware_TryFwB, etc)

Change-Id: I92654ba1912942ec737b2b8799b13670e7f98f38
Reviewed-on: https://gerrit.chromium.org/gerrit/57469
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Gediminas Ramanauskas <gedis@chromium.org>
Commit-Queue: Gediminas Ramanauskas <gedis@chromium.org>

13 months agoFix handling of shell special characters in beaglebone/deploy. 83/57183/3 factory-spring-4262.B stabilize-4255.B
J. Richard Barnette [Fri, 31 May 2013 00:51:49 +0000 (17:51 -0700)]
Fix handling of shell special characters in beaglebone/deploy.

If the commit log message at HEAD included certain shell special
characters like " or $, the beaglebone/deploy script would create
an /etc/default/servod file that would blow up when starting servod.

This change fixes the deploy script to properly quote special
characters in the commit message.

BUG=chromium:236532
TEST=deploy a commit with this change and special characters in the commit message

Change-Id: I5cb58f12c76afec7a56745d6e97fbb13a2b89662
Reviewed-on: https://gerrit.chromium.org/gerrit/57183
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>

14 months agoEnable UART capturing on EC interface 62/55762/5
Tom Wai-Hong Tam [Mon, 20 May 2013 15:05:01 +0000 (23:05 +0800)]
Enable UART capturing on EC interface

We want to enable the UART capturing on EC interface such that we can record
the UART output for the debug purpose.

BUG=chrome-os-partner:19288
TEST=Manaul
On Link, set 'dut-control ec_uart_capture:on'
and check 'dut-control ec_uart_stream' output the EC UART results.
More complete tests refer to the FAFT change.

Change-Id: I9f4b9a409d1763eae99b9507384d2ab6516fb99f
Reviewed-on: https://gerrit.chromium.org/gerrit/55762
Reviewed-by: Yusuf Mohsinally <mohsinally@chromium.org>
Commit-Queue: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
14 months agoServo V3: Implement Beaglebone GPIO. 71/49671/12
Simran Basi [Fri, 17 May 2013 00:08:47 +0000 (17:08 -0700)]
Servo V3: Implement Beaglebone GPIO.

Implemented bb_gpio so that we can control the beaglebone's gpio
pins and the cooresponding servo lines.

BUG=chromium:187488
TEST=ensure I can use the USB ports and switch between connecting
them to the DUT and the beaglebone. And did simple V2 commands to
ensure it still worked.

CQ-DEPEND=I227a08d3788d099ce489adf52cb130007f02159f

Change-Id: Ia5f4163048ee90efd35c4476ecebc1d592eeb610
Reviewed-on: https://gerrit.chromium.org/gerrit/49671
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>

14 months agoservod: Add sid for next batch of servo V2 02/56202/2
Todd Broch [Wed, 22 May 2013 14:56:32 +0000 (07:56 -0700)]
servod: Add sid for next batch of servo V2

BUG=none
TEST=manual,

1. Connect single servo V2 w/ sid 868534 to host and launch servod
sudo servod

See log output:
2013-05-22 07:58:23,643 - servod - INFO - Found servo, vid: 0x18d1 pid: 0x5002 sid: 868534-00069
2013-05-22 07:58:23,646 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/servo_v2_r1.xml
2013-05-22 07:58:23,648 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/servo_v2_r0.xml
2013-05-22 07:58:23,661 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/common.xml

Note its picking 'v2_r1' which is the correct <version>_<revision>

Change-Id: I80b5901a4e5f19fba918c542f5c9a43c3ad3a82f
Reviewed-on: https://gerrit.chromium.org/gerrit/56202
Reviewed-by: David Chang <davidchang@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
14 months agoservod: Add servo V3 GPIO controls. 33/49133/3
Simran Basi [Thu, 25 Apr 2013 01:12:35 +0000 (18:12 -0700)]
servod: Add servo V3 GPIO controls.

CL creates controls for devices on servo V3 which will be controlled
via the beaglebone's GPIO controller.
Future CLs should add native controls for UART.

BUG=chromium:187488
TEST=manual

Change-Id: I227a08d3788d099ce489adf52cb130007f02159f
Reviewed-on: https://gerrit.chromium.org/gerrit/49133
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
14 months agoUse list to store kbd_en and kbd_mx_ax states 39/56139/2
Vic Yang [Wed, 22 May 2013 03:54:24 +0000 (11:54 +0800)]
Use list to store kbd_en and kbd_mx_ax states

Currently we store these values in a dictionary with keys of string
type. This is slow when servod runs on Beaglebone. Let's use list
instead so we only need one dictionary lookup and avoid string
composition.

BUG=chrome-os-partner:19320
TEST=Pass firmware_FAFTSetup.

Change-Id: Ie87e5bfa30691680dc64e45f924cec0bba08533c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56139
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
14 months agohdctools: servod: Add jtag1800_external 93/47193/4
Doug Anderson [Tue, 2 Apr 2013 22:57:44 +0000 (15:57 -0700)]
hdctools: servod: Add jtag1800_external

This can be used to start servod with external JTAG enabled at 1.8V.
Requires servo v2_r1 which is a servo board with "Rev : 04" markings
on it.

BUG=chrome-os-partner:18540
TEST=Start servod before this change and then run:
  dut-control --port=8889 | grep -i jtag
...see:
  jtag_buf_en:off
  jtag_buf_on_flex_en:on
  jtag_vref_sel0:off
  jtag_vref_sel1:off
...after this change, start servod with '-c jtag1800_external.xml' and
then run:
  dut-control --port=8889 | grep -i jtag
...see:
  jtag_buf_en:off
  jtag_buf_on_flex_en:on
  jtag_vref_sel0:pp3300
  jtag_vref_sel1:off
TEST=Start servod with '-c jtag1800_external.xml' and can run trace32
with JTAG plugged into servo.

Change-Id: I1ab047b15e6628f87bca15834aea7ed4a17e53ae
Reviewed-on: https://gerrit.chromium.org/gerrit/47193
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
14 months agoSet debug output for servod on beaglebones. 81/51081/3 factory-spring-4131.B
Yusuf Mohsinally [Tue, 14 May 2013 01:50:44 +0000 (18:50 -0700)]
Set debug output for servod on beaglebones.

Start servod on beaglebones with --debug enabled.

BUG=chrome-os-partner:19377
TEST=None

Change-Id: Id09de988d50a6455572eb4e73a61139949e5be35
Reviewed-on: https://gerrit.chromium.org/gerrit/51081
Commit-Queue: Yusuf Mohsinally <mohsinally@google.com>
Tested-by: Yusuf Mohsinally <mohsinally@google.com>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
14 months agoAdd slippy board file for servod config 31/50931/3 factory-4128.B
Jay Kim [Sat, 11 May 2013 06:09:12 +0000 (23:09 -0700)]
Add slippy board file for servod config

BUG=None
TEST=sudo servod -b slippy &

Change-Id: I66a04b6787d07b633e31457b4434e5dbf58d971b
Reviewed-on: https://gerrit.chromium.org/gerrit/50931
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Jay Kim <yongjaek@chromium.org>
Tested-by: Jay Kim <yongjaek@chromium.org>
14 months agoDo not fail servod if the default port is not available 74/49374/4
Vadim Bendebury [Fri, 26 Apr 2013 22:28:55 +0000 (15:28 -0700)]
Do not fail servod if the default port is not available

When starting servod, it is convenient to let the program find the
port to use if the default port is not available and the operator did
not pick a specific port.

This is especially handy when multiple servod instances need to be run.

Let the default port numbers be in the 9990..9999 range. For backwards
compatibility start with 9999 and check ports down from there (so that
port numbers stay 4 digits in size).

BUG=none
TEST=manual
  . started two servod instances without specifying the port in the
    command line, saw both start smoothly, on ports 9999 and 9998
    respectively.

  . start one servo instance (see it use port 9999 by default) and
    then try starting another one with '--port=9999' in the command
    line.

   Observe it terminate with:
   "2013-04-29 10:30:21,538 - servod - CRITICAL - Port 9999 is busy"

Change-Id: I976191bb7aeee05984ed6cb5585c92d8dbac18a6
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49374
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
14 months agoservod: pit: Add ADCs for power measurement. 17/50017/2
Todd Broch [Fri, 3 May 2013 02:23:53 +0000 (19:23 -0700)]
servod: pit: Add ADCs for power measurement.

BUG=none
TEST=manual,
1. Emerge it
sudo emerge hdctools

2. launch servod on servo V1 & swing the mux to the adcs
sudo servod -c pit.xml ...
dut-control i2c_mux:loc0

3.  Take measurments
pit_mv=`dut-control -i | grep _mv | cut -d' ' -f1`
pit_ma=`dut-control -i | grep _ma | cut -d' ' -f1`
pit_mw=`dut-control -i | grep _mw | cut -d' ' -f1`
dut-control $pit_mv
dut-control $pit_ma
dut-control $pit_mw

Values read make sense.

Change-Id: I9970e3e09ef9e3ef626e4b678e6eceb722cad698
Reviewed-on: https://gerrit.chromium.org/gerrit/50017
Tested-by: Katie Roberts-Hoffman <katierh@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
15 months agoGiving Parrot a little bit of time to process rec_mode request 78/49278/3 release-R28-4100.B stabilize-4068.0.B stabilize-4100.38.B stabilize-spring-4100.53.B toolchainB
Gediminas Ramanauskas [Fri, 26 Apr 2013 02:42:52 +0000 (19:42 -0700)]
Giving Parrot a little bit of time to process rec_mode request

BUG=chrome-os-partner:18469
TEST=firmware_FAFTSetup passes reliably

Change-Id: I403213653a766d55e8fa8dc7bd350bf0f1ae9b66
Reviewed-on: https://gerrit.chromium.org/gerrit/49278
Reviewed-by: Yusuf Mohsinally <mohsinally@chromium.org>
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Gediminas Ramanauskas <gedis@chromium.org>
Tested-by: Gediminas Ramanauskas <gedis@chromium.org>
15 months agoServo: Implement i2c for servo_v3 89/49089/2
Simran Basi [Tue, 23 Apr 2013 18:57:00 +0000 (11:57 -0700)]
Servo: Implement i2c for servo_v3

Servo_v3 setup allows the beaglebone to directly interact with i2c
rather than through an ftdi.
This patch supplies write and read functionality via i2cset and i2cget.

BUG=chromium:187489
TEST=ran locally and manipulated pwr_button and lid_open. Checked servo_v2
     still works and ensure 2 byte read/writes work as well.

CQ-DEPEND=Idda762db7fa36d842dc4866b31eec7c34957b78d

Change-Id: Idf11c4dfc6e387e0c6bf8bcf2dd2161eae197aaa
Reviewed-on: https://gerrit.chromium.org/gerrit/49089
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>

15 months agoRevert "Servo: Implement i2c for servo_v3" 55/49055/2
Todd Broch [Wed, 24 Apr 2013 14:56:11 +0000 (07:56 -0700)]
Revert "Servo: Implement i2c for servo_v3"

This reverts commit 6866eb32b0d32c2116949535eeb689d9e536f212.

Change introduced bug in interface allocation logic for servo V1, V2.

Change-Id: Ia60ff2bdae32a5ca8dc7a4975a128a42badba665
Reviewed-on: https://gerrit.chromium.org/gerrit/49055
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
15 months agoservod: Add servo V3 i2c controls. 52/48152/4
Todd Broch [Mon, 15 Apr 2013 20:38:07 +0000 (13:38 -0700)]
servod: Add servo V3 i2c controls.

CL creates controls for devices on servo V3 which will be controlled
via the beaglebone's I2C controller (bb_i2c_scl/sda).

Future CLs should add native controls for UART and GPIOs.

BUG=chromium:187489
TEST=manual,

sudo servod --noautoconfig -c servo_v3_r0.xml
dut-control <controls>

Change-Id: Idda762db7fa36d842dc4866b31eec7c34957b78d
Reviewed-on: https://gerrit.chromium.org/gerrit/48152
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
15 months agoServo: Implement i2c for servo_v3 43/47943/9
Simran Basi [Tue, 23 Apr 2013 18:57:00 +0000 (11:57 -0700)]
Servo: Implement i2c for servo_v3

Servo_v3 setup allows the beaglebone to directly interact with i2c
rather than through an ftdi.
This patch supplies write and read functionality via i2cset and i2cget.

BUG=chromium:187489
TEST=ran locally and manipulated pwr_button and lid_open

CQ-DEPEND=Idda762db7fa36d842dc4866b31eec7c34957b78d

Change-Id: I6c5c102a58dd602f1b74356f9441cbe7139984e0
Reviewed-on: https://gerrit.chromium.org/gerrit/47943
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
15 months agoservod: Allow dut board name aliases. 94/48794/3
Todd Broch [Mon, 22 Apr 2013 17:43:20 +0000 (10:43 -0700)]
servod: Allow dut board name aliases.

BUG=none
TEST=manual, all of the following servod launches work as expected
  sudo servod -b link
  sudo servod -b daisy_spring
  sudo servod -b spring
  sudo servod -b ''
  sudo servod

Change-Id: I8a818b769cdd4b72961320c9b5f187725cef0308
Reviewed-on: https://gerrit.chromium.org/gerrit/48794
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

15 months agoservod: mimic flex: change to allow either pca9500 or pca9537. 31/48531/7 stabilize-4035.0.B
Todd Broch [Tue, 16 Apr 2013 18:20:03 +0000 (11:20 -0700)]
servod: mimic flex: change to allow either pca9500 or pca9537.

For electrical reasons (see tracker) some DUT devices cannot tolerate
the current source included in the pca9500.  To alleviate that issue
all future mimic flex cables will employ the pca9534.

This CL allows both old & new mimic cables to work by creating a new
virtual driver pca95xx and dynamically determining which flex is
installed.

BUG=chromium:233244
TEST=manual
run servod w/ old (PCA9500) and new (PCA9534) mimic flexes and
successfully read the f/w from Spring which MUST set spi2_buf_on_flex.

sudo servod -b spring
dut-control spi2_buf_en:on spi2_buf_on_flex_en:on spi2_vref:pp1800
sudo flashrom -p ft2232_spi:type=servo-v2 -r /tmp/fw.bin
dut-control spi2_buf_en:off spi2_buf_on_flex_en:off spi2_vref:off

Change-Id: I85d28220bfa42b585c22d0d4b9d423b9b07ebbed
Reviewed-on: https://gerrit.chromium.org/gerrit/48531
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

15 months agohdctools: fix unmatched pragma diagnostic pop 30/48430/2
Yunlian Jiang [Wed, 17 Apr 2013 23:13:09 +0000 (16:13 -0700)]
hdctools: fix unmatched pragma diagnostic pop

BUG=chromium:232968
TEST=CLAGS="-clang" emerge-lumpy hdctools passed.

Change-Id: I1b978118e7a08076f3c90b88cc403732783deb7e
Reviewed-on: https://gerrit.chromium.org/gerrit/48430
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
15 months agoMake Stumpy rec_mode just like Alex rec_mode. 55/48055/3 stabilize-4008.0.B
J. Richard Barnette [Fri, 12 Apr 2013 23:26:28 +0000 (16:26 -0700)]
Make Stumpy rec_mode just like Alex rec_mode.

Testing servo-based repair for Stumpy has turned up that it suffers
the same quaint rec_mode behavior as exists on Alex.  Changed
servo_stumpy_overlay.xml to reflect this.

BUG=chromium:223234
TEST=platform_InstallTestImage with stumpy support

Change-Id: If307ccb5e85693d83094505309b6eb694bf720c0
Reviewed-on: https://gerrit.chromium.org/gerrit/48055
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>

15 months agoAdd support for Toad GPIOs in servod 20/47920/4
Vincent Palatin [Thu, 11 Apr 2013 22:09:05 +0000 (15:09 -0700)]
Add support for Toad GPIOs in servod

The Toad cable has the FT230X GPIOx connected to a Silego part to
control the mux mode (EC/AP/EC monitor mode) and VBUS.

BUG=chrome-os-partner:17570
TEST=with a Toad cable connected, run :
"dut-control uart_mux && dut-control mode_sw:press &&
dut-control mode_sw:release && dut-control uart_mux"
and see the mux switched from EC to AP and vice-versa.

Change-Id: I21f546d18d77b50364da600d2f5723ec77276605
Reviewed-on: https://gerrit.chromium.org/gerrit/47920
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
15 months agoservod: add support for open-drain GPIOs 90/47990/3
Vincent Palatin [Fri, 12 Apr 2013 00:14:31 +0000 (17:14 -0700)]
servod: add support for open-drain GPIOs

When a GPIO is declared as open-drain with a pull-up (by setting the
attribute od='PU'):
- when switching to 0, it is set as an output with value 0.
- when switching to 1, it is set as an input.

Also fix the FTDI gpio code to allow setting a GPIO as input.

BUG=chrome-os-partner:17570
TEST=with the updated toad.xml configuration done in the next CL,
switch a Toad cable from EC to AP and check the values written to the
FTDI :
sudo SERVOD_DEBUG=1 servod -d
dut-control mode_sw:press && dut-control mode_sw:release
-D- :: Changing direction register to 0x01
-D- :: Changing value register to 0x00
-D- :: cbus write of 0x10
[...]
-D- :: Read value to 0x0e
[...]
-D- :: Changing direction register to 0x00
-D- :: Changing value register to 0x01
-D- :: cbus write of 0x01
[...]
-D- :: Read value to 0x0f

Change-Id: I39e724ae4542911b81866cc2a57b1972f9a4d83e
Reviewed-on: https://gerrit.chromium.org/gerrit/47990
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
15 months agoAdd support for FT230X 19/47919/3
Vincent Palatin [Thu, 11 Apr 2013 22:01:04 +0000 (15:01 -0700)]
Add support for FT230X

The new FT230X (used in Toad devices) is using "CBUS" for its GPIOs
(same as FT232R), the code is updated to act accordingly.

The current libftdi (v1.0) doesn't have the support for FT230X yet.
(but it's already in upstream repository)
I workaround that issue by using the fact that with older libftdi
FT230X is detected as a FT232BM and we are not really using FT232BM in
any of our devices.

BUG=chrome-os-partner:17570
TEST=read GPIO values on a Toad cable (with the updated toad.xml
configuration done in the next CL)

Change-Id: I7be4e6b596101566d9fbe58b8344b6c3be0e91f6
Reviewed-on: https://gerrit.chromium.org/gerrit/47919
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
15 months agoAdd basic Toad cable support in servod 18/47918/3
Vincent Palatin [Thu, 11 Apr 2013 19:43:49 +0000 (12:43 -0700)]
Add basic Toad cable support in servod

This only includes support for the UART right now.

Compared to the toad standalone utility, servod allows to get the UART
interface as a pty with custom serial parameters for people using scripts.

BUG=chrome-os-partner:17570
TEST=run "sudo servod" and connect minicom to the created pty.

Change-Id: Icc51036cc9215048c6185fbe02669e5fde04127f
Reviewed-on: https://gerrit.chromium.org/gerrit/47918
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
15 months agohdctools: Allow either libftdi or libftdi1 usage. 66/45966/8
Todd Broch [Wed, 20 Mar 2013 05:20:10 +0000 (22:20 -0700)]
hdctools: Allow either libftdi or libftdi1 usage.

Toad ( goto/cros-toad ) needs libftdi1 library for its advanced
features.  However other platforms (beaglebone) may not want or need
to upgrade to libftdi1.  This CL provides the necessary changes to
allow tools within hdctools (servod & toad) to use which ever ftdi
library is installed.

BUG=chromium:222299
TEST=manual, from chroot:

Test1 (using libftdi)
  'sudo emerge libftdi hdctools' succeeds
  'sudo servod' succeeds
  'sudo toad status' succeeds
  'sudo toad console' fails as there's no console support for older
     libftdi library

Test2 (using libftdi1)
  prerequisite:  Apply https://gerrit.chromium.org/gerrit/#/c/44731/
  'sudo emerge libftdi hdctools' succeeds
  'sudo servod' succeeds
  'sudo toad status' succeeds
  'sudo toad console' succeeds

Test3 (using libftdi1)
  'emerge-daisy' libftdi hdctools succeeds

Change-Id: I4636335a2cac5a3946b5a3b5635b8a2ace055451
Reviewed-on: https://gerrit.chromium.org/gerrit/45966
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
15 months agoRefactor common ARM EC related controls. 20/45320/2
Todd Broch [Wed, 13 Mar 2013 17:53:06 +0000 (10:53 -0700)]
Refactor common ARM EC related controls.

BUG=chrome-os-partner:18226
TEST=manual,
start servod on Spring and control various EC controls.

Change-Id: Ic1765190749294c66131cbcfb408d7bec0a8358c
Reviewed-on: https://gerrit.chromium.org/gerrit/45320
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

15 months agoFix clang assign a variable to itself warning 59/47659/3
Yunlian Jiang [Tue, 9 Apr 2013 17:55:03 +0000 (10:55 -0700)]
Fix clang assign a variable to itself warning

BUG=chromium:218370
TEST=CFLAGS="-clang" CXXFLAGS="-clang" emerge-x86-alex hdctools
     passes.

Change-Id: I04893365a4f4e7566ec71c12f3edb6759a46dbfa
Reviewed-on: https://gerrit.chromium.org/gerrit/47659
Reviewed-by: Han Shen <shenhan@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>

16 months agoclient: refactor ServoClientError to suggest controls. 18/46818/2
Todd Broch [Thu, 28 Mar 2013 22:46:05 +0000 (15:46 -0700)]
client: refactor ServoClientError to suggest controls.

Previous commit added logic to the client's get method compare the
list of controls returned from the server to the control requested by
the client and suggest a match.  This change moves that logic inside
ServoClientError class so that all methods that call raise this error
can benefit from the hints.

BUG=none
TEST=manual
1. launch server:
   sudo servod
2. client commands
   dut-control reset
      Problem with ['reset:on'] :: No control named "reset"
      Consider cold_reset warm_reset
   dut-control cold_reset
      cold_reset:off
   dut-control reset:on
     Problem with ['reset:on'] :: No control named "reset"
     Consider cold_reset warm_reset

Change-Id: I128f5c0ef4dbc01622e6fc49352b4e2b4afcbc6a
Reviewed-on: https://gerrit.chromium.org/gerrit/46818
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

16 months agoservod: Add aliases for fw_up to t20_rec. 28/46828/2
Todd Broch [Thu, 28 Mar 2013 23:36:07 +0000 (16:36 -0700)]
servod: Add aliases for fw_up to t20_rec.

Back when dinosaurs roamed the earth we named our firmware update
control t20_rec in honor of:
  http://en.wikipedia.org/wiki/T20

While we ultimately settled on fw_up as a more suitable name, many
boards have it silk-screened as t20_rec.  CL to create aliases to
assist (hopefully not confuse) those who choose to look at the silk
screen.

BUG=none
TEST=manual
1. start servod
   sudo servod
2. client commands
   dut-control t20_rec fw_up
   dut-control -i t20_rec fw_up

Change-Id: I66714005841896c14de185b320e4a4f0e48bb57b
Reviewed-on: https://gerrit.chromium.org/gerrit/46828
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

16 months agodut-control: bugfix for statistic calculations. 40/46540/3
Todd Broch [Tue, 26 Mar 2013 20:15:15 +0000 (13:15 -0700)]
dut-control: bugfix for statistic calculations.

BUG=none
TEST=manual
sudo servod -c servo_loc.xml

dut-control -t 1 loc_0x40_mv | grep @
@@           NAME  COUNT  AVERAGE  STDDEV     MAX     MIN
@@   sample_msecs    277     3.60    0.17    6.08    3.36
@@    loc_0x40_mv    277   357.72    1.98  360.00  356.00

dut-control -t 1 cold_reset | grep @
<doesn't fail>

Change-Id: Ia09aa7250ee6447332b324b97a02635bb3f3751e
Reviewed-on: https://gerrit.chromium.org/gerrit/46540
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
16 months agoparrot: bugfix to make rec_mode work. 17/46517/2 release-R27-3912.B stabilize-3912.79.B toolchainA
Todd Broch [Tue, 26 Mar 2013 15:37:13 +0000 (08:37 -0700)]
parrot: bugfix to make rec_mode work.

The following change that refactored separate pty drivers into one
  2b090c766e1b7b2142af19e84e76132a79bb1a3a
  hdctools: pty_driver: refactor _issue_cmd method.

Broke rec_mode for parrot due to EOL characters being different.

This CL fixes that issue.

BUG=chrome-os-partner:16759
TEST=manual,

1. sudo servod -b parrot
2. dut-control rec_mode rec_mode:on rec_mode rec_mode:off

Change-Id: I6f1d027e56b2be6e173f50c2f21a69a75095b3b5
Reviewed-on: https://gerrit.chromium.org/gerrit/46517
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Gediminas Ramanauskas <gedis@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

16 months agoservod: Send multiple controls in one connection to server. 09/46309/2
Todd Broch [Fri, 22 Mar 2013 16:48:40 +0000 (09:48 -0700)]
servod: Send multiple controls in one connection to server.

Clients to servod (dut-control, client.py) currently send control
command (get or set) to servod one at a time via get or set method.
While this arguably provides a simpler more debuggable interface it is
susceptable to system/network latency issues.  These latencies in turn
cause timing variability especially with time sensitive togglings of
GPIOs.  This has been seen when running FAFT where servod runs on a
less compute worthy platform or in a more congested network environment.

This CL creates a new method, set_get_all, across the XMLRPC interface
which processes an entire string of control requests.  Additionally it
changes dut-control client to use that method for all non-doc (-i)
related transactions.

Current and future consumers of client methods that are sensitive
timing variability should use this new method.

For example,
  Using dut-control:
    before:
      dut-control cold_reset:on ; sleep 2 ; dut-control cold_reset:off
    after:
      dut-control cold_reset:on sleep:2 cold_reset:off

  Using set_get_all in client.py:
    before:
      for cmd in ['cold_reset:on', 'sleep:2' 'cold_reset:off']:
        client.set(cmd)
    after:
      client.set_get_all(['cold_reset:on', 'sleep:2' 'cold_reset:off'])

BUG=chrome-os-partner:18047
TEST=manual
1. sudo emerge hdctools
2. sudo servod
3. client commands tested
   - dut-control
   - dut-control -i
   - dut-control cold_reset
   - time dut-control i2c_mux_en:off i2c_mux:loc0 i2c_mux_en i2c_mux \
       i2c_mux_en:on i2c_mux:loc1 i2c_mux_en i2c_mux
     <time was improved ~20ms (from 230ms:real -> 200ms:real on z620)>

Change-Id: Ie4dc280ec2f96f5738f93444f696ec39c638838b
Reviewed-on: https://gerrit.chromium.org/gerrit/46309
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

16 months agoHandle beaglebone deploy when /etc/default/servod is missing. 52/46152/3
J. Richard Barnette [Thu, 21 Mar 2013 19:08:26 +0000 (12:08 -0700)]
Handle beaglebone deploy when /etc/default/servod is missing.

On a new beaglebone image, it's normal that /etc/default/servod
won't exist.  The most recent update to the deploy script broke
handling for that case; this change fixes it.

BUG=None
TEST=remove /etc/default/servod, test various use cases

Change-Id: I60b92f2bf0fe10795809b2d69a7db015eaaee6e7
Reviewed-on: https://gerrit.chromium.org/gerrit/46152
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>

16 months agoLog version information in the beaglebone servod upstart job. 91/46091/3
J. Richard Barnette [Thu, 21 Mar 2013 00:36:31 +0000 (17:36 -0700)]
Log version information in the beaglebone servod upstart job.

BUG=chromium:222555
TEST=deploy this change on a beaglebone, check the log

Change-Id: Id94e41fb454a70eaeb3081974466542b023651b3
Reviewed-on: https://gerrit.chromium.org/gerrit/46091
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
16 months agoservod: Refactor libftdi inclusion. 65/45965/3
Todd Broch [Wed, 20 Mar 2013 05:08:45 +0000 (22:08 -0700)]
servod: Refactor libftdi inclusion.

Creates a single string inside ftdi_common to include the ftdi library
name.

BUG=chromium:222299
TEST=emerge hdctools & launch servod successfully

Change-Id: I977a314aa5c1f8c2b9d48394d8dca9039fe476d6
Reviewed-on: https://gerrit.chromium.org/gerrit/45965
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

16 months agotoad: Bugfixes for compile time problems using libftdi1 64/45964/3
Todd Broch [Wed, 20 Mar 2013 03:21:03 +0000 (20:21 -0700)]
toad: Bugfixes for compile time problems using libftdi1

No functional changes only slight modification to error strings.

BUG=chromium:222299
TEST=manual, connect toad to my host only

Scenario 1 (w/ libftdi)
-----------------------
1. compiles cleanly w/ libftdi installed
2. run following commands successfully
   sudo toad
   - dumps usage

   sudo toad getmode
   - mode='ap'

   sudo toad setmode ec

   sudo toad getmode
   - mode='ec'

   sudo toad console
   - -E- :: Unrecognized command.

   sudo toad status
   - vbus='on'
   - ecap='ap'
   - boot='off'
   - modesw='off'

Scenario 2 (w/ libftdi1)
------------------------
1. compiles cleanly w/ libftdi1 installed
   Note, must apply https://gerrit.chromium.org/gerrit/#/c/44731/
2. run following commands successfully
   Tried same list as above plus
   sudo toad console ( try some ctrl sequences )
   sudo toad initialize -f
   - (07:31:38.207124)-I- :: Initializing device GG003P44

Change-Id: Id9ff93cbc2ae506a477e879d0159e1b0e9f3eaa0
Reviewed-on: https://gerrit.chromium.org/gerrit/45964
Reviewed-by: David Schneider <dnschneid@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
16 months agohdctools: Remove deprecated servod & miniservod binaries. 63/45963/2
Todd Broch [Wed, 20 Mar 2013 03:12:12 +0000 (20:12 -0700)]
hdctools: Remove deprecated servod & miniservod binaries.

These binaries served a useful purpose during early bringup and
development of first servo boards.  They have been deprecated and
unused however for quite some time so its time to remove them.

BUG=chromium:222299
TEST=emerge hdctools successfully

Change-Id: I01ec492602489f63ef40f2083dc09f10068bd2bb
Reviewed-on: https://gerrit.chromium.org/gerrit/45963
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

16 months agoAdd a get_board() method to servod. 21/45621/3 stabilize-3881.0.B
J. Richard Barnette [Thu, 14 Mar 2013 23:13:46 +0000 (16:13 -0700)]
Add a get_board() method to servod.

The new method is meant to support clients that need to determine
their behavior based on the kind of DUT board the Servo is
controlling.  The method returns the board (if any) that was passed
via the --board option.

BUG=chromium-os:35804
TEST=integration testing with a corresponding autotest client

Change-Id: Ic7f0d6467c5ab7faf030e0ec26a938509bd6ae03
Reviewed-on: https://gerrit.chromium.org/gerrit/45621
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>

16 months agoServo: V3: Allow for non-FTDI Interfaces 68/45368/2 factory-spring-3842.B
Simran Basi [Tue, 12 Mar 2013 20:45:26 +0000 (13:45 -0700)]
Servo: V3: Allow for non-FTDI Interfaces

This is the initial work to begin implementing Servo V3 interfaces.

First INTERFACE_DEFAULTS and SERVO_ID_DEFAULTS was refactored out
of ftdi_common.

Modified existing interface init functions to be specifically for
ftdi and added new barebone init functions for beaglebone interfaces.

Created skeleton classes for beaglebone interfaces and filed bugs
to actually implement them.

BUG=chromium-os:39171
TEST=ensured servod and dut-control still work for servo-V2

Change-Id: I632e66f971c0b95253c24ba69427890220a3a4a6
Reviewed-on: https://gerrit.chromium.org/gerrit/45368
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
16 months agoRevert "Servo: V3: Allow for non-FTDI Interfaces" 64/45364/2
Richard Barnette [Wed, 13 Mar 2013 23:24:05 +0000 (16:24 -0700)]
Revert "Servo: V3: Allow for non-FTDI Interfaces"

This change causes failures starting servod:
  File "/home/chromeos-test/hdctools/build/servo/ftdi_common.py", line 7, in <module>
    import servo_interfaces
ImportError: No module named servo_interfaces

This reverts commit d0481c562184168c086c08fcf9b91606b5a4c627

Change-Id: I5f2abb459f87727c06dc70492555903fc8feca47
Reviewed-on: https://gerrit.chromium.org/gerrit/45364
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
16 months agoServo: V3: Allow for non-FTDI Interfaces 48/45248/4
Simran Basi [Tue, 12 Mar 2013 20:45:26 +0000 (13:45 -0700)]
Servo: V3: Allow for non-FTDI Interfaces

This is the initial work to begin implementing Servo V3 interfaces.

First INTERFACE_DEFAULTS and SERVO_ID_DEFAULTS was refactored out
of ftdi_common.

Modified existing interface init functions to be specifically for
ftdi and added new barebone init functions for beaglebone interfaces.

Created skeleton classes for beaglebone interfaces and filed bugs
to actually implement them.

BUG=chromium-os:39171
TEST=ensured servod and dut-control still work for servo-V2

Change-Id: Ifb511f7fc60064109d51c390cc2117ea4174e970
Reviewed-on: https://gerrit.chromium.org/gerrit/45248
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
16 months agoInclude libusb.h when using libftdi1. 54/41654/5 firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B
David Schneider [Fri, 18 Jan 2013 19:44:36 +0000 (11:44 -0800)]
Include libusb.h when using libftdi1.

libftdi1 originally included libusb.h for us in their header; they have since
cleaned this up, requiring us to do it explicitly.

This does not affect libftdi0.

BUG=None
TEST=Succesfully compiled against both old and new libftdis.

Change-Id: I1e4b3c2859191b02e2fe1922045f30dc1c3d36da
Reviewed-on: https://gerrit.chromium.org/gerrit/41654
Commit-Queue: David Schneider <dnschneid@chromium.org>
Reviewed-by: David Schneider <dnschneid@chromium.org>
Tested-by: David Schneider <dnschneid@chromium.org>
16 months agohdctools: servod: Support a new control to send multiple UART commands 65/44165/4
Tom Wai-Hong Tam [Wed, 27 Feb 2013 08:13:22 +0000 (16:13 +0800)]
hdctools: servod: Support a new control to send multiple UART commands

We now have 'uart_cmd' control which can only send one command to UART.
When we emulate a key (press and release), two separated commands should
be issued.

As emulating key is time-sensitive, we saw an issue that in the Beaglebone
setup, the network connection between autoserv and servod have some latency,
like 20ms. This latency between press and release results double press's.

So we need a new control to send multiple UART commands such that the press
and release can be done in short time.

BUG=chrome-os-partner:18045
TEST=manual
Emulate a long latency in the connection between autoserv and servod,
run the firmware_ECKeyboard test, over 50 time, all passed.

Change-Id: Ic14722b6240be833d56978df3421c92359c7979d
Reviewed-on: https://gerrit.chromium.org/gerrit/44165
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
16 months agoTell the kernel to re-read the GPT after writing the USB key. 34/44134/2
J. Richard Barnette [Wed, 27 Feb 2013 02:31:56 +0000 (18:31 -0800)]
Tell the kernel to re-read the GPT after writing the USB key.

After overwriting any block device, it is somewhere between
"highly advisable" and "mandatory, on pain of death" to use the
command `blockdev --rereadpt` so that the kernel will re-read and
update the in-memory copy of the device's GPT.

Servod.download_image_to_usb() ovewrites a block device, so we
insert the necessary call to do the work.

BUG=chromium-os:39209
TEST=platform_InstallRecoveryImage and platform_InstallTestImage

Change-Id: Ic7c95802971aaf3b7e4828f6319d512b0b183726
Reviewed-on: https://gerrit.chromium.org/gerrit/44134
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>

17 months agohdctools: update hwinit list before checking clobber_ok 00/41700/2
Rong Chang [Mon, 21 Jan 2013 06:44:09 +0000 (14:44 +0800)]
hdctools: update hwinit list before checking clobber_ok

When clobber_ok attribute exists, the hardware init value should be
updated.

BUG=chrome-os-partner:17345
TEST=manual
  modify board X cfg: spi1_vref init="pp3300"
  start servod: servod -b X
  check log:
    Servod - INFO - Initialized spi1_vref to pp3300

Change-Id: I4a70cfbaed9eadeea07ca137952a62aacfa0311a
Reviewed-on: https://gerrit.chromium.org/gerrit/41700
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
17 months agoDo not leave open files behind after uart capture stops 78/43478/2
Vadim Bendebury [Sun, 17 Feb 2013 18:03:33 +0000 (10:03 -0800)]
Do not leave open files behind after uart capture stops

The commit which added the ability to capture uart channels (1164289d)
introduced a bug: each time a capture was activated an open file was
left behind. This patch fixes the problem.

BUG=None
TEST=manual

   . build a new version of hdctools and run cros_write_firmware in a
     loop for a long time (in excess of 2000 cycles). 'Exceeded number
     of open files' error is not being reported anymore.

Change-Id: I694988687a9c2396f9cab86333049a5d329d4d49
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43478
Reviewed-by: Todd Broch <tbroch@chromium.org>
17 months agohdctools: servod: spring ADCs for power measurement. 41/42841/6
Todd Broch [Thu, 7 Feb 2013 02:23:47 +0000 (18:23 -0800)]
hdctools: servod: spring ADCs for power measurement.

Note this is part two.  Original ADC/sense moved to spring_v0_r0.py.
Those boards were mostly deprecated.  If you need to access those
ADCs consult use that file instead.

BUG=chrome-os-partner:17608
TEST=manual,
1. Emerge it
sudo emerge hdctools

2. launch servod
sudo servod -c spring.xml

3.  Take measurments
spring_mv=`dut-control -i | grep _mv | cut -d' ' -f1`
spring_ma=`dut-control -i | grep _ma | cut -d' ' -f1`
spring_mw=`dut-control -i | grep _mw | cut -d' ' -f1`
dut-control $spring_mv
dut-control $spring_ma
dut-control $spring_mw

Values read make sense.

Change-Id: I4f5939d13b0cf3efceda866db296a6086dc5ccf9
Reviewed-on: https://gerrit.chromium.org/gerrit/42841
Reviewed-by: Bryan Freed <bfreed@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
17 months agoFirst cut refactoring for client API 34/43134/4
J. Richard Barnette [Tue, 5 Feb 2013 22:58:06 +0000 (14:58 -0800)]
First cut refactoring for client API

Move ServoClient and related code into a separate module.

BUG=chromium-os:36973
TEST=run various dut-control commands

Change-Id: Ic2e58f2d98aef6a524e6b3dd86384b135b49e6a4
Reviewed-on: https://gerrit.chromium.org/gerrit/43134
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
17 months agoservod: spring: Add daisy EC controls. 86/43186/3
Todd Broch [Wed, 13 Feb 2013 19:13:33 +0000 (11:13 -0800)]
servod: spring: Add daisy EC controls.

Daisy EC controls should be compatible with Spring so add them to
Spring's overlay.

Additionally move logging.info of channel save to logging.debug instead.

BUG=none
TEST=manual
sudo emerge hdctools
sudo servod -b spring
dut-control ppvar_vbat_mw
- shows battery charge/discharge rate correctly.

Change-Id: I21be3fbfb27d92dc884c66331f3e62a390dd0465
Reviewed-on: https://gerrit.chromium.org/gerrit/43186
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
17 months agoAdd ability to capture uart channels 83/43083/5
Vadim Bendebury [Tue, 12 Feb 2013 03:24:36 +0000 (19:24 -0800)]
Add ability to capture uart channels

With this change servod provides a facility which allows to start and
stop capturing data generated by a UART channel on the DUT. Originally
only the CPU interface is enabled.

Two new controls are being added:
  cpu_uart_capture, on/off - to start/stop capturing CPU UART output
  cpu_uart_stream - a read only control, returns a string of CPU
                    channel output accumulated since the previous
                    invocation

When capture is enabled, a new thread is started. The thread connects
to the serial interface the CPU UART is mapped to, opens it for
non-blocking reads and starts polling the interface for data. All
received data is put in a buffer, up to 20,000 bytes.

The client is supposed to be reading the data from the buffer using
the cpu_uart_stream control. If the buffer overflows, the reading
thread add an overflow indication to the buffer and stops adding mode
data to it, dropping the uart channel output on the floor until the
buffer is flashed by the client. Access to the buffer is protected by
a mutex lock.

The reading thread terminates when capture is stopped or when the
parent thread exits (which happens when servod is terminated for
whatever reason).

BUG=chromium-os:15610
TEST=manual
    . run the following commands
      $ sudo servod -d --board=daisy  # (in a separate terminal)
      $ dut-control cpu_uart_capture:on
      $ dut-control cpu_uart_stream
      cpu_uart_stream:''
      $ dut-control cold_reset:on
      $ dut-control cold_reset:off
      $ dut-control cpu_uart_stream
      cpu_uart_stream:'\x00\x00\n\r\n\rU-Boot SPL, board rev 0\n\r'
      $ dut-control cpu_uart_stream
      cpu_uart_stream:'Uncompressing Linux... done, booting the kernel.\r\n'
      $ dut-control cpu_uart_stream
      cpu_uart_stream:''
      $ dut-control cpu_uart_stream
      cpu_uart_stream:''
      $ dut-control cpu_uart_capture:off

     Observe servod log entries indicating capture thread start/stop

     Issue command

      $ dut-control cold_reset:on

     now terminate earlier started servod using ^C and observe that
     the capture thread is terminated.

Change-Id: Ie45a2493b8393f8155f56fa37dc88cd701400bff
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43083
Reviewed-by: Todd Broch <tbroch@chromium.org>
17 months agohdctools: servod: mcCroskey ADCs for power measurement. 65/42965/4 release-R26-3701.B stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B toolchain-3701.42.B
Todd Broch [Fri, 8 Feb 2013 23:30:04 +0000 (15:30 -0800)]
hdctools: servod: mcCroskey ADCs for power measurement.

BUG=none
TEST=manual,
1. Emerge it
sudo emerge hdctools

2. launch servod
sudo servod -c mccroskey.xml

3.  Take measurments
mv=`dut-control -i | grep _mv | cut -d' ' -f1`
ma=`dut-control -i | grep _ma | cut -d' ' -f1`
mw=`dut-control -i | grep _mw | cut -d' ' -f1`
dut-control $mv
dut-control $ma
dut-control $mw

Values read make sense.

Change-Id: I32ba3dfa2a94483b6d85d0338c39bf7962418d8a
Reviewed-on: https://gerrit.chromium.org/gerrit/42965
Reviewed-by: Neil Hendin <nhendin@chromium.org>
Tested-by: Neil Hendin <nhendin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

17 months agoMove UART support to PTY driver 54/42454/5 stabilize-bluetooth-smart
Vadim Bendebury [Thu, 31 Jan 2013 22:45:04 +0000 (14:45 -0800)]
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>
17 months agoXMLRPC functions must return a value 94/42794/2
Vadim Bendebury [Wed, 6 Feb 2013 21:57:54 +0000 (13:57 -0800)]
XMLRPC functions must return a value

The recent change which went in untested after a seemingly minor tweak
(https://gerrit.chromium.org/gerrit/42453) causes RPC failures when
initializing servo connections. The fix is not to allow remote
functions returning None.

The fix is to have the function return something even if not strictly
necessary. Another alternative is to change RPC configuration to allow
marshaling 'none' across the connection. but it seems more risky
without adding much benefit.

BUG=chromium-os:38700
TEST=manual
  . the following command now succeeds
  $ ~/trunk/src/scripts/run_remote_tests.sh --board=link \
    --servo --remote=192.168.1.23 firmware_FAFTSetup.control\
     --args='board=link'

Change-Id: Ide32f031746ba34d54f1c4b3148f6849829796b0
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42794
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
17 months agoDo not prevent servod startup on initialization failures 53/42453/3
Vadim Bendebury [Thu, 31 Jan 2013 21:47:46 +0000 (13:47 -0800)]
Do not prevent servod startup on initialization failures

Sometimes servod is initialized when the DUT is not connected, or is
not fully active, for instance the EC is not programmed. This causes
startup failures and shutting down servod.

We might want to come up with yet another attribute in the XML files,
marking objects init of which do not have to succeed, but as a quick
fix let's just not terminate servo startup on any initialization
failure, but for now we should ignore initialization failures

BUG=chrome-os-partner:15610
TEST=manual

  . corrupted a Daisy's ec image and started up a servod controlling
   its servo. Observed the following line in the servod log:

   2013-01-31 14:35:01,023 - Servod - ERROR - Problem initializing lid_open -> yes :: Timeout waiting for EC response.

   but servod did not fail to come up. Then reprogrammed the DUT with
   the correct EC firmware using the same servo session and observed
   the DUT to come up. Then restarted servod and observe it initialize
   without the error message.

Change-Id: I89cd16026d791a667128035a90c4d71835ddfba8
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42453
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
17 months agohdctools: servod: Link sense resistor changes. 56/42356/2 stabilize-3658.0.0
Todd Broch [Thu, 31 Jan 2013 00:45:20 +0000 (16:45 -0800)]
hdctools: servod: Link sense resistor changes.

BUG=none
TEST=none
Change-Id: I0c10cf0aaa0e2dfe0186c91464bec402975cc17f
Reviewed-on: https://gerrit.chromium.org/gerrit/42356
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

17 months agohdctools: pty_driver: refactor _issue_cmd method. 72/42172/4
Todd Broch [Mon, 28 Jan 2013 22:54:33 +0000 (14:54 -0800)]
hdctools: pty_driver: refactor _issue_cmd method.

Since this method, _issue_cmd, has the same functionality as
_issue_cmd_get_results w/o a regexp_list lets remove the duplicate
code.

A longer discussion is whether we should instead make regexp_list=['']
which would force some response from EC uart as a sign of life.

BUG=none
TEST=manual,

1. connect to link device & boot
2. start server
   sudo servod -b link
3. close the lid and it closes
   dut-control lid_open:no
3. clos  thopen and it opens
   dut-control lid_open:yes
4. disconnect the link
5. close the lid and it fails to close but no exception occurs

Change-Id: I2eba8636d06771bbf7502e0d3cf19c8e33175d83
Reviewed-on: https://gerrit.chromium.org/gerrit/42172
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

18 months agoMake servod report all valid control values in case of error 84/41984/3
Vadim Bendebury [Fri, 25 Jan 2013 01:09:13 +0000 (17:09 -0800)]
Make servod report all valid control values in case of error

When a user specifies a wrong control value, servod just reports the
issue without hinting at proper alternatives.

After this change it will.

BUG=None
TEST=manual
   . rebuild and restart servod
   . try running dut-control with a wrong control value

     $ dut-control dut_hub_sel:dut_sees_hab
     Problem setting 'dut_hub_sel' to 'dut_sees_hab' :: Map duthub doesn't contain key dut_sees_hab
     Try one of -> 'dut_sees_hub', 'dut_sees_servo'

Change-Id: I177c16a7a3d7dae2edef6caa1a8ac427431d25d5
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41984

18 months agoDo not reorder arguments when values are assigned 78/41778/3
Vadim Bendebury [Tue, 22 Jan 2013 23:01:23 +0000 (15:01 -0800)]
Do not reorder arguments when values are assigned

The earlier change (https://gerrit.chromium.org/gerrit/41409) tried to
be too fancy when rearranging arguments of dut-control. In case when
dut-control is invoked to set some values, the order of controls
becomes important.

Do not reorder controls if any of the arguments call for setting a
control value.

BUG=chromium-os:38081
TEST=manual
  . tried running

    cros_bundle_firmware -b daisy -d exynos5250-snow -w usb

   it does not fail to detect the board anymore and succeeds
   reprogramming it.

 . checked that the order does not change if there is a set operation
   argument:

    $ dut-control tp34 tp27 tp16
    tp16:on
    tp27:on
    tp34:on
    $ dut-control tp34 tp27 tp16:on
    tp34:on
    tp27:on
    $

Change-Id: Id49d4db7be91afe00d3fb1d5bb9b529931e2a472
Reviewed-on: https://gerrit.chromium.org/gerrit/41778
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
18 months agohdctools: Set Parrotflex spi1_vref to pp3300 by default 92/38292/3
Rong Chang [Mon, 19 Nov 2012 09:14:36 +0000 (17:14 +0800)]
hdctools: Set Parrotflex spi1_vref to pp3300 by default

This is needed as EC SPI VDD drop is ~300mV. The SI of SPI lines was
compromised with servo flex connected.

TODO: remove this change once hw change.

BUG=chrome-os-partner:16231
TEST=manual
  > sudo emerge hdctools
  > servod --board parrot
  check console message:
    INFO - Initialized spi1_vref to pp3300

Change-Id: I80bdc6db540f94f42531774272aaff4b98cd22e5
Reviewed-on: https://gerrit.chromium.org/gerrit/38292
Commit-Queue: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
18 months agoAdd debug printouts of the UART channel output 89/41589/2
Vadim Bendebury [Thu, 17 Jan 2013 22:49:20 +0000 (14:49 -0800)]
Add debug printouts of the UART channel output

To help debugging servo UART interactions add printout of the UART
output in case the expected string is not matched.

BUG=none
TEST=manual
  . in a terminal session
    $ sudo servod -d --board=link

  . in another treminal session run the following commands

    $ dut-control "ec_uart_regexp:['xyz',]"
    $ dut-control "ec_uart_cmd:temps"

  . in the first terminal session window observe the output generated
    by the 'temps' command printed in the 'Before:' section

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I571c85642d774e1dbe065f83613491db5c18a9bc
Reviewed-on: https://gerrit.chromium.org/gerrit/41589
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>

18 months agoIncrease default UART timeout 68/41568/2
Vadim Bendebury [Thu, 17 Jan 2013 19:53:10 +0000 (11:53 -0800)]
Increase default UART timeout

When controlling a servo through a Beaglebone board, the delays caused
by the slow host add to the delays of the DUT, which causes tests
expecting the target reply in a fixed time to fail.

In most cases there is no point in limiting the time below few
seconds, as the code waits for the DUT issuing some text on the
console and the wait terminates as soon as the text is seen. The
timeout in this case is juts a fallback to avoid the test getting
stuck forever.

Tests requiring more fine grained timeout can always use the
`ec_uart_timeout' control to set the required value.

This change sets a longer default timeout and makes sure that the same
value is used in all default cases.

BUG=chromium-os:22475
TEST=manual

  . ran the modified autotest (tweaked it to configure proper
    timeouts) with and without a Beaglebone in the middle, both
    succeeded:

    $ run_remote_tests.sh --board=link --remote=172.22.50.140  firmware_ECBootTime \
        --args 'board=link servo_host=172.22.50.141 servo_port=9999'
    $ run_remote_tests.sh --board=link --remote=192.168.1.4 --allow_offline_remote \
       firmware_ECBootTime --servo --args 'board=link'

Change-Id: I26cf5b382ba7b2f94da45646acfbd2188a135660
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41568
Reviewed-by: Todd Broch <tbroch@chromium.org>
18 months agoAllow partial control names for dut-control get requests 24/41424/4
Vadim Bendebury [Wed, 16 Jan 2013 19:49:31 +0000 (11:49 -0800)]
Allow partial control names for dut-control get requests

Sometimes the user does not remember the exact control name. Obtaining
the entire control list takes time and produces a lot of results. This
change modifies dut-control behavior: when an unknown control's value
is requested, a list of similarly named controls (those where the
requested control is a substring) is printed.

BRANCH=none
BUG=None
TEST=manual
$ dut-control xyz
No control named "xyz"

$ dut-control ec
No control named "ec"
Consider ec_spi ec_uart_baudrate ec_uart_bits ec_uart_cmd ec_uart_en ec_uart_parity ec_uart_pty ec_uart_regexp ec_uart_sbits ec_uart_timeout rec_mode sd_detect
$ dut-control ec_spi
ec_spi:off
$ dut-control ec_spi ec_uart_baudrate ec_uart_bits
ec_spi:off
ec_uart_baudrate:115200
ec_uart_bits:eight

Change-Id: I455353c34f82aa0fab5dd0df38add74436db3bb7
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41424
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
18 months agoAdd some structure to dut-control output 09/41409/2
Vadim Bendebury [Wed, 16 Jan 2013 18:47:10 +0000 (10:47 -0800)]
Add some structure to dut-control output

The servo daemon provides a great deal of information about the
target, which is sometimes difficult to navigate because of its shear
volume. This change makes sure that out put generated by the most
verbose dut-control invocations is sorted.

BUG=None
TEST=manual
  . reemerged hdctools and restarted servod
  . run the following commands

    dut-control
    dut-control --info
    dut-control usb_mux_oe4 uart3_sbits uart3_en

  observe output of all commands alphabetically sorted

Change-Id: If31837674e230d7d8313f8f9a3d05f95a70903ab
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41409
Reviewed-by: Todd Broch <tbroch@chromium.org>
18 months agohdctools: flip fw_up and rec_mode for Alex/Lumpy systems. 32/39932/4 factory-3536.B
Todd Broch [Wed, 19 Dec 2012 02:28:30 +0000 (18:28 -0800)]
hdctools: flip fw_up and rec_mode for Alex/Lumpy systems.

Alex systems have fw_up control and rec_mode reversed.  CL flips them
by adding an new 'remap' tag to the XML file.  Note, on x86 platforms
fw_up has no functionality so while there are two controls to
manipulate a single GPIO it should be benign in this case.

BUG=chromium-os:36967
TEST=manual,
  1. connect servo V1 to Alex
  2. sudo servod
  3. dut-control rec_mode:on pwr_button:press sleep:0.3 pwr_button:release
  4. power-down Alex
  5. dut-control rec_mode:off pwr_button:press sleep:0.3 pwr_button:release
  6. Alex boots normally

Repeat using servo V2 & Lumpy as well.
Change-Id: I2d92398285ab92428a712fd0bb70e293b01c1979
Reviewed-on: https://gerrit.chromium.org/gerrit/39932
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

18 months agohdctools: servod: Add lid control for daisy. 65/40265/4
Todd Broch [Fri, 28 Dec 2012 00:42:03 +0000 (16:42 -0800)]
hdctools: servod: Add lid control for daisy.

The daisy EC doesn't have an explicit lid command in its CLI nor can
it be controlled through the gpioset LID_OPEN functionality.  This CL
implements lid_open control functionality via the PC13 GPIO which is
connected to the lid_open signal.

Additionally it refactors the common pty driver methods into its own
class, pty_driver so that ec, parrot_ec & new daisy_ec classes can
inherit it.

BUG=chrome-os-partner:16369
TEST=manual,
1. On link,
   sudo servod -b link
   for c in `dut-control -i | grep "'ec'" -B 1 | grep ^[a-z] | cut -d ' ' -f 1` ; do
     dut-control $c
   done
   # No errors reading above EC based controls

2. On daisy
   sudo servod -b daisy
   # login to device
   dut-control lid_open:no lid_open
   # device suspends ... dut-control returns lid_open:no
   dut-control lid_open:yes lid_open
   # device resumes ... dut-control returns lid_open:yes

3. On parrot (tested by gedis@ ... thanks)

Change-Id: Ia5c605328a4f1438b203afe3259885f21a5acb5b
Reviewed-on: https://gerrit.chromium.org/gerrit/40265
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>

19 months agohdctools: servod: spring ADCs for power measurement. 81/39881/4
Todd Broch [Tue, 18 Dec 2012 21:04:43 +0000 (13:04 -0800)]
hdctools: servod: spring ADCs for power measurement.

BUG=none
TEST=manual,
1. Emerge it
sudo emerge hdctools

2. launch servod
sudo servod -c spring.xml

3.  Take measurments
spring_mv=`dut-control -i | grep _mv | cut -d' ' -f1`
spring_ma=`dut-control -i | grep _ma | cut -d' ' -f1`
spring_mw=`dut-control -i | grep _mw | cut -d' ' -f1`
dut-control $spring_mv
dut-control $spring_ma
dut-control $spring_mw

Values read make sense.

Change-Id: I0064c689f7a40cf39ea727c91a0dbfa50211c6bc
Reviewed-on: https://gerrit.chromium.org/gerrit/39881
Reviewed-by: Aaron Eash <ame@google.com>
Reviewed-by: Mark Hayter <mdhayter@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
19 months agoRevert "hdctools: servo V2: Fix fw_up and rec_mode GPIOs." 25/39925/2
Todd Broch [Wed, 19 Dec 2012 01:04:44 +0000 (17:04 -0800)]
Revert "hdctools: servo V2: Fix fw_up and rec_mode GPIOs."

This reverts commit 166b235b7c13234dd8d825320cbc28d5ff3ee931

Change-Id: Ifee4625219156a6487c90a1c74fef52857e98a03
Reviewed-on: https://gerrit.chromium.org/gerrit/39925
Reviewed-by: Gediminas Ramanauskas <gedis@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
19 months agoAdd Toad, the USB micro dev companion. 06/39106/4 release-R25-3428.B stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 toolchain-3428.65.B
David Schneider [Wed, 28 Nov 2012 22:07:51 +0000 (14:07 -0800)]
Add Toad, the USB micro dev companion.

This utility prefers to use the newer libftdi1 (not the 0.x version being
distributed currently), due to its (meagre) asynchronous transfer support.
This will still compile using libftdi 0.x, but console mode and the initialize
commands will be disabled.

The output of the Toad commands is designed to be very shell-script-friendly;
querying commands (status, getmode, etc) can be wrapped in "eval" to set a few
shell variables.

There is a hacky workaround to initialize the CBUS bit-bang mode when the
command is run on a Toad that has just been plugged in. The FTDI chip does not
seem to expose any better way to work around the issue, unfortunately.

When compiled with libftdi1, Toad includes a completely self-contained console
mode with some bonus keyboard escapes, so no ftdi_sio module or serial console
software is necessary.  Of course, on machines with ftdi_sio, this utility is
unnecessary for simple AP and EC console access. For machines with both,
libftdi1 will automatically disable the ftdi_sio module when you run the
utility.

Even libftdi1 does not fully support the FT230X in use, so the initialize
command has its own EEPROM modification and checksumming code.

BUG=chromium-os:36972
TEST=Play with the hardware:

1) Compile with the old libftdi 0.x; plug in one programmed Toad
Get the serial number: ./toad list
This should do the same thing: ./toad --serialname=$THE_SERIAL list
This should do the same thing, with more messages: ./toad --serialname= list
This should again do the same thing, with more messages: ./toad -s all list
Play with LEDs: ./toad ecap toggle
Spit out a file as boot code (don't do this plugged in): ./toad boot toad.c
Get the current mode: ./toad getmode
Turn the LEDs off: ./toad vbus off
Turn them back on: ./toad setmode boot
Go back to normal: ./toad boot off
Make sure the status is sane: ./toad status
This won't find any devices: ./toad initialize
This will find one, but won't work under the old libftdi: ./toad -f initialize
This still won't work under the old libftdi: ./toad initialize -f

2) Compile with the new libftdi 1.x; plug in one programmed Toad
Try everything in #1, up until the initialize commands.
This won't find any devices: ./toad initialize
This should work, though: ./toad -f initialize
But this shouldn't: ./toad -s $THE_SERIAL initialize
But this should: ./toad -s $THE_SERIAL initialize -f
Enter console mode: ./toad console
Switch between AP and EC in console mode: ^X^A, ^X^E
Forgot the escapes!: ^Xh
Cancel out: ^X^C. If you check the return code ($?) it should be non-zero.
Enter console mode again, this time start on the AP: ./toad ap
End console mode: ^X^D. The return code should be zero (success).
Enter console mode once more, on the EC: ./toad ec
Background console mode: ^X^Z. The terminal should be OK (not in raw mode).
Return using "fg". We should be in raw mode again.
If you can get something that echos (like a DUT or a loopback), see if you get
echos. Note that a straight loopback will not convert carriage returns (the
enter key) into linefeeds, so you won't get any newlines.
Unplug Toad. Console mode should error out.

3) Keep the new libftdi 1.x version; plug in a bunch of unprogrammed Toads
Program ALL the Toads!: ./toad -s all initialize
Make sure they're all programmed: ./toad -s all list
Unplug and plug them back in and make sure they're sane: ./toad -s all list

Change-Id: Ibf190dda8d45cb27e40dd19ef2fa21a87a1cd8b7
Reviewed-on: https://gerrit.chromium.org/gerrit/39106
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: David Schneider <dnschneid@chromium.org>
Tested-by: David Schneider <dnschneid@chromium.org>
19 months agohdctools: servod: Add sid for next batch of servo V2 93/39493/2
Todd Broch [Mon, 10 Dec 2012 19:07:19 +0000 (11:07 -0800)]
hdctools: servod: Add sid for next batch of servo V2

BUG=none
TEST=manual,

1. Connect single servo V2 w/ sid 780735 to host and launch servo
sudo servod

See log output:
2012-12-10 11:06:42,874 - servod - INFO - Found servo, vid: 0x18d1 pid: 0x5002 sid: 780735-00070

Change-Id: I79b6b27e34479baf49db85392e7af50a63151e53
Reviewed-on: https://gerrit.chromium.org/gerrit/39493
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: David Chang <davidchang@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>

19 months agohdctools: servo V2: Fix fw_up and rec_mode GPIOs. 17/39417/2
Todd Broch [Fri, 7 Dec 2012 22:53:47 +0000 (14:53 -0800)]
hdctools: servo V2: Fix fw_up and rec_mode GPIOs.

In V1 these GPIOs started out being called:
  t20_rec & goog_rec_mode

Those names were deemed confusing during servo V2 creation and changed
to:
  fw_up & rec_mode

Unfortunately, that change didn't make the schematics & silk-screen
for servo V2.  As such the 'T20_REC' button is actually rec_mode and
the button labeld 'GOOG_REC' is actually fw_up.

As the GPIOs have the same functionality its ok to re-map them in the
control file.  Only remaining confusion is the silkscreen which folks
will just have to remember.

BUG=chromium-os:36967
TEST=manual,

testA)
1. Press mechanical button labeled 'T20_REC' when booting Alex and it
enters recovery

testB)
0. turn DUT off
1. start servod
  sudo servod -b x86-alex
2. Assert recovery mode
  dut-control rec_mode rec_mode:on rec_mode
3. turn DUT on see recovery screen

Change-Id: I03f522a13313121777d8612e06422e53f338f132
Reviewed-on: https://gerrit.chromium.org/gerrit/39417
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
19 months agohdctools: servod: clarify errors during hwinit 00/38400/5 stabilize2
Todd Broch [Tue, 20 Nov 2012 18:53:03 +0000 (10:53 -0800)]
hdctools: servod: clarify errors during hwinit

BUG=chromium-os:36451
TEST=manual

1. connect servo V2 w/o 50->50 pin cable
2. sudo servod -b parrot

Failure now looks like:
    2012-11-20 10:50:31,626 - Servod - INFO - Initialized jtag_buf_en to off
    -E- :: Slave 0x26 failed wr_rd with fic->error:0 err:2
    2012-11-20 10:50:31,634 - Servod - ERROR - Problem initializing jtag_buf_on_flex_en -> off :: ('fi2c_wr_rd', 'slave:0x26 wr:[] rcnt:1 err:1')
    .
    .
    2012-11-20 10:50:31,775 - servod - CRITICAL - Problem during hardware initialization.

Change-Id: I7d7591383a146fa392f20e010c1ee130b56ef06f
Reviewed-on: https://gerrit.chromium.org/gerrit/38400
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Jeremy Thorpe <jeremyt@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>

19 months agohdctools: servod: make hwinit follow order of xml parsing 64/39264/3
Todd Broch [Wed, 5 Dec 2012 21:43:06 +0000 (13:43 -0800)]
hdctools: servod: make hwinit follow order of xml parsing

Hardware initialization of some controls may require another control
to be set to an appropriate value before proceeding.  The only
noteworthy case being i2c_mux:rem when using servoflex_v2_r0_p50.xml
as the flex contains an i2c device on it that controls
jtag_buf_on_flex, spi1_buf_on_flex and spi2_buf_on_flex.  Previously
this was passing due to luck with respect to the return order of
python's iterator for dictionaries.  That luck just ran out.

CL fixes hwinit to follow parsing order of XML files and re-orders
control i2c_mux, i2c_mux_en to be in prior to downstream controls that
depend on it.

BUG=chromium-os:36451
TEST=launch servod -b spring and see successful hwinit.
Change-Id: I7bec5da16669da8aea35746d16e6d8a33b6c47e2
Reviewed-on: https://gerrit.chromium.org/gerrit/39264
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
20 months agoFix beaglebone deployment based on recent testing. 36/38236/2
Richard Barnette [Fri, 16 Nov 2012 22:44:05 +0000 (14:44 -0800)]
Fix beaglebone deployment based on recent testing.

This addresses two issues uncovered by using the deployment script
in practice:
 1) Fixed the upstart job to be more graceful if servod fails to
    start.
 2) Changed 'sudo -v' to 'sudo true'; the former will ask for a
    password even if not required.

BUG=None
TEST=Run the deployment script with and without a working servo

Change-Id: I3da45bc8ac79db15d0aee73e2e1e1f47e0ff33bb
Reviewed-on: https://gerrit.chromium.org/gerrit/38236
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>

20 months agohdctools: servod: Make board overlays independent of servo revision. 57/37957/7
Todd Broch [Tue, 13 Nov 2012 23:47:09 +0000 (15:47 -0800)]
hdctools: servod: Make board overlays independent of servo revision.

Certain boards implement different controls differently.  Never has
that been more true then with the dev_mode control.  These differences
are accounted for by creating board specific overlays for servo.  For
example, servo_lumpy_overlay.xml.

In addition, different servo versions (there's two currently) control
these same signals differently.  The original overlay mechanism
however required declaring a completely new control to 'clobber' the
existing one.  That means we'd either need to create overlay files
specific to each servo version or ...

Make the overlay files clobber only certain dictionary keys to the
original specification.  As most of these differences revolve around
assertion levels ... that's easy ... just override the controls
map='onoff' or map='onoff_i' value and you're done.

BUG=chromium-os:36336
TEST=manual, connect a servo V1 & V2 to NO DUT's and ...

Note, 0x5001 is USB productID for servo V1 & 0x5002 for V2

for servo_pid in 0x5001 0x5002 ; do
  for board in none x86-alex tegra2_kaen lumpy stumpy; do
    sudo servod -p $servo_pid -b $board > /tmp/servod.log 2>&1 &
    pid=$!
    sleep 10
    echo "servo_pid:$servo_pid board:$board"
    dut-control -i | grep ^dev_mode -A 2
    sudo kill $pid
  done
  echo '================='
done

Output should look like,
    servo_pid:0x5001 board:none
    dev_mode          DOC: Developer mode
    ----------------- GET: {'map': 'onoff_i', 'slv': '0x20', 'cmd': 'get', 'drv': 'tca6416', 'offset': '6', 'interface': '2', 'port': '1'}
    ----------------- SET: {'interface': '4', 'map': 'onoff', 'cmd': 'set', 'offset': '2', 'drv': 'gpio'}
    [2] 14054
    [1]-  Exit 143                sudo servod -p $servo_pid -b $board > /tmp/servod.log 2>&1
    servo_pid:0x5001 board:x86-alex
    dev_mode          DOC: Developer mode
    ----------------- GET: {'map': 'onoff_i', 'clobber_ok': '', 'slv': '0x20', 'cmd': 'get', 'drv': 'tca6416', 'offset': '6', 'interface': '2', 'port': '1'}
    ----------------- SET: {'map': 'onoff_i', 'clobber_ok': '', 'offset': '2', 'interface': '4', 'cmd': 'set', 'drv': 'gpio'}

Note that only 'map' field changes and the addition of 'clobber_ok'
versus the 'none' board.

for board in daisy link; do
  sudo servod -p $servo_pid -b $board > /tmp/servod.log 2>&1 &
  pid=$!
  sleep 10
  echo "servo_pid:$servo_pid board:$board"
  dut-control | grep ERR
  sudo kill $pid
done
echo '================='

This is more of a sanity check as these boards are only supported by servo V2
Change-Id: I744a7c1bbd9358d2d64aa6a1a69370435515cf23
Reviewed-on: https://gerrit.chromium.org/gerrit/37957
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
20 months agohdctools: servod: Display log of all XML files sourced. 59/37859/2
Todd Broch [Tue, 13 Nov 2012 00:14:11 +0000 (16:14 -0800)]
hdctools: servod: Display log of all XML files sourced.

BUG=none
TEST=sudo servod -b link produces following lines about sourcing of
XML.

  2012-11-12 16:13:07,244 - SystemConfig - INFO - Loading XML config
    /usr/lib64/python2.6/site-packages/servo/data/servo_v2_r1.xml
  2012-11-12 16:13:07,246 - SystemConfig - INFO - Loading XML config
    /usr/lib64/python2.6/site-packages/servo/data/servo_v2_r0.xml
  2012-11-12 16:13:07,266 - SystemConfig - INFO - Loading XML config
    /usr/lib64/python2.6/site-packages/servo/data/common.xml
  2012-11-12 16:13:07,284 - SystemConfig - INFO - Loading XML config
    /usr/lib64/python2.6/site-packages/servo/data/servo_link_overlay.xml

Change-Id: I11a3f98eec7ab5039017f7b2dec1a9dbfe2b074c
Reviewed-on: https://gerrit.chromium.org/gerrit/37859
Reviewed-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
20 months agohdctools: select the right flex configuration for Spring 51/37851/2
Vincent Palatin [Mon, 12 Nov 2012 22:50:28 +0000 (14:50 -0800)]
hdctools: select the right flex configuration for Spring

The Spring board is using a 50-pin flex cable with a special PCB adapter
for the connector.
As the flex configuration is somewhat difficult to remember, allow to
pass the board name to servod to select the right configuration.

BUG=None
TEST=sudo emerge hdctools
sudo servod -b spring
see EC serial flashing and SPI flashing are working

Change-Id: If82686d5473ffb13de46d1834c1ca683050ffe8a
Reviewed-on: https://gerrit.chromium.org/gerrit/37851
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
20 months agohdctools: servo: Include 50-pin servoflex config on devices with non-Chrome-EC 93/37693/2
Tom Wai-Hong Tam [Thu, 8 Nov 2012 08:42:30 +0000 (16:42 +0800)]
hdctools: servo: Include 50-pin servoflex config on devices with non-Chrome-EC

The 50-pin servoflex config was originally passed by an additional argument,
like:
    sudo servod -b butterfly -c servoflex_v2_r0_p50.xml

It always creates issues when forgetting to pass this config. Adding it to the
board overlay helps.

BUG=chrome-os-partner:16036
TEST=sudo servod -b butterfly -d
See the servoflex_v2_r0_p50.xml config is applied.

Change-Id: I3453b727ee4686f903c9ec7c3455840fd69a6480
Reviewed-on: https://gerrit.chromium.org/gerrit/37693
Reviewed-by: Yusuf Mohsinally <mohsinally@google.com>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>