Commit Graph

195 Commits

Author SHA1 Message Date
Todd Broch
abecc13a87 Add USB-PD mode commands.
These commands (pdgetmode & pdsetmode) will provide host with ability
to identify USB-PD alternate mode devices SVIDs and supported modes.
It will also allow host to set mode on devices which support multiple
alternate modes.

Signed-off-by: Todd Broch <tbroch@chromium.org>

BRANCH=samus
BUG=chrome-os-partner:33946
TEST=manual

Plug hoho/dingdong into samus at port <port>

  ectool --name cros_pd pdgetmode <port>
  *SVID:0xff01 *0x00001085  0x00000000  0x00000000  0x00000000  0x00000000  0x00000000
   SVID:0x18d1  0x00000001  0x00000000  0x00000000  0x00000000  0x00000000  0x00000000

  ectool --name cros_pd pdsetmode <port> 0x18d1 1
  ectool --name cros_pd pdgetmode <port>
   SVID:0xff01  0x00001085  0x00000000  0x00000000  0x00000000  0x00000000  0x00000000
  *SVID:0x18d1 *0x00000001  0x00000000  0x00000000  0x00000000  0x00000000  0x00000000

  ectool --name cros_pd infopddev <port>
  Port:1 DevId:4.1 Hash: 0x042cc79c 0x30cc12e3 0xe27a36e5 0x3f7eba5f 0x053c91d1
  Port:1 ptype:5 vid:0x18d1 pid:0x5010

Also from samus_pd console see proper result for 'typec <port>'

  typec 1
  Port C1: CC1 178 mV  CC2 427 mV (polarity:CC2)
  No Superspeed connection

Also visually inspect packets via twinkie.

Change-Id: I4e442bcb39ec1ff3cb6efff196a660819077ad76
Reviewed-on: https://chromium-review.googlesource.com/231834
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-01-16 07:16:13 +00:00
Shawn Nematbakhsh
bd85bc4636 charge_manager: Log charge-related change events
Add the charging events to the PD event log FIFO
and add an ectool to retrieve/decode them.

BUG=chrome-os-partner:33248
TEST=Manual on Samus. Run `ectool --name cros_pd pdlog`, verify that
all log entries are dumped and the content matches expectation.
BRANCH=Samus

Change-Id: I65dd5696cc0487856ab42aff24134bcdfa1a8219
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/238093
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-01-15 01:07:07 +00:00
Gwendal Grignou
f352aae8b4 ec util: do not compile IO mapped memory related code for mips.
MIPS host CPU does not access IO registers using a separate address space.
Remove for support of LPC for this host architecture.

Confine x86 function to Intel Architecture only.

BRANCH=none
TEST=Compile: Test on ARM, MIPS and X86: using emerge... ec-utils.
BUG=chromium:443783

Change-Id: I9d4276ec3588037adfcff96e596bbe8be74f22fd
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/236687
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-01-13 18:48:35 +00:00
Eric Caruso
0c95dc3022 lightbar: Don't let EC control suspend/resume sequence
If the EC controls the lightbar and sets the sequence when
it notices the chipset transitioning between states, we can't
make exceptions for cases where we don't want to activate the
lightbar, such as in dark resume. Instead, let's make it a
separate command that we expect from the kernel.

BUG=chrome-os-partner:32181
TEST=build on samus, verify lightbar does correct thing with
  manual control set
BRANCH=ToT

Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
Change-Id: I5dc619cbbf2498e2ef03ce622831b33e14c7c495
Reviewed-on: https://chromium-review.googlesource.com/239215
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2015-01-10 00:51:14 +00:00
Todd Broch
a5a2b263f8 pd: Return immediately to host from erase RW.
With CL:
 5ef45ad pd: Add timeout for HC flash commands.

I thought I'd licked the timeout related issues with flashing dingdong
& hoho.

With further testing however I found I was occassionally hitting the
failure where I couldn't return from 'flash erase' on PD peripheral
prior to the 1 second limit for host command timeout.

That could be remedied by retrying the erase on the host side which
then succeeds quickly.  That solution seems non-optimal however.
Additionally, even when erase does succeed in <1sec we have the shared
i2c bus pending.  That too is non-optimal.

For those reasons I've decide to return immediately from flash erase
command and instead put the burden of waiting the necessary time on
the host which at least does have some wider perspective on what the
system is attached to and doing.

CL also adds following related changes:
  1. corresponding ectool edit to delay 3sec after RW erase.
  2. fixup to error returns from hc_remote_flash for timeouts.

Signed-off-by: Todd Broch <tbroch@chromium.org>

BRANCH=samus
BUG=chrome-os-partner:33947
TEST=flashing dingdong/hoho via ectool works reliably.

Change-Id: I8fbfb592f760273b26bcb16b67210d569454eee2
Reviewed-on: https://chromium-review.googlesource.com/239253
Trybot-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
2015-01-08 21:03:38 +00:00
Vic Yang
140aa36904 pd: Show literal PD state name for 'ectool usbpd'
Currently, 'ectool usbpd' shows PD task state in numerical format. Every
time we add/remove a state, the number changes, and this makes the
command difficult to use. Modify the command to print the name of the PD
task state.

BRANCH=Samus,Ryu
BUG=chrome-os-partner:34296
TEST=Run 'ectool usbpd 0' with different combination of new/old PD
firmware and new/old ectool.

Change-Id: Ic0daa03e9f7565c1322166713c2cce3b7cb93a30
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237623
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Alec Berg <alecaberg@chromium.org>
Tested-by: Alec Berg <alecaberg@chromium.org>
2015-01-07 17:48:15 +00:00
Shawn Nematbakhsh
35ea0a968c charge_manager: Bug fixes for power_info host commands
- Correctly identify certain source ports (ex. c-plug to empty a-receptacle)
- Correct ectool power unit print (mV * mA != mW).

BUG=chrome-os-partner:33248
TEST=Manual on Samus. Connect c-plug to empty a-receptacle, run
"ectool --name usbpdpower", verify that port power role is identified
as source. Also, verify that 5000 mV @ 500mA port correctly prints
2500mW total power.
BRANCH=Samus

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Icf0850afc570a1056578df9f1a647079a00229b3
Reviewed-on: https://chromium-review.googlesource.com/238235
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Alec Berg <alecaberg@chromium.org>
2015-01-07 17:48:09 +00:00
Shawn Nematbakhsh
c69e9ceb31 pd: Modify EC_CMD_USB_PD_RW_HASH_ENTRY to return PD device image type
This addition allows the AP to query whether the PD device is currently
running from RO or RW FW.

BUG=chrome-os-partner:34599
TEST=Manual on Samus. Run 'ectool --name cros_pd infopddev 0' and verify
that correct RO/RW status of Zinger is printed. Verify that the output
matches the index printed by "pd 1 hash" on samus_pd console.
BRANCH=Samus

Change-Id: I4266cae931f5c7855ca0531717c4a18b138b2d62
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/236771
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-12-20 08:54:18 +00:00
Todd Broch
540584eb6d pd: ectool: Increase sleep after PD reboot for flashing.
Longer sleep is needed to provide enough time for USB-PD devices to:
  1. boot RO & validate RW
  2. Initialize PD
  3. Enter Alternate mode (GFU)

Signed-off-by: Todd Broch <tbroch@chromium.org>

BRANCH=samus
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual,
Flashing RW on dingdong via,
  ectool --name cros_pd flashpd 3 1 dingdong.ec.RW.bin
works

Change-Id: Id9c6f3907022f62bf887dfefc23b51d070b331b8
Reviewed-on: https://chromium-review.googlesource.com/233023
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
2014-12-05 01:09:44 +00:00
Todd Broch
01047f6524 pd: ectool: Expose device id major & minor.
Also unifies other console output of same field.

Signed-off-by: Todd Broch <tbroch@chromium.org>

BRANCH=samus
BUG=chrome-os-partner:32650
TEST=manual

  # connect zinger to port 1 on samus
  ectool --name cros_pd infopddev 1

Before:
  Port:1 Device:1025 Hash:  0x3f34bc13  0xf8d15d12  0xf81f03cf  0xba3a3db6  0x0152a520
  Port:1 ptype:5 vid:0x18d1 pid:0x5012

After:
  Port:1 DevId:1.1 Hash: 0x3f34bc13 0xf8d15d12 0xf81f03cf 0xba3a3db6 0x0152a520
  Port:1 ptype:5 vid:0x18d1 pid:0x5012

Change-Id: I4e7ac56354e92ea3bc54a2c6ab5746399abdefe5
Reviewed-on: https://chromium-review.googlesource.com/231832
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
2014-12-02 01:57:18 +00:00
Todd Broch
63277d145b pd: ectool: Allow different payload sizes for flashpd.
Dingdong & Hoho have different sized internal flash so the RW payload
can't be fixed.  CL removes check as operators should know be capable
of picking correct payload.

Signed-off-by: Todd Broch <tbroch@chromium.org>

BRANCH=samus
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual,

  <copy build/zinger/ec.RW.bin to samus>

  # reserved dev_id w/ zinger RW payload.
  ectool --name cros_pd flashpd 0 1 /tmp/ec.RW.bin
  Reading 65536 bytes from /tmp/ec.RW.bin...
  payload size 65536 but expected 0

  # hoho dev_id w/ zinger RW payload.
  ectool --name cros_pd flashpd 4 1 /tmp/ec.RW.bin
  Reading 16384 bytes from /tmp/ec.RW.bin...
  payload size 16384 but expected 65536

  # bogus dev_id
  ectool --name cros_pd flashpd 99 1 /tmp/ec.RW.bin
  Unknown device ID 99

  # zinger dev_id w/ zinger RW payload
  ectool --name cros_pd flashpd 1 1 /tmp/ec.RW.bin
  Reading 16384 bytes from /tmp/ec.RW.bin...
  Erasing expected RW hash
  Rebooting
  Erasing RW flash
  Writing RW flash

Change-Id: I49ad81edb04f359154fbff6710484c0d095069f7
Reviewed-on: https://chromium-review.googlesource.com/231831
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
2014-12-01 20:31:00 +00:00
Todd Broch
b41a0632db WORKAROUND: ectool: Throttle flashpd so it does not watchdog EC.
CL adds sleep to USB-PD flashing loop in ectool.  Real problem is
likely busy waiting within the host command master in the EC which
causes it to starve other lower priority tasks there.

Additionally,
1. Sleep 100ms after reboot to attempt to avoid colliding with other
   USB-PD traffic communication that happens when accessories boot.

2. Sleep 100ms after last flash write prior to reboot as there's some
   race between finalizing flash write.

Workaround should be removed once we've identified root cause.

Signed-off-by: Todd Broch <tbroch@chromium.org>

BRANCH=samus
BUG=chrome-os-partner:33905
TEST=manual,

1. attach zinger to port 1 of samus
2. create ec.RW.bin for zinger and copy to samus
3. update RW fw on zinger via:
  ectool --name cros_pd flash_pd 1 1 ec.RW.bin

Result:
- No longer see watchdog fire on samus EC
- See successful update of RW fw on zinger.  Takes ~15secs.

Change-Id: If617cbf1c25ee92de94bdb312ec822af2a688640
Reviewed-on: https://chromium-review.googlesource.com/230845
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
2014-12-01 20:30:40 +00:00
Shawn Nematbakhsh
b3bf2a61a3 charge_manager: Add PD_CHARGE_PORT_OVERRIDE host command
Add host command to set charge port override.

BUG=chrome-os-partner:32003
BRANCH=Samus
TEST=Manual on Samus. Insert PD charger in port1 and BC1.2 charger in
port0.
./ectool --name=cros_pd chargeoverride 0 --> Charges from port 0
./ectool --name=cros_pd chargeoverride off --> Charges from port 1
./ectool --name=cros_pd chargeoverride dontcharge --> No charge port
./ectool --name=cros_pd chargeoverride 1 --> Charges from port 1
./ectool --name=cros_pd chargeoverride 2 --> Correctly returns error

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib35f797a4a24e96fd2e3c008ace3fd6291b89d25
Reviewed-on: https://chromium-review.googlesource.com/230910
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-11-20 02:55:41 +00:00
Gwendal Grignou
4b154c6f95 motion: Add decoding for MOTION_CMD_DUMP v1 command
MOTIONSENSE_CMD_DUMP is deprecated, replaced with MOTIONSENSE_CMD_GET_DATA
Also use vector_3_t instead of x,y,z

ectool motionsense commands only work with newer firmware, to
handle a dynamic number of sensors.
- The host sends the number of sensor it has allocated space for.
- If 0, the EC just sends the number of sensors available
- Otherwise returns sensor information up to the limit imposed by the host.

Remove MOTIONSENSE_GET_STATUS: not needed. It is only useful for LPC,
to guarantee atomicity of the data.
Remove MOTIONSENSE_GET_DATA: not needed since we increase the version
number of MOTIONSENSE command.

BUG=chrome-os-partner:31071,chromium:430792
BRANCH=ToT
TEST=Compile. On a firmware that support the new command:
/usr/sbin/ectool --name=cros_sh motionsense
Motion sensing active
Sensor 0: 92    15      1030
Sensor 1: -94   -63     718
/usr/sbin/ectool --name=cros_sh motionsense active
0
On a machine with older firmware (samus), check these
functions are not working anymore.

Change-Id: I64b62afff96670fb93457760d43d4e64e26e029f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226880
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-11-18 05:19:08 +00:00
Henry Hsu
89442037be lid_switch: Support forced lid open
Factory test process need lid switch no function or keep lid opened

BUG=chrome-os-partner:33304
BRANCH=paine,yuna
TEST=Run command "ectool forcelidopen 1" and "reboot". Then lid close
quickly, the system boot as lid opened.
Deault value  or run command "ectool forcelidopen 0" make the device normal.

Change-Id: I94527b7ef7f9efe779c6b86f3eab651f99af6000
Signed-off-by: Henry Hsu <Henry.Hsu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/230180
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-by: Bowgo Tsai <bowgotsai@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
2014-11-18 01:05:49 +00:00
Todd Broch
e96afe490f pd: fix alignment issue for print rwhashtable.
struct ec_params_usb_pd_rw_hash_entry is packed so addressing rw_hash
array caused alignment faults.

CL removes union in favor of just shipping bytes across
the host command.

BRANCH=samus
BUG=none
TEST=manual

from DUT
  ectool --name cros_pd infopddev 0
  Port:0 Device:1025 Hash:  0xa90a5d48 0xcc2af4ea 0xc7796d08 0x4a8f9e8e 0x0ba7578b

  ectool --name cros_pd rwhashpd 1025 0xa90a5d48 0xcc2af4ea 0xc7796d08 0x4a8f9e8e 0x0ba7578b

from PD MCU console,
  pd rwhashtable # no exception due to memory read alignment and ...

  Device:0x0401 Hash: 0xa90a5d48 0xcc2af4ea 0xc7796d08 0x4a8f9e8e 0x0ba7578b
  Device:0x0000 Hash: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
  Device:0x0000 Hash: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
  Device:0x0000 Hash: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

Change-Id: I134a5402eac3e5159441ce6c483633ca0d575a03
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226890
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-11-17 22:12:48 +00:00
Todd Broch
73e182a443 pd: Add SVDM discovery info into host command.
During the discovery identity phase of type-C devices that support it
there is some info that could be useful to kernel & userland for
policy decisions.  CL starts by passing up the vid, pid & product type
(ptype) of the discover identity VDO.

BRANCH=samus
BUG=chrome-os-partner:32650
TEST=manual,

From host, w/ hoho in port 1

ectool --name=cros_pd infopddev 1
Port:1 Device:4 Hash:  0x57b1e4e0 0x7204075f 0x65c0fa72 0xdcca15ed 0xf3231237
Port:1 ptype:6 vid:0x18d1 pid:0x5010

Change-Id: Ie05d191149ada0ec860b713d780b0345eab3a647
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226899
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-11-11 05:41:01 +00:00
Alec Berg
3a4f718f22 samus_pd: add dual-role port flag to power info host command
Add flag for whether or not device plugged into a given port is a
dual-role PD device. For now, the dual-role flag is always 0, but
need to add the flag to the host command now for compatibility
in the future.

BUG=chrome-os-partner:32650
BRANCH=samus
TEST=load onto samus, run ectool --name=cros_pd usbpdpower and
verify that for anything plugged in it says "dedicated charger"

Change-Id: I2d3c8c149802492f27a87a47aaa68fbf505ee7a9
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226820
Reviewed-by: Sameer Nanda <snanda@chromium.org>
2014-10-31 22:32:54 +00:00
Alec Berg
498abf833c samus_pd: add host command to get type-c port power info
Get type-c port power info including power role, charger type,
and charging info. Also added host command to get number of type-c
ports.

Also adds new charging suppliers for pericom identified chargers
including DCP, CDP, SDP, proprietary, and other chargers. Priority
of these for charging is set in samus board file.

BUG=chrome-os-partner:32650
BRANCH=samus
TEST=run 'ectool --name=cros_pd usbpdpower' and verify correct
status with minimuffin, zinger, and type-C to type-A adapter.

Change-Id: I1dabbe7de4185a23df5684a5ea9a2d944f1f6ff5
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223523
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-10-30 04:31:34 +00:00
Gwendal Grignou
d5b32aa6e1 core: Add subcommands to MOTION_SENSE_CMD
These subcommands allow accessing sensor (accel+gyro)
over i2c.

BRANCH=ToT
BUG=chrome-os-partner:31071
TEST=Compile.

Change-Id: Ic6c3e9bf9c23f369de9f540c50daab7f2e4582ee
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225653
2014-10-29 22:23:49 +00:00
Vic Yang
d1ed75815e MKBP event signalling implementation
This implements a new API for EC modules to define MKBP event sources
and send MKBP event to the AP. Also, a new host command
EC_CMD_GET_NEXT_EVENT is added for the AP to query the pending MKBP
events. Each event type may have custom event data sent along with the
event.

BRANCH=None
BUG=chrome-os-partner:33194
TEST=Enable MKBP event on Ryu. Set a host event from EC console, run
'ectool nextevent', and see MKBP event 0x01 (HOST_EVENT) and the set
host event.

Signed-off-by: Vic Yang <victoryang@chromium.org>
Change-Id: I28a1b7e826bcc102bbe39016c9bb3e37d125664c
Reviewed-on: https://chromium-review.googlesource.com/224905
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-24 01:37:58 +00:00
Bill Richardson
f36a859e06 samus: new algorithm for tmp006 object temperature
The original algorithm is given in the TMP006 User's Guide
(SBOU107.pdf). The algorithm we previously implemented is that,
plus some additional and completely undocumented massaging of the
Tdie and Vobj registers. The original meaning of that hack is now
lost in the mists of time, thanks to our email retention policy.

This CL introduces a new algorithm variant, but at least this
time the details are in the bug report. It's essentially the same
as the User's Guide algorithm, except that we apply one-stage FIR
filters to the Tdie input and the Tobj output.

There are five new parameters: d0, d1, ds, e0, e1. Refer to
tmp006_read_object_temp_k() in ec/driver/temp_sensor/tmp006.c to
see how these new parameters are applied.

CAUTION: The tmp006 sensor algorithm is mostly math and magic
numbers. The spreadsheet attached to the bug report has six
sheets with wildly varying values for those parameters. Since the
correct parameter values haven't yet been determined for Samus,
all I can be sure of with this CL is that it seems to work and
isn't any worse than the old one.

Oh, and note that the EC's 't6cal' console command has been
disabled until/unless we add support for floating point IO. Use
ectool from the host to get and set the params instead.

BUG=chrome-os-partner:32260
BRANCH=ToT,Samus
TEST=manual

After booting, look at the sensor values using ectool:

  localhost ~ # ectool temps all
  0: 312
  1: 314
  2: 313
  Sensor 3 not calibrated
  4: 311
  Sensor 5 not calibrated
  6: 305
  Sensor 7 not calibrated
  8: 306
  Sensor 9 not calibrated
  10: 307
  Sensor 11 not calibrated
  12: 312
  Sensor 13 not calibrated
  localhost ~ #
  localhost ~ # ectool tempsinfo all
  0: 0 PECI
  1: 1 ECInternal
  2: 1 I2C-Charger-Die
  3: 2 I2C-Charger-Object
  4: 1 I2C-CPU-Die
  5: 2 I2C-CPU-Object
  6: 1 I2C-Left C-Die
  7: 2 I2C-Left C-Object
  8: 1 I2C-Right C-Die
  9: 2 I2C-Right C-Object
  10: 1 I2C-Right D-Die
  11: 2 I2C-Right D-Object
  12: 1 I2C-Left D-Die
  13: 2 I2C-Left D-Object
  EC result 2 (ERROR)
  ...
  localhost ~ #

There are six tmp006 object temps that need calibrating. The
index used for the calibration is for the tmp006 objects, not the
3,5,7,.. numbers reported for all temp sensors. See the current
values with tmp006cal:

  localhost ~ # /tmp/ectool tmp006cal 5
  algorithm:  1
  params:
    s0  0.000000e+00
    a1  1.750000e-03
    a2  -1.678000e-05
    b0  -2.940000e-05
    b1  -5.700000e-07
    b2  4.630000e-09
    c2  1.340000e+01
    d0  2.000000e-01
    d1  8.000000e-01
    ds  1.480000e-04
    e0  1.000000e-01
    e1  9.000000e-01
  localhost ~ #

If the s0 param is zero, this sensor is uncalibrated. The params
are entered in the order in which they're displayed You can
change any or all of the parameters. Skip the ones you don't want
to update by specifying '-' for its position. (Note: throw in an
extra '--' first so that ectool doesn't think that negative
numbers are command options).

For example, to change s0 and b0:

  localhost ~ # ectool -- tmp006cal 5 1.0 - - -3.0
  localhost ~ #
  localhost ~ # ectool tmp006cal 5
  algorithm:  1
  params:
    s0  1.000000e+00
    a1  1.750000e-03
    a2  -1.678000e-05
    b0  -3.000000e+00
    b1  -5.700000e-07
    b2  4.630000e-09
    c2  1.340000e+01
    d0  2.000000e-01
    d1  8.000000e-01
    ds  1.480000e-04
    e0  1.000000e-01
    e1  9.000000e-01
  localhost ~ #

Now sensor 13 (tmp006 object index 5) is calibrated:

  localhost ~ # ectool temps all
  0: 310
  1: 315
  2: 313
  Sensor 3 not calibrated
  4: 310
  Sensor 5 not calibrated
  6: 305
  Sensor 7 not calibrated
  8: 307
  Sensor 9 not calibrated
  10: 307
  Sensor 11 not calibrated
  12: 312
  13: 313

Change-Id: I61b5da486f5e053a028c533ca9e00b9a82a91615
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/224409
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-22 00:30:31 +00:00
Bill Richardson
8fc80e86e4 lightbar: bring the TAP sequence in gradually
With only four LED segments, it's confusing to indicate a power
percentage by dimming the top segment unless you can see the
indicator smoothly ramping up from all-off. This does that.
Kind of pretty, if I say so myself.

BUG=chrome-os-partner:29041
BRANCH=ToT, Samus
TEST=make buildall

Run "ectool lightbar demo on", then press the T key to invoke the
pattern and the arrow keys to fake the charge state.

Change-Id: Ib6a56aea56078b8c1fc9edddda469d7f41735ff7
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223300
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-10-15 18:22:33 +00:00
Shawn Nematbakhsh
e63ab6da20 ectool: flashpd: Reboot PD after successful RW flash
Reboot the PD device after a successful flash so that it will boot into
the new RW. This syncs the ectool PD update to the implementation in
flash_pd.py.

BUG=chrome-os-partner:31361
TEST="./ectool --name=cros_pd flashpd 0 1 ec.RW.bin", verify flashing
succeeds and PD is rebooted after flash.
BRANCH=samus

Change-Id: I14e7dffe59fcc7ca678c76890dbc825df5b19862
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223062
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-10-14 23:59:16 +00:00
Eric Caruso
6713fa2d38 lightbar: Rename structs and macros for kernel cros_ec_commands
This prepends EC_ a macro exposed in ec_commands.h, moves a
macro into lbcc that is not used elsewhere, and changes lb_program
structs to lightbar_program.

BUG=None
BRANCH=ToT
TEST=make buildall -j

Change-Id: I481562da72d91f846c64cf9af40338027641462c
Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/222406
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2014-10-09 23:29:42 +00:00
Shawn Nematbakhsh
0938563284 zinger: Remove references to SHA1 hash
The PD protocol no longer uses a SHA1 RW hash. Instead, it uses the
first 20 bytes of the SHA-256 hash. Update constants and comments
accordingly.

BUG=chrome-os-partner:31361
TEST='make buildall -j'
BRANCH=samus

Change-Id: Ice74b841dbd1d81205c1ef0079a5e18fca2153b6
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/222446
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-10-09 20:44:39 +00:00
Mohammed Habibulla
0fd73ae937 ectool: replace thermal_threshold_version with ec_cmd_version_supported
BUG=none
TEST='ectool thermalget' works as expected
BRANCH=none

Change-Id: Ie225ef0aaeae913162e8cd6c56193dedd9f56f2f
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221745
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-08 05:07:33 +00:00
Mohammed Habibulla
72aee5c113 ectool: Fix help string for pwmsetfanrpm
BUG=none
TEST='ectool pwmsetfanrpm' prints correct help command
BRANCH=none

Change-Id: I6b1ecc7a581bb916563177f878f6361841e3ed90
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221957
2014-10-08 02:51:10 +00:00
Mohammed Habibulla
5c8da35f87 ectool: hostcmd support to set fans auto control individually
ectool autofanctrl 1 - set auto fan control for fan 1

BUG=chrome-os-partner:23803
TEST=Tested the above EC command on Auron
BRANCH=none

Change-Id: Idcd3690ad98d7965420f26f7cc445207fe73704d
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221816
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-07 20:58:33 +00:00
Vincent Palatin
c817472c07 Update Zinger flashing process
Convert the Zinger flash update commands to the new RSA signature
mechanism.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=samus
BUG=chrome-os-partner:28336
TEST=from the workstation:
./util/flash_pd.py -m 1 build/zinger/ec.RW.bin
from Samus command-line :
ectool --name=cros_pd flashpd 0 1 ec.RW.bin

Change-Id: Ie8cd7f644ec94e461c5775a4dbbcd408782c72e1
Reviewed-on: https://chromium-review.googlesource.com/221560
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2014-10-07 03:37:48 +00:00
Mohammed Habibulla
876b0f0bdc ectool: Add hostcmd support to set fan duty cycle for each fan separately
ectool fanduty <percent>	- set all fans to <percent> duty cycle
ectool fanduty <fan> <percent>	- set <fan> to <percent> duty cycle

BUG=chrome-os-partner:23803
TEST=Tested the above EC commands on Auron
BRANCH=none

Change-Id: I06ca1552bd8f3412f6e90245da302c9f86ab6103
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221505
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-07 01:29:36 +00:00
Mohammed Habibulla
7b1e58cc43 ectool: Add host command support to set fan RPM for each fan separately
First case is for legacy support
ectool pwmsetfanrpm <targetrpm>		- set all fans to <targetrpm>
ectool pwmsetfanrpm <fan> <targetrpm>	- set <fan> to <targetrpm>

BUG=chrome-os-partner:23803
TEST=Tested the above EC commands on Auron
BRANCH=none
CQ-DEPEND=CL:220960

Change-Id: I8f447f53289abaa9c5cc1285f9f0921328fbf32c
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221291
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-03 22:27:03 +00:00
Mohammed Habibulla
75d7e31b9c ectool: add new host command to get number of fans
BUG=chrome-os-partner:23803
TEST="ectool pwmgetnumfans" returns correct number of fans on Auron
BRANCH=none

Change-Id: I2a1930a8f0965b08558bfb3c6424c571a6149bbb
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220960
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-03 22:26:52 +00:00
Mohammed Habibulla
938ba82bd7 ectool: Fix fanduty help
BUG=none
BRANCH=none
TEST=none

Change-Id: Iff09a24064d4245d2660dd307084cd701d03676b
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221202
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-10-03 04:30:01 +00:00
Eric Caruso
fb5ff7b1bb lightbar: add seq type PROGRAM for user-programmable sequences
This diff allows the user to send small programs to the EC and
gain control of the lightbar. Right now, this is only exposed
through ectool, and sysfs support will come later.

To send a program to the EC, use
$ ectool lightbar program /path/to/program.bin
and then start running the program with
$ ectool lightbar seq program

BUG=None
BRANCH=ToT
TEST=Using the above steps with hand-assembled programs.
  Checked that infinite bytecode loops do not hang the EC.
  Checked that bad opcodes exit with an error.
  Stress tested pushing programs and changing sequences.

Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
Change-Id: I635fb041a5dc5c403f7c26fb9a41b5563be9b6b7
Reviewed-on: https://chromium-review.googlesource.com/219558
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-25 07:59:16 +00:00
Gwendal Grignou
fab7ac3b9a ectool: add new parameter to identify proper EC.
Add parameter name to identify which EC to talk to.
Superseed --dev parameter, removed soon.

--name cros_ec (the default): send commands to /dev/cros_ec.
--name cros_pd: send commands to /dev/cros_pd.
...

BUG=chrome-os-partner:31513
TEST=Tested on samus:
check ectool --name cros_pd version returns proper data:
ectool --name=cros_pd version
RO version:    samus_pd_v1.1.2079-8e4f9fc-dirt
....

CQ-DEPEND=CL:217297
BRANCH=ToT

Change-Id: Ie8b5c6c184d73a89b4445e88d6f104169176b9f3
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/217311
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-14 09:52:11 +00:00
Todd Broch
f5b7b32423 samus: enhance usbpd host command to return port status.
CL provides some useful information similar to the EC console command
'pd state <port>' when host command 'usbpd <port>' is sent from host
with no additional arguments.

Also added a few build asserts for role & mux strings.

BRANCH=none
BUG=chrome-os-partner:31690
TEST=manual

  ectool --interface=lpc --dev=1 usbpd 1
  Port C1 is enabled. Role:SNK Polarity:CC1 State:6
  # has zinger attached
  ectool --interface=lpc --dev=1 usbpd 0
  Port C0 is enabled. Role:SNK Polarity:CC1 State:2

Change-Id: Id44eb7bf6a6fcfa888a0008a2249601967c50bcc
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/217138
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-09-11 20:00:12 +00:00
Todd Broch
7698c323ea samus: Add host command to query USB type-C accessory attached.
PD accessories that are RW update-able will broadcast their rw_hash
SHA1 digest upon connection to the PD MCU which will store it.

For update purposes, the host needs that accessories device id and
rw_hash to determine its proper firmware update payload.

This CL creates a host command that requests the type-C accessory info
attached to a particular port.  It also implements an ectool command
to expose the host command.

BRANCH=none
BUG=chrome-os-partner:31361
TEST=manual,
  # connect zinger to port 1 on samus
  ectool --dev=1 --interface=lpc infopddev 1
  Port:0 Device:1 Hash:  0x7f4d7a13 0xf07b65b9 0x41181e10 0xb99b3d5f 0x9dee1206

  ectool --dev=1 --interface=lpc infopddev 0
  Port:0 has no valid device

Also do the same on port 0 with similar results.

Change-Id: Id63c7edad77a43d43c14d8cd6bd96e08d0d9b501
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216814
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-09-11 20:00:07 +00:00
Todd Broch
d9c6380a66 samus: Add host command to store USB PD device id & rw_hash entry.
PD accessories that are RW update-able will broadcast their rw_hash
SHA1 digest upon connection and remain in RO briefly for a response.

In order to speed-up the response and decouple common case of
accessory is up-to-date, the PD MCU will keep a small 4 entry table of
PD accessory device ids and their corresponding RW hashes for quick
lookup.

The AP will be the source of new updates and their corresponding
device id's and RW hashes and therefore needs a method to update the
PD MCU table.

This CL creates the table, host command & ectool command to facilitate
future driver / daemon to update the RW hash entries.

BRANCH=none
BUG=chrome-os-partner:31361
TEST=manual,

  # from AP
  for i in `seq 1 8` ; do
    ectool --dev=1 --interface=lpc rwhashpd $i $i $i $i $i $i
  done

  # from samus_pd console
  pd rwhash
  Device:5 Hash: 0x00000005 0x00000005 0x00000005 0x00000005 0x00000005
  Device:6 Hash: 0x00000006 0x00000006 0x00000006 0x00000006 0x00000006
  Device:7 Hash: 0x00000007 0x00000007 0x00000007 0x00000007 0x00000007
  Device:8 Hash: 0x00000008 0x00000008 0x00000008 0x00000008 0x00000008

Change-Id: Ibe87b3594793cd5215eba42160489b26974aadbc
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/214366
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-09-11 19:59:59 +00:00
Alec Berg
e913bc15b8 samus: add host commands for flashing zinger RW
This adds a new host commmand for sending RW updates to PD devices.
The host command has a variety of sub-commands for performing the
update, including: erase RW, reboot, write new hash, write flash.

To program zinger RW, you should send host commands in this order:
write new hash to all 0's
reboot (zinger boots into RO since RW hash doesn't match)
erase RW
write flash
write new hash to match contents of RW
reboot

This also adds an ectool command to write a new RW. Just pass it
the RW .flat or .bin file.

BUG=chrome-os-partner:31361
BRANCH=none
TEST=ectool --dev=1 --interface=lpc flashpd 0 0 zinger.RW.flat

Change-Id: Ia81615001b83ad7ee69b1af2bf1d7059177cde04
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/213239
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-08-26 23:06:23 +00:00
Vic Yang
139a9c6880 Host command for USB PD role and mux control
This allows us to control PD role and type-C mux through ectool.

BUG=None
TEST=Change role/mux on samus using ectool:
     $ ./ectool --interface=lpc --dev 1 usbpd 0 usb
     -> In EC console, 'typec 0' shows 'Superspeed USB1'
     $ ./ectool --interface=lpc --dev 1 usbpd 0 sink
     -> In EC console, 'pd 0 state' shows 'force sink'
BRANCH=None

Change-Id: I5b90fb53ea1c30e3bc269c12d61e4398c5dcee6c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209956
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2014-07-30 05:31:35 +00:00
Randall Spangler
241cc62685 samus: add options for device passthru and interface
This allows sending host commands to the PD chip through the EC.

The --interface option allows forcing a particular host interface.
This is necessary at present because the crosec device driver doesn't
support host protocol v3 so only has 8-bit command numbers.

BUG=chrome-os-partner:30079
BRANCH=none
TEST=from EC console,
   ectool version -> prints EC version
   ectool --interface=lpc --dev=0 version -> prints EC version
   ectool --interface=lpc --dev=1 version -> prints PD version
   ectool --interface=lpc --dev=2 version -> prints error
   ectool --interface=i2c version -> can't find EC
   ectool --interface=dev version -> prints EC version

Change-Id: I9dd10578dac77e3e104d19e2f37759814eec6ca2
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207948
2014-07-16 07:16:47 +00:00
Randall Spangler
94126fbfa3 Add getopt support to ectool
This is needed for supporting device passthru.  Right now, the --dev
option simply prints an error.

BUG=chrome-os-partner:30079
BRANCH=none
TEST=manual
	ectool -> prints an error
	ectool help -> prints list of commands
	ectool version -> prints EC version
	ectool --dev=0 version -> prints EC version
	ectool --dev=1 version -> prints error about bad device 1
	ectool --dev=0 -> prints an error (because there's no command)
	ectool --dev=0 foo -> prints 'unknown command foo'

Change-Id: I0f431a4789428cd6cc8ef48b396b38237935282a
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207904
2014-07-15 04:04:02 +00:00
Dave Parker
88c0ffd692 ectool: Add back support for version 0 of batterycutoff command
ectool must support all prior versions of commands that shipped
EC binaries use.

BUG=chrome-os-partner:29830
BRANCH=None
TEST=Manual
With an EC that only supports version 0:
- Run 'ectool batterycutoff' -> success
- Run 'ectool batterycutoff at-shutdown' -> error with explicit
  message about at-shutdown not being supported
- Run 'ectool batterycutoff foo' -> error, bad parameter
With an EC that support version 0 or 1:
- Run 'ectool batterycutoff' -> success
- Run 'ectool batterycutoff at-shutdown' -> success
- Run 'ectool batterycutoff foo' -> error, bad parameter

Change-Id: Ia88cfc5fa7c5125828ec0595f0b6a505916c97ea
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/205155
Reviewed-by: Vic Yang <victoryang@chromium.org>
2014-06-26 02:42:32 +00:00
Dave Parker
efd3a8925e Add 'at-shutdown' option to batterycutoff host command
If at-shutdown is specified, the battery is cut off
1 seconds after the host has shutdown.

BUG=chrome-os-partner:29292,chrome-os-partner:28887
BRANCH=tot,nyan
TEST=Run batterycutoff ectool command and cutoff console
command with and without 'at-shutdown' option. Verify
the battery is cut off immediately without the option
specified and 1 seconds after shutdown with. View the
console log to see the deferred cutoff occur.

The following tests are verified on big.

console:
  cutoff, AC on: system is off after removing AC.
  cutoff, AC off: system is off immediately.
  at-shutdown, AC on: system is off after "power off" and removing AC.
  at-shutdown, AC off: system is off after "power off".
ectool:
  batterycutoff, AC on: system is off after removing AC.
  batterycutoff, AC off: system is off immediately.
  at-shutdown, AC on: battery is cut off after 1s of shutdown.
                      system is off right after removing AC power.
  at-shutdown, AC off: system is off after 1s of shutdown.
      [84.058416 power state 3 = S0, in 0x0000]
      [84.058803 power lost input; wanted 0x0001, got 0x0000]
      [84.059120 power off 3]
      [84.072148 Cutting off battery in 1 second(s)]
      [84.123896 power shutdown complete]
      [84.128790 power state 7 = S0->S3, in 0x0002]
      [84.139694 power state 2 = S3, in 0x0002]
      [84.150857 power state 8 = S3->S5, in 0x0002]
      [84.166975 power state 1 = S5, in 0x0002]
      [84.177972 power state 1 = S5, in 0x0002]
      [85.080012 Battery cut off succeeded.]

Change-Id: Id4bacf79ad3add885260655f80cb8127bafe1ad6
Signed-off-by: Dave Parker <dparker@google.com>
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/203694
Reviewed-by: Vic Yang <victoryang@chromium.org>
2014-06-15 01:45:21 +00:00
Bill Richardson
f7ae0fb81b Add display-battery-level function to lightbar
This adds a new lightbar sequence (TAP), which temporarily displays the
battery level. It pulses if the system is charging.

BUG=chrome-os-partner:29041
BRANCH=ToT
TEST=manual

From the EC console, run

  lightbar seq tap

The lightbar should change temporarily.

Then run

  lightbar demo on

and press the Up, Down, Left, and Right keys to fake the battery charge
level (up & down) and the AC present state (left & right). Run the

  lightbar seq tap

command periodically to watch it change.

Change-Id: I84ff928d93060f7ef7d46d608732d37cf5185aff
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202964
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-06-07 06:01:00 +00:00
Bill Richardson
9d3286301d Add GET_RGB, GET_BRIGHTNESS, and GET_DEMO subcommands to lightbar
This adds three new lightbar subcommands to the EC_CMD_LIGHTBAR_CMD host
command, allowing the AP to read the current brightness level, the
current lightbar LED values, and the state of demo mode.

Because this is new, also update LIGHTBAR_IMPLEMENTATION_VERSION. All the
previous commands are unchanged, though.

BUG=chrome-os-partner:28596
BRANCH=ToT
TEST=manual

From the AP, run these commands to see the changes:

  ectool version
  ectool lightbar brightness
  ectool lightbar 0
  ectool lightbar 1
  ectool lightbar 2
  ectool lightbar 3
  ectool lightbar demo

The version output is different, the other commands used to just emit
errors.

Change-Id: If32a5d2388217edc3ae7b9b091d66e9d2cf753be
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199881
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-05-15 05:18:16 +00:00
Wenkai Du
372317af34 CHROMIUM: ec: Add Port 80 history access from ectools
While debugging reboot issue, it was difficult to get POST code from failing
boards. Currently POST code is only accessible from EC console. Not all boards
are fitted with servo board.

This patch adds Port 80 history access from ectool. Reuse command code 0x48,
EC_CMD_PORT80_LAST_BOOT with version 1.

Signed-off-by: Wenkai Du <wenkai.du@intel.com>

BUG=chrome-os-partner:28514
BRANCH=rambi
TEST=manually test on rambi to confirm port 80 history match EC console

Change-Id: If204d8fb457d8d8d18055f8282a406a35c03305e
Reviewed-on: https://chromium-review.googlesource.com/198012
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Wenkai Du <wenkai.du@intel.com>
Commit-Queue: Wenkai Du <wenkai.du@intel.com>
Tested-by: Wenkai Du <wenkai.du@intel.com>
2014-05-07 03:41:27 +00:00
Mohammed Habibulla
2457b509cc Added v1 version of ectool gpioget supporting more functions
ectool gpioget             - returns all GPIOs (with flag info)
ectool gpioget <GPIO_NAME> - get value of <GPIO_NAME>
ectool gpioget count       - returns number of GPIOs
ectool gpioget all         - returns all GPIOs (with flag info)

BUG=chromium:344969
TEST="ectool gpioget [<subcmd> <GPIO_NAME>]" returns correct information
on squawks
BRANCH=none

Change-Id: Ib6f0d8135a76501f08b084bfd7eb1f2689d5d6e0
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/196680
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-04-29 03:11:16 +00:00
Dave Parker
4e1472e303 Add host command to set battery vendor parameters
Also adds 'battparam' console command.

BUG=chrome-os-partner:25145
BRANCH=ToT
TEST=Run 'ectool batteryparam set 0 0x1234'
         'ectool batteryparam get 0'
and on the console:
         'battparam 0'
         'battparam 0 0x1234'
on a board that implements parameter 0.

Change-Id: I9cc54d001631f53dd39ae64cfdeececaa1747181
Original-Change-Id: Ib2812f57f2484309d613b23dab12ad43e0417bd2
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/195824
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/197162
2014-04-29 03:11:01 +00:00