Commit Graph

125 Commits

Author SHA1 Message Date
Bill Richardson
fcce7223a5 Completely new thermal/fan implementation
Problems with existing thermal control loop:
* Not multi-board friendly. thermal.c only supports Link and needs
  refactoring. Temp thresholds and fan speeds are hard-coded.
* Only the PECI temp is used to determine the fan speed. Other temp sensors
  are ignored.
* Has confusing data structures. Values in the CPU temp thresholds array mix
  ACPI thresholds with fan step values.

With this change, the thermal task monitors all temp sensors in order to
perform two completely independent functions:

Function one: Determine if the host needs to be throttled by or informed of
              any thermal events.

For thermal events, each temp sensor will have three threshold levels.

TEMP_HOST_WARN
* When any sensor goes above this level, host_throttle_cpu(1) will be called
  to ask the CPU to slow itself down.
* When all sensors drop below this level, host_throttle_cpu(0) will be called.
* Exactly AT this level, nothing happens (this provides hysteresis).

TEMP_HOST_HIGH
* When any sensor goes above this level, chipset_throttle_cpu(1) will be
  called to slow the CPU down whether it wants to or not.
* When all sensors drop below this level, chipset_throttle_cpu(0) will be
  called.
* Exactly AT this level, nothing happens (this provides hysteresis).

TEMP_HOST_SHUTDOWN
* When any sensor is above this level, chipset_force_shutdown() will be
  called to halt the CPU.
* Nothing turns the CPU back on again - the user just has to wait for things
  to cool off. Pressing the power button too soon will just trigger shutdown
  again as soon as the EC can read the host temp.

Function two: Determine the amount of fan cooling needed

For fan cooling, each temp sensor will have two levels.

TEMP_FAN_OFF
* At or below this temperature, no active cooling is needed.

TEMP_FAN_MAX
* At or above this temperature, active cooling should be running at maximum.

The highest level of all temp sensors will be used to request the amount of
active cooling needed. The function pwm_fan_percent_to_rpm() is invoked to
convert the amount of cooling to the target fan RPM.

The default pwm_fan_percent_to_rpm() function converts smoothly between the
configured CONFIG_PWM_FAN_RPM_MIN and CONFIG_PWM_FAN_RPM_MAX for percentages
between 1 and 100. 0% means "off".

The default function probably provide the smoothest and quietest behavior,
but individual boards can provide their own pwm_fan_percent_to_rpm() to
implement whatever curves, hysteresis, feedback, or other hackery they wish.

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

Compile-time test with

  make BOARD=falco runtests

On the EC console, the existing fan commands should work correctly:

  faninfo       - display the fan state
  fanduty NUM   - force the fan PWM to the specified percentage (0-100)
  fanset RPM    - force the fan to the specified RPM
  fanset NUM%   - force the fan to the specified percentage (0-100) between
                  its configured minimum and maximum speeds from board.h
                  (CONFIG_PWM_FAN_RPM_MIN and CONFIG_PWM_FAN_RPM_MAX)
  fanauto       - let the EC control the fan automatically

You can test the default pwm_fan_percent_to_rpm() with

  fanset 1%
  faninfo

The fan should be turning at CONFIG_PWM_FAN_RPM_MIN. Let the EC control it
automatically again with

  fanauto

Also on the EC console, the thermal settings can be examined or changed:

  > temps
  PECI                : 327 K = 54 C
  ECInternal          : 320 K = 47 C
  G781Internal        : 319 K = 46 C
  G781External        : 318 K = 45 C
  >
  > thermalget
  sensor  warn  high  shutdown   fan_off fan_max   name
    0      373   387    383        333     363     PECI
    1        0     0      0          0       0     ECInternal
    2        0     0      0          0       0     G781Internal
    3        0     0      0          0       0     G781External
  >
  > help thermalset
  Usage: thermalset sensor warn [high [shutdown [fan_off [fan_max]]]]
  set thermal parameters (-1 to skip)
  >
  > thermalset 2 -1 -1 999
  sensor  warn  high  shutdown   fan_off fan_max   name
    0      373   387    383        333     363     PECI
    1        0     0      0          0       0     ECInternal
    2        0     0    999          0       0     G781Internal
    3        0     0      0          0       0     G781External
  >

From the host, ectool can be used to get and set these parameters with
nearly identical commands:

  ectool thermalget
  ectool thermalset 2 -1 -1 999

Change-Id: Idb27977278f766826045fb7d41929953ec6b1cca
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66688
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-08-23 10:38:36 -07:00
Dave Parker
63a71a6adc Peppy ectool led command
Glue between the existing ectool led command and the
led control logic.

BUG=chrome-os-partner:20776
BRANCH=peppy
TEST=Manual. Run "ectool led" commands:

Should pass:
ectool led power blue|yellow|off|auto|blue=1 yellow=1
ectool led battery blue|yellow|off|auto|blue=1 yellow=1

Should fail:
ectool led adapter <color>
ectool led power|battery red|green|white

Signed-off-by: Dave Parker <dparker@chromium.org>
Change-Id: I2540940baa553866760dd9ae62278b6b845793ef
Reviewed-on: https://gerrit.chromium.org/gerrit/64627
2013-08-07 12:43:48 -07:00
Dave Parker
7f1c49ab4b Add ectool discharge command to Falco and Peppy.
Expands and renames ectool 'chargeforceidle' command to
'chargecontrol'. Board-specific calls are needed to enable and
disable the discharge while on AC power state.

BUG=chrome-os-partner:20506
BRANCH=falco,peppy
TEST=Run ectool chargecontrol command with each option (normal,
 idle, discharge) on Falco and Peppy. Verifiy battery is discharging
 in discharge mode via EC console 'battery' command.

Change-Id: I7ac2b18b4f143bf6abc1e0bb878ad21a99f52100
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60689
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-07-19 10:58:18 -07:00
Randall Spangler
5691ac8168 Add EC_CMD_GET_FLASH_INFO version 1
This adds two new fields: the ideal write size for best EC flashing
performance (e.g., page mode instead of word mode), and a flags field
with a flag to indicate whether the EC erases its bits to 0 or 1.

The EC still supports the old version 0 command, since u-boot and
flashrom expect that to work.

BUG=chrome-os-partner:20973
BRANCH=(all haswell); this will speed up flashing and software sync
TEST=ectool flashinfo
     1. old EC, new ectool -> only reports version 0 info
     2. new EC, old ectool -> only reports version 0 info
     3. new EC, new ectool -> reports new fields

Change-Id: I484327fe22a58d2b69d7f6ac767b2d3e81b3e0b7
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62378
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-07-18 16:47:00 -07:00
Bill Richardson
1eeafbacbf Add 'version' option to ectool test command.
This is just handy to be sure we're correclty passing the command version to
the EC.

BUG=chromium:242706
BRANCH=falco, peppy
TEST=manual

Run "hcdebug params" the EC console (using ToT EC)

Compare the output on the EC console when you run these two commands on the
host:

  ectool test 0 13
  ectool test 0 13 1

You should see these two lines (among other things):

[5728.756652 HC 0x0a.0:000000000d00000030313233343536373839616263646566303132333
43536373839414243444546]

[5730.809596 HC 0x0a.1:000000000d00000030313233343536373839616263646566303132333
43536373839414243444546]

The "0x0a.0" and "0x0a.1" indicate that the version is being passed
correctly.

Change-Id: I23b97ac6622274a157717f9375945d0866691a37
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61920
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-07-16 10:59:06 -07:00
Randall Spangler
eb8920c939 Split wireless power/radio control out of switch.c
Chipset control of wireless power uses the new API instead of overriding
the wireless power itself.

Refactor board-specific support for it to just a few config #defines
instead of board-specific functions.  This makes some assumptions
about the polarity of the enable signals.  Not making those
assumptions would require defining an array of structs or some other
heavier-weight board-specific info.  Since the assumptions hold for
all current boards, let's make them now because this is a step in the
right direction, and reserve doing something more general until we
actually have a use case for it (so we build in just the flexibility
we need).

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms; see that link wifi turns on at boot and off at
     shutdown (verify via 'gpioget' from EC console)

Change-Id: Ic036e76158198d2d5e3dd244c3c7b9b1e8d62982
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61608
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-07-11 16:51:40 -07:00
Vic Yang
01ed345ebd Uprev panic data struct version
The struct was changed in commit 74c34bbad, but the struct version was
left as 1. We need to uprev this so the data returned by host command is
useful.

BUG=chrome-os-partner:16901 chrome-os-partner:20548
TEST='ectool panicinfo' with new and old struct. Compare output with
output from console command 'panicinfo'.
BRANCH=None

Change-Id: I4df3142497dc5ee21d100c4cb8118fb7a0ce7a7e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60314
Reviewed-by: Daisuke Nojiri <dnojiri@google.com>
2013-07-10 11:16:18 -07:00
Simon Glass
c7005a4d95 ectool: Correct the empty console check
ectool is waiting for an empty response from the EC to tell it to stop
requesting console data. However, the EC only sends an empty response when
there is no snapshot data. In particular, it seems to send a 1 byte response
(containing just a \0 byte) when there is an empty string.

Adjust the check to stop when no data is provided.

BUG=chrome-os-partner:20639
BRANCH=none
TEST=manual
Run on test device and see that 'ectool console' now completes and does not
run forever.

Change-Id: I565f1be506833c823e5e7eca09be8b2420c8190c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60640
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2013-07-02 14:34:43 -07:00
Randall Spangler
0ee2689ee9 Add get-protocol-information command
This is necessary to support larger packet sizes for host protocol
ver.3.  The host previously didn't have any way to know how big a
packet the EC could accept / respond with (except on LPC, where the
size is determined by the I/O window).

BUG=chrome-os-partner:20257
BRANCH=none
TEST='ectool protoinfo' returns good info; on link,

  Protocol info:
    protocol versions: 2 3
    max request:   256 bytes
    max response:  256 bytes
    flags: 0x00000000

and on pit,

  Protocol info:
    protocol versions: 2 3
    max request:   544 bytes
    max response:  544 bytes
    flags: 0x00000001

Change-Id: Ic1e3831d9b4a96ffbf365c0d09b6023472de39a9
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60703
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-07-02 09:32:52 -07:00
Randall Spangler
2730daa567 Comm interface now provides max I/O sizes and preallocated buffers
The maximum packet / param size differs depending on interface and
protocol version.  Commands can now ask the comm interface what the
limits are, and can use preallocated buffers to avoid needless
malloc/free.

BUG=chrome-os-partner:20571
BRANCH=none
TEST=the following all work on link
  burn_my_ec
  ectool version
  ectool chargedump
  ectool console
  ectool i2cxfer 5 0x41 2

Change-Id: Ib847994da3f79721e7fb4e347231b9147a3f485f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60275
2013-07-01 16:14:15 -07:00
Randall Spangler
267dbb74d2 Add common interface to EC flash commands
ectool and burn_my_ec need to use the same lower-level interface to
the EC flash commands, rather than duplicating calling the low-level
flash read/write/erase commands.

This is a precursor to refactoring the low-level commands to support
SPI/STM32L in a follow-up CL.

BUG=chrome-os-partner:20571
BRANCH=none
TEST=in a root shell, burn_my_ec flashes both RO and RW EC code

Change-Id: I4c72690100d86dbff03b7dacc2fb248b571d3820
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60266
2013-07-01 16:14:15 -07:00
Randall Spangler
61820ceb43 Split file read/write functions out of ectool.c
ectool.c has gotten monstrously huge.  Refactor out some utility functions.

This is precursor work to refactoring out a lower-level flash
read/write interface.

BUG=chrome-os-partner:20571
BRANCH=none
TEST=ectool flashread 0x20000 0x80 /tmp foo -> works

Change-Id: I26dae609a73e54e8adaec56edbdce6a0bb4b8758
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60265
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-06-28 10:27:33 -07:00
Vic Yang
bbbc7ebc5b ectool command to print panic data
This can be useful when the EC reboots but we don't have access to the
EC console.

BUG=chrome-os-partner:20548
TEST=Manual
BRANCH=None

Change-Id: I0b762011860d7802ffbc208ffa42920fa6ed098d
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60220
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-06-27 12:48:11 -07:00
Bill Richardson
e493e7a013 Add EC_CMD_TEST_PROTOCOL to fake certain responses.
This lets us force the EC to return various error codes, so that we can be
sure we're seeing them.

BUG=chromium:242706
BRANCH=none
TEST=none

Trigger various errors like so:

  ectool test 0 14
  ectool test 1 14
  ectool test 5 14
  ectool test 8 14
  ectool test 0 33

Change-Id: Ia951cd7afacdcce6c8ec7d35d3bfb5b113dea694
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59327
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-06-20 16:47:06 -07:00
Bill Richardson
7884ae4821 Fix some stupidness in ectool's comm_init() handling
ectool was checking for negative return values on comm_init(). It should
have been checking for nonzero. Or comm_init should have been returning
negative. Whatever. The ectool utility was supposed to be a quick-n-dirty
debugging tool, so it's not very well tested.

BUG=chromium:249218
BRANCH=none
TEST=manual

Fired up VM instance, tried old version and new version. Old version
coredumps, new version doesn't.

Change-Id: I0e27d78eead562a16ff826fb80de9e6b07476e12
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58712
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-06-14 16:16:09 -07:00
Bill Richardson
d0d1564434 ectool prefers /dev/cros_ec, then falls back to i2c, lpc
This is preparation for the common userspace EC interface. If/when that
appears, this will be ready.

BUG=chromium:239197
BRANCH=all
TEST=manual

Build, install, run it. Shouldn't be any change.

Change-Id: I9fa78515ec5443ba659f10a66bbaadcb7f4802b0
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56131
2013-06-05 14:12:23 -07:00
Vic Yang
e52aba6eca Make ectool LED command more generic
This adds the option to specify which LED to control as well as the
ability to query the supported LED color on the board.

BUG=chrome-os-partner:19745
TEST=On Spring:
       - ectool led 0 query  -> See the max value for R, G, Y is 0x80.
       - ectool led 1 query  -> See error message.
       - ectool led 0 yellow -> See LED turns yellow.
       - ectool led 0 green=0x40 red=0x40 -> See green and red lit up.
       - ectool led 0 auto   -> See LED turns off (without charger.)
BRANCH=spring

Change-Id: Ibdde2f7450122f59383dad1030a0a2a985386f73
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56877
2013-06-03 14:32:16 -07:00
Duncan Laurie
d6d3b7cbc5 Add wireless switch control for WWAN
Haswell devices have EC control of the WWAN power rail.
Expose a new wireless switch enable flag for this under
the existing wirless enable command.

This change also abstracts the wireless enable function
to call a per-board handler so the different boards can
do the right thing based on their GPIO setup.

The haswell boards will switch WLAN radio and WWAN power
rails based on the switch inputs.  These boards do not have
EC control of bluetooth radio/rail power.

WLAN (power and radio) still defaults to enabled.  Disabling
with ectool will turn off the radio but keep the power enabled
in order to prevent the PCIe device from disappearing.

WWAN (power) still defaults to disabled.  Disabling with
ectool will turn off the power rail.

BUG=chrome-os-partner:19871
BRANCH=none
TEST=manual: boot on slippy

DEFAULT:

> ectool gpioget pp3300_wlan_en
GPIO pp3300_wlan_en = 1
> ectool gpioget wlan_off_l
GPIO wlan_off_l = 1
> ectool gpioget pp3300_lte_en
GPIO pp3300_lte_en = 0

ENABLE WWAN:

> ectool wireless 0x7
Success.
> ectool gpioget pp3300_lte_en
GPIO pp3300_lte_en = 1

DISABLE WLAN (radio):

> ectool wireless 0x7
Success.
> ectool gpioget pp3300_wlan_en
GPIO pp3300_wlan_en = 1
> ectool gpioget wlan_off_l
GPIO wlan_off_l = 0

Change-Id: I6f760b8cf5ab47d8f7f0dd8cd4d3e6563464043e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57215
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-03 14:32:07 -07:00
Vic Yang
87d8f8e5b1 Add ectool command to control LED color
This provides a way to control LED color with ectool. We can either set
the color or switch back to automatic control.

BUG=chrome-os-partner:19745
TEST=ectool led red   -> LED turns red.
     ectool led green -> LED turns green.
     Unplug charger   -> LED turns off.
     ectool led green -> LED turns of and shows green.
     ectool led auto  -> LED back to normal.
BRANCH=spring

Change-Id: I0b455f34cea448660fe44a5fecaac1cb084f8144
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56721
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-28 12:53:51 -07:00
Vic Yang
70ada0603c Show power number in 'ectool powerinfo' output
This is just a simple V*I value so that we don't need to do the math all
the time.

BUG=None
TEST=None
BRANCH=None

Change-Id: I6317720d196d4bc2392adefb540be14bc34b5978
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55641
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-20 10:11:03 -07:00
Randall Spangler
1e4b0b6194 Implement I2C passthru command
This is a revised version of passthru which more closely resembles the
kernel interface.  It allows multiple read/write messages in a single
transaction, and sends back one accumulated result.

BUG=chrome-os-partner:18778
BRANCH=none
TEST=On link, from root shell:
    ectool i2cxfer 0 0xb 6 0x21
    Read bytes: 0x05 0x41 0x52 0x52 0x4f 0x57

(I did not actually run this with the updated code)

On pit, in U-Boot:

Read i2c values:
Peach #  crosec i2c md 48 0
0000: 00 00 3e 00 12 20 4b bf ff ff 20 00 1e 1e 1e 1f    ..>.. K... .....
Peach #  crosec i2c md 48 0 20
0000: 00 00 3e 00 12 20 4b bf ff ff 20 00 1e 1e 1e 1f    ..>.. K... .....
0010: 1f 1f 1f 1f 1f 1f 20 00 00 07 00 00 00 00 00 00    ...... .........

Update value at offset 10:
Peach #  crosec i2c mw 48 10 4
Peach #  crosec i2c md 48 0 20
0000: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>....... .....
0010: 04 1f 1f 1f 1f 1f 20 00 00 07 00 00 00 00 00 00    ...... .........
Peach #

On pit, in kernel:

localhost ~ # i2cdetect -y -a -r 20
 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

localhost ~ # i2cdump -f -y 20 0x48
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>.?.???. .????
10: 1f 1f 0e 1f 1f 0e 20 00 00 07 00 00 00 00 00 00    ?????? ..?......
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

localhost ~ # i2cset -f -y 20 0x48 0x10 0
localhost ~ # i2cdump -f -y 20 0x48
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>.?.???. .????
10: 00 1f 0e 1f 1f 0e 20 00 00 07 00 00 00 00 00 00    .????? ..?......
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

localhost ~ # i2cset -f -y 20 0x48 0x10 0x1f
localhost ~ # i2cdump -f -y 20 0x48
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>.?.???. .????
10: 1f 1f 0e 1f 1f 0e 20 00 00 07 00 00 00 00 00 00    ?????? ..?......

Change-Id: I14d47e1712828f726ac5caddc4beede251570ad3
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Updated to simplify protocol:
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49958
Commit-Queue: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
2013-05-09 16:36:53 -07:00
Bill Richardson
d9bddaa072 Improved the BUILD_ASSERT macro to work outside of functions.
This will let us check the size of static array initializers.

Also moved this macro definition and ARRAY_SIZE into a new "tricks.h"
header, so that userspace utils can use it too.

BUG=none
BRANCH=none
TEST=manual

Built everything, tested on Link. Tried various assertions.

Change-Id: I612891108ea37dbca3572e0f25ab54a7bc0ed860
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49417
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-04-29 11:05:08 -07:00
Randall Spangler
08f8c6857f Strip out old LPC command protocol
Nothing has used this since link EVT, so it's just dead code at this point.

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

- Update ectool but leave old firmware
- ectool version -> works
- ectool flashread 0 0x10000 foo -> puts the first 64KB of EC flash into foo

- Update firmware
- ectool version -> works
- ectool flashread 0 0x10000 foo -> puts the first 64KB of EC flash into foo
- power+esc+refresh -> recovery mode

Change-Id: Ib25a705bcd8280d5295c8e7890969d796542b6c9
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47866
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-04-11 11:29:38 -07:00
Vic Yang
13c74da5ad spring: Add host command to limit external power current
This is useful for debugging and the factory.

BUG=chrome-os-partner:18530
TEST=On spring, check we can set PWM duty cycle and can go back to
automatic control.
BRANCH=spring

Change-Id: I3da75f0a356cc0f21d748bf135e3b95fbd9c465b
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47105
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-04-02 20:42:48 -07:00
Randall Spangler
23bbebaeb9 Remove unused EC_SWITCH_KEYBOARD_RECOVERY
This was left over from the way we reported keyboard recovery early in
link/snow, before we had host events.  No shipping EC ever reported it.

Coreboot and u-boot look for this flag, so we can't repurpose it until
they ignore it too.

BUG=chrome-os-partner:18512
BRANCH=none
TEST=compile link,spring

Change-Id: I38fbf0fa7d958c3774c8b293d4be25faaecdadea
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47058
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-04-02 14:12:58 -07:00
Vic Yang
aab9accfce spring: Add host command to read power info
Getting voltage and current can be handy when verifying hardware design.
Let's add host command to do this.

BUG=chrome-os-partner:17880
TEST=Manual on Spring
BRANCH=none

Change-Id: I4d4f6a42a9d0f917292d092e132ccd9ce3367fd6
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43508
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-02-19 23:01:10 -08:00
Randall Spangler
9fde14da9b Rename and document battery constants
In preparation for cleaning up low-battery logic.  Make clear what
comparison operator is used for each constant (<=, <, >=, >).

Also remove hard-coded and unused display of design warning/low
battery levels from ectool.  Verified via code search that these are
not used anywhere.  Even if we later care about these levels, they
should be battery-specific and not hard-coded as a
platform-independent percentage of full capacity when ectool is
compiled.

BUG=chrome-os-partner:17124
BRANCH=link
TEST=compile link; 'ectool battery' from root shell prints valid info

Change-Id: I3650e27a08f4cc77067beb0685ee1488cc56d02f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43119
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-02-12 13:46:44 -08:00
Vic Yang
fd29230988 spring: Add a host command for USB mux switching
To make test and bring-up easier, adds a host command for USB mux
switching.

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

Change-Id: I9da43fe934881ce24f326275ef312c4e6a474f11
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40586
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-01-08 09:30:00 -08:00
Vincent Palatin
3c575ccb02 link: allow to decrease maximum battery charging current
Add an interface to allow the CPU to cap the maximum battery charging
current.
The maximum is removed every time the machine goes to S3 or S5.

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

BRANCH=link
BUG=chrome-os-partner:16041
TEST=on Link, plug AC to charge the battery,
then run "ectool chargecurrentlimit 1200" and see
the charging current in "power-supply-info" decreasing to 1.2 A.

Change-Id: I10900e1c264d2db67809638ec0dcb836d721fa75
Reviewed-on: https://gerrit.chromium.org/gerrit/37532
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2012-11-07 23:48:04 -08:00
Simon Glass
4769627290 ectool: Add keyscan test features
Add a way of easily setting up keyscan tests using a simple text file
format. The steps to run a test are as follows:

- read the test file
- read the key matrix information
- translate the ascii characters from tests into keyscan codes
- send the keyscan codes to the EC
- tell the EC to start the test
- wait for the required time, then collect what input we have received
- check that the input matches the expected input

BUG=chrome-os-partner:12179
BRANCH=none
TEST=manual for now:
On snow:
./ectool keyscan 10000 key_sequence.txt

See that the test passes.

Change-Id: I7de646205803a99443503a1b4bbf32f5fe89c534
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35119
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-11-01 14:09:34 -07:00
Rong Chang
742ec5a1ff snow: fail battery command on unsupported system
GEC exports battery information to host via mapped memory. This change
fails ectool battery command on unsupported system.

Signed-off-by: Rong Chang <rongchang@chromium.org>
BUG=chrome-os-partner:15272
BRANCH=none
TEST=manual, type ectool battery under VT2

Change-Id: I260921eaa679cd3f20fc390472a7e7d64d181a7f
Reviewed-on: https://gerrit.chromium.org/gerrit/37011
Commit-Ready: Rong Chang <rongchang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-11-01 10:09:05 -07:00
Randall Spangler
99011554fa Fix help message for ectool
Not all of the options for reboot_ec were listed.  This fixes the
text; there are no code changes.

BUG=none
BRANCH=none
TEST=run ectool with no options to print help

Change-Id: I65275a007febbd3583f157cc7f8df5634d6eeeda
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36257
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-10-22 14:47:25 -07:00
Bill Richardson
f574f1c37c Make S3 red-light flash adjustable.
This makes the timing for the S3 low-power indicator adjustable without
reflashing.

BUG=chrome-os-partner:8039
BRANCH=Link
TEST=manual

Boot, log in, run this to put the lightbar into demo mode:

  ectool lightbar demo 1
  ectool lightbar seq s3s0

The lightbar should act as though the system is asleep.

Then press the left arrow a couple of times and the down-arrow four or five
times.  You should see the red light pulse every 5 seconds or so.

Now run

  ectool lightbar params > /tmp/w

Edit /tmp/w to change the timing lines to this:

  100             # .s3_ramp_up
  100             # .s3_ramp_down

Then run

  ectool lightbar params /tmp/w

After a cycle or two, you should see the lightbar flash instead of pulse.

Change-Id: If815ff2fb9a158c0e1f4dbb6a269ad07e122d84c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35839
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-10-17 12:50:26 -07:00
Bill Richardson
aadfab96c0 Fix lightbar bug, add more tweaks.
I introduced a glitch in the parameterization CL. This fixes it, and makes
the choice between the gentle throbbing and occasional pulse something that
can be selected as a parameter. Default is the new pulsey style.

BUG=chrome-os-partner:8039
BRANCH=Link
TEST=manual

Using the ectool that's part of this change, run these commands to flip
between suspend and active displays:

  ectool lightbar seq s3s0
  ectool lightbar seq s0s3

Change the "new_s0" value (0/1) and reload the params with

  ectool lightbar params | tee /tmp/w
  vi /tmp/w
  ectool lightbar params /tmp/w

In each case you'll see some pretty patterns. Pass/Fail is an artistic
decision. No QA required.

Change-Id: I8de0b1b3cc77f65879befe95e110bbbce18846d9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35620
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-10-15 17:47:01 -07:00
Bill Richardson
eb59ac66bd Set minimum brightness to 35%, variable osc settings.
BUG=chrome-os-partner:8039
BRANCH=Link
TEST=none

More cosmetic changes.

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I1fd9318131ce55541d845ac8be5faa9334c3953f
Reviewed-on: https://gerrit.chromium.org/gerrit/35484
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-10-14 18:57:58 -07:00
Bill Richardson
d6f05e0d61 Parameterize the lightbar behavior as much as possible.
This change replaces most of the hard-coded lightbar constants with values
that can be updated at run-time, so that if we change our minds about colors
and timing we can tweak some of the values without requiring an EC/BIOS
update.

It also adds the "ectool lightbar params" command to get and set those
values from the host. You can see the values from the EC console ("lightbar
params"), but there's no way to set them.

BUG=chrome-os-partner:8039
BRANCH=Link
TEST=manual

From the EC console, run

  lightbar params

It should display the current values that can be changed.

Log in to the host and run this to see the same values:

  ectool lightbar params

Or edit and change them with this:

  ectool lightbar params > /tmp/vals.txt
  vi /tmp/vals.txt
  ectool lightbar params /tmp/vals.txt

The updated parameters are persistent across EC jumps (RO->RW), but are lost
when/if the EC reboots (as it will after the AP is off for 24 hours, for
example).

Change-Id: Ic2a3fd6f8062673432b48904933e0c7239b8658b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35289
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-10-11 14:24:43 -07:00
Randall Spangler
23fe5ed867 link: Added sensor-not-calibrated error for TMP006
BUG=chrome-os-partner:15174
BRANCH=link
TEST=manual, from root shell
 - ectool temps all -> prints all temps
 - ectool tmp006cal 1 0 0 0 0
 - ectool temps all -> sensor 3 not calibrated

Change-Id: I16ee818c948fe90ac7c18b230c5d9f9a0ec83ded
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35288
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-10-11 14:24:40 -07:00
Randall Spangler
d1bebbbe66 Add host command to get/set TMP006 calibration data
Needed for host-based thermal control and tweaking.

BUG=chrome-os-partner:14955
BRANCH=link
TEST=manual

From a root shell,
  ectool tmp006cal 0 3.5e-14 -2.8e-5 -5.5e-7 4.5e-9
  ectool tmp006cal 2 3.6e-14 -2.9e-5 -5.6e-7 4.6e-9
  ectool tmp006cal 0
    S0: 3.500000e-14
    b0: -2.800000e-05
    b1: -5.500000e-07
    b2: 4.500000e-09
  ectool tmp006cal 2
    S0: 3.600000e-14
    b0: -2.900000e-05
    b1: -5.600000e-07
    b2: 4.600000e-09

At the ec console, "t6cal" should show the settings took effect as well.

Change-Id: If43b11e1e827483f0a20db1a2e5644f3475fd95e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35215
2012-10-11 13:47:17 -07:00
Simon Glass
dd2d41003d stm32: Implement keyscan configuration command
Implement a command to allow getting and setting the keyboard
configuration.

BUG=chrome-os-partner:12179
TEST=manual
- use ectool to read all keyscan paramters
- use ectool to update flags to 0, see that keyboard stops working,
then set flags to 1 and see that it starts working again.
- use ectool to update scanning period to 100ms, see that it drops lots
of keys when typing
- use ectool to set fifo size to 1, see that the fifo no longer fills
up

Change-Id: I5afb3b48b1262a1570d7411ffd8b2e6ea3a65f6b
BRANCH=snow,link
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34635
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-10-05 10:41:21 -07:00
Randall Spangler
a9e8f809a3 link: add hibernate option to ectool reboot_ec
This enables the OS to request the EC drop into its lowest-power
shutdown state.  Targeted at end of factory flow, where the
at-shutdown variant is the desired variant because it allows the main
processor to shut down cleanly first.

BUG=chrome-os-partner:14838
BRANCH=link
TEST=from root shell,
  ectool reboot_ec hibernate at-shutdown
  shutdown -h now

System should shut down, and EC console should be unresponsive (since
it's hibernating).  Press power button, and system should power back on.

  ectool reboot_ec hibernate

System should shut down immediately.  Press power button, and system
should power back on.

Change-Id: I8084a3a1bca6b7c201e090552b193fe1568708a2
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34569
Reviewed-by: Vic Yang <victoryang@chromium.org>
2012-10-04 09:30:59 -07:00
Randall Spangler
2768a49fd1 link: Add more info to 'ectool battery'
Now prints the rest of the memory-mapped battery info.

BUG=chrome-os-partner:14630
BRANCH=link
TEST=ectool battery, then compare with 'battery' at ec console

Change-Id: I3f5222d898bbcb8b79774a5848f9aed0067a0d49
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34424
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-10-02 12:51:50 -07:00
Randall Spangler
5943e6c1f5 Clean up reboot host command
1) Only send the host response immediately for commands which won't
return.  This prevents double-sending a response for the disable-jump
command.

2) Remove references to the POWER_ON flag.  This was never implemented
or used, since with EC software sync the EC always powers on after
rebooting.

3) Fix help text for reboot_ec command.  (Both "A" and "RW" still do the
same thing, but "RW" is now the preferred option string.)

BUG=chrome-os-partner:12635
BRANCH=link (also applies to snow, but don't pick unless needed)
TEST=from a root shell,

flashrom -p internal:bus=lpc -r /tmp/ec.bin
flashrom -p internal:bus=lpc -w /tmp/ec.bin
ectool reboot_ec RW
ectool reboot_ec RO
ectool disable-jump

All commands should succeed.

Change-Id: Ibf5b4fb88d93e64fc7361a9f962ec7aa1df0cf3c
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34051
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
2012-09-26 11:31:31 -07:00
Bill Richardson
e802e4fa37 Refactor lightbar host command to pass messages the new way.
We recently changed the way host messages are passed to the EC to make it
work nicer across I2C. When we did, we updated all the internal structs
except those used for lightbar commands. This CL updates the lightbar
commands too.

BUG=chrome-os-partner:11277
BRANCH=all
TEST=manual

This shouldn't change anything, but you can ensure that by poking at the
lightbar manually. On Link, run this from a root shell:

  ectool lightbar seq stop
  ectool lightbar 4 ff 00 ff
  ectool lightbar seq run

With the first command, the lightbar pattern should freeze.
With the second command, it should turn magenta.
With the third command, it should resume pulsing as before.

Change-Id: Ic5dc4c827b3b4459288d7d9bd7d06af8a5176b3c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33798
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-09-21 16:48:53 -07:00
Randall Spangler
c0a2d9befb Reset LPC from-host channel status on LPC reset
This works around a LM4 bug where the LPC module stops triggering
interrupts for a channel if bytes are written too rapidly to that
channel.  This should only affect port 80 because other channels use
busy-status-handshaking to avoid flooding the EC.

BUG=chrome-os-partner:12349
BRANCH=link
TEST=manual

1. From a root shell: ectool port80flood
2. Repeat until the EC console stops showing port 80 codes coming in
3. From a root shell: reboot
4. Port 80 codes should be printed by EC as the BIOS boots

Change-Id: I3b3463ce668727cad9900b576fdeb531986a415e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33142
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2012-09-17 12:16:01 -07:00
Randall Spangler
88ff608ae2 Add capability to auto-hash correct size for EC-RO or EC-RW
Otherwise the host needs to tell the EC how big this image is (which
it knows, but it's inconvenient for it to provide).

BUG=chrome-os-partner:13511
BRANCH=all
TEST=manual

1. ectool echash recalc ro -> prints hash of RO code (offset 0)
2. ectool echash recalc rw -> prints hash of RW code (offset non-zero)

In each case, size should be an exact number and not the size of the
whole RO or RW section.  So for link, output should be something similar to:

  localhost ~ # ectool echash recalc ro
  Hashing EC-RO...
  status:  done
  type:    SHA-256
  offset:  0x00000000
  size:    0x00012a64
  hash:    03a66c076d6dd4b4aa9ed6386713f45291f5143f9af2093003e632485899daf1
  localhost ~ # ectool echash recalc rw
  Hashing EC-RW...
  status:  done
  type:    SHA-256
  offset:  0x00014000
  size:    0x000123d1
  hash:    0d6225e70f0b1e0419e987370371e00783f945827ef25915a8fb8549159dd2a4

Signed-off-by: Randall Spangler <rspangler@chromium.org>

3. At ec console, 'hash ro' or 'hash rw' should regenerate the same
hash values printed above.

Change-Id: I3f6085d29927b8cdf9dabc6930f0fdc7222bd8b5
Reviewed-on: https://gerrit.chromium.org/gerrit/33123
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Randall Spangler <rspangler@chromium.org>
2012-09-12 15:42:25 -07:00
Vic Yang
c23dc46073 Add host command to dump charge state machine context
This is a temporary debug command and will be reverted once unnecessary.

BUG=chrome-os-partner:12801
TEST=Manual
BRANCH=link

Change-Id: Ib1b4221db31ed2521762ee32748bd9d2e177229d
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32696
Reviewed-by: Rong Chang <rongchang@chromium.org>
2012-09-10 03:06:19 -07:00
Louis Yung-Chieh Lo
e1f4dfc082 comm-i2c.c upgrades to protocol v2.
Old i2c code uses protocol v1, which cannot handle veriable-length
response (unknown lenght to calculate checksum).

So, upgrade to procotol v2 anyway since command v1 needs protocol v2.

BUG=chrome-os-partner:11608,
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
BRANCH=None
TEST=on snow, and both command v0/v1 are working on protocol v2.
ectool version
ectool hello
ectool echash
ectool flashinfo
ectool flashprotect
ectool flashwp

Change-Id: Id8532fe51359dce18839d37de8a8c8669754041c
Reviewed-on: https://gerrit.chromium.org/gerrit/31838
Commit-Ready: Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
2012-09-05 02:24:07 -07:00
Louis Yung-Chieh Lo
b0542c587c Support battery cut-off mechanism for factory.
The cut-off command is manufacturer-specific. Thus the logic is implemented
in gas gauge IC code. For those boards using this gas gauge, define
the CONFIG_BATTERY_BQ20Z453 in board.h.

BUG=chrome-os-partner:12962,
BRANCH=snow
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
TEST=Tested on snow
ectool batterycutoff   ; expect system is off immediately
                       ; if AC power is not connected.

Change-Id: Idd290c76439f3263c1c812b236b79623878f73b2
Reviewed-on: https://gerrit.chromium.org/gerrit/31466
Reviewed-by: Rong Chang <rongchang@chromium.org>
Commit-Ready: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
2012-08-28 04:39:56 -07:00
Louis Yung-Chieh Lo
b11c1e234b Rename EC_FLASH_PROTECT_RW_* flags to EC_FLASH_PROTECT_ALL_*.
Current *_RW_NOW/RW_AT_BOOT is used to lock the entire flash. This could
lead confusion in the future. So, rename them.

Since the bit definition is unchanged, thus the callers (u-boot, flashrom)
is fine if they don't change the name.

BUG=chrome-os-partner:12951
BRANCH=snow,link
TEST=build in chroot only:daisy,snow,link,bds
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>

Change-Id: I2395e93793f590e6fb8aae7006eb8e5c836002bc
Reviewed-on: https://gerrit.chromium.org/gerrit/31199
Commit-Ready: Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-25 15:12:41 -07:00
Bill Richardson
ede77d7cac Add "lightbar demo" mode for executive bikeshedding
I keep getting asked to build an EC image to manually control the lightbar
patterns so that the Powers That Be can look at it. This change just makes
it possible to turn that mode on and off for yourself. You'll need a root
shell or the EC console to do it, though.

BUG=chrome-os-partner:8039
BRANCH=link
TEST=manual

From the EC console, type

  lightbar demo 1

OR from the root shell run

  ectool lightbar demo 1

After that, these keys should change the lightbar appearance (transitions
may be slow and subtle - that's intended):

  UP = battery is more fully charged
  DOWN = battery is less fully charged
  RIGHT = battery is charging
  LEFT = battery is discharging
  BRIGHT = increase lightbar brightness
  DIM = decrase lightbar brightness

Note that this does not interfere with the normal function of any keys. It
only adds some additional EC behavior.

Change-Id: Ia1a9855188244d74b670f9dbfdf60e3ac0343460
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30899
2012-08-20 15:44:50 -07:00