servo: micro + ccd on same instance (round 2).
Note:
This is a temporay hack as go/servoarch will provide the same
functionality, however in this case we need this double feature earlier.
Expect this to be gone with servoarch with the rest of postinit.
This change adds a new layer to postinit to allow for servo micro and
ccd on the same servo instance iff both micro and ccd are enumerated and
on the same v4 hub.
In that case, the servo micro is the main device, and all controls route
to it. However, ccd backed controls are also available behind the
ccd_cr50. prefix.
This is off by default and can be enabled by having --allow-dual-v4 in
the cmdline. To that effect the change adds that to the upstart script
used in the lab.
E.g.
dut-control cr50_devid // used servo micro to query the devid
dut-control ccd_cr50.cr50_devid // uses ccd to query the devid
BUG=None
TEST=manual testing
> passes labstation validation
> EC/AP/Cr50 console through micro work
> Cr50 console through ccd works
sudo servod -b atlas --allow-dual-v4
2019-07-15 09:22:15,736 - ServoDeviceWatchdog - INFO - Watchdog setup
for devices: set([(6353, 20507, 'C1709150019'), (6353, 20500,
u'16000062-935CD754'), (6353, 20506, u'SNCQ00098')])
// showing both micro and ccd got pulled in.
sudo servod -b atlas
2019-07-15 09:21:47,961 - ServoDeviceWatchdog - INFO - Watchdog setup
for devices: set([(6353, 20507, 'C1709150019'), (6353, 20506,
u'SNCQ00098')])
// showing only micro got pulled in.
TEST=sudo servod -b atlas // with v4 + micro
>> comes up fine
TEST=sudo servod -b atlas --allow-dual-v4 // with v4 + micro
>> comes up fine, dual role ignored
TEST=sudo servod -b atlas // with v4 + ccd
>> comes up fine
TEST=sudo servod -b atlas --allow-dual-v4 // with v4 + ccd
>> comes up fine, dual role ignored
TEST=sudo servod -b atlas // with v4 + micro + ccd
>> comes up fine
TEST=sudo servod -b atlas --allow-dual-v4 // with v4 + micro + ccd
>> comes up fine, dual role honored
Change-Id: I56aa10128565f6198f2c4c70ed09dd544b94c3a2
Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1737187
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
diff --git a/servo/servo_interfaces.py b/servo/servo_interfaces.py
index 47dd748..374093a 100644
--- a/servo/servo_interfaces.py
+++ b/servo/servo_interfaces.py
@@ -150,6 +150,7 @@
'default': 1,
'hammer': 41,
'staff': 41,
+ 'secondary_ccd': 61,
}
SERVO_V4_CONFIGS = {
'hammer': 'servo_micro_for_hammer.xml',