Commit Graph

2024 Commits

Author SHA1 Message Date
Shawn Nematbakhsh
f2ea8d729d kevin: Don't disable both charge ports when we source VBUS
Ensure we're not charging from the port we're sourcing, but don't touch
the other port.

BUG=chrome-os-partner:52315
BRANCH=None
TEST=Attach unpowered peripheral + zinger to kevin and go to S0. Verify
that we continue pulling current from zinger at 3A.

Change-Id: Ic22b10e9ae08459cf062d7a51c9d627832d9ed63
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338833
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-04-13 18:37:16 -07:00
Mary Ruthven
52f7b3a0c8 cr50: default to CCD PHY
While kevin is still in development default to connecting to the CCD PHY
instead of the AP PHY. This will automatically enable CCD instead of
having to rely on things working to detect the debug accessory and
switch to the proper PHY.

We also disable the TX lines to the AP and EC, in case servo is
connected. To turn them on manually, use these console commands:

  rw 0x40060040 74
  rw 0x400600c8 78
  pinmux
  gpiocfg

BUG=chrome-os-partner:50700,chrome-os-partner:52281,http://crosbug.com/p/52322
BRANCH=none
TEST=hook up suzy q to kevin. Run 'lsusb -vd 18d1:5014' and check that a
device appears.

Change-Id: Ic2802430680adc6186982022c995ee6f452b45fd
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338680
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Trybot-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
2016-04-13 18:31:53 +00:00
Bill Richardson
66af587cbc Cr50: Enable RW FW updates over USB
This enables the Cr50 to accept RW firmware updates over USB.

BUG=chrome-os-partner:50707, chrome-os-partner:50712
BRANCH=none
TEST=make buildall; test on Cr50

Build and run the extra/usb_updater utility. Watch the console,
and observe that the Cr50 updates and reboots into the new image
correctly.

Note that you'll have to rebuild the ec.bin image in order for
the update to take effect. Just reflashing the same image doesn't
cause the bootloader to change its selection.

All the previously existing endpoints continue to function normally.

Change-Id: I7bd22eae803c2ceeb14a767c06d3d5c9f1ac7c7a
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338089
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
2016-04-12 19:00:31 -07:00
Bill Richardson
4246bfa62f Cr50: New usb_upgrade module for RW updates
This re-factors the existing firmware upgrade facility, which worked as
a TPM command extension.

The same code processing upgrade blocks prepended by the truncated
SHA1 and the load address is now used by both extended TPM command and
the USB upgrader.

To accommodate USB communications using a smaller message payloads a
reassembly layer is introduced which accumulates short USB payloads
into a single block which can be passed to the firmware upgrade
routine. USB encapsulation adds one 4 byte header at the beginning of
the block to hold the total block size. The reassembly layer keeps
receiving USB messages, concatenating their payloads until the full
block is received.

A config option is added to make sure the module is not compiled when
not needed.

BUG=chrome-os-partner:50707
BRANCH=none

TEST=make buildall; test on Cr50 - with the rest of the patches
     applied it is possible to upgrade firmware using the USB utility
     on the host..

Change-Id: Ib30b381c4ab196ea9d352f3c6b8f46dc23ddd599
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338087
2016-04-12 19:00:31 -07:00
Shawn Nematbakhsh
e6533d36a8 chell: pmic: Delay disable of V0.85A
Various voltage rails will be enabled / disabled by the PMIC when
GPIO_PMIC_SLP_SUS_L changes. We need to delay the disable of V0.85A
by approximately 25ms in order to allow V1.00A to sufficiently discharge
first.

BUG=chrome-os-partner:52047
TEST=Probe V1.00A and V0.85A during power-down, verify V1.00A discharges
faster than V0.85A.
BRANCH=glados

Change-Id: Ibbf4f989e1814e131dc373d2b5da9b6fa1ac9cce
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/337325
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-04-12 13:41:44 -07:00
Shawn Nematbakhsh
80680c7ffc chell: pmic: enable 100 ohm discharge on V1.00A
BUG=chrome-os-partner:52047
TEST=Probe V1.00A during power-down, verify that voltage goes to 0V
noticeably faster than with no discharge.
BRANCH=glados

Change-Id: Id13572d5bf4457eeaa57b9e1b05a85c957f07389
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/337394
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-04-12 13:41:43 -07:00
Dino Li
35e8490a63 chip: it83xx: disable USB module's clock at default
The GPIOH.5/6 are reserved for USB module and the
clock is disabled before configuring it.

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=Clock is disabled at default.

Change-Id: If679ab3de13019f19a936b9a412b20973fb8989f
Reviewed-on: https://chromium-review.googlesource.com/338066
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-04-11 20:08:27 -07:00
Shawn Nematbakhsh
7ec7e0d4a1 chell / kunimitsu / lars: Enable CONFIG_USB_PD_COMM_LOCKED
Enable CONFIG_USB_PD_COMM_LOCKED to disable PD communication in locked
RO.

BUG=chrome-os-partner:52157
TEST=Manual on chell. Lock system and boot to recovery, then verify PD
communication isn't functional/
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I168997d4be2471283f5f53a3ff9eaacfb871ab65
Reviewed-on: https://chromium-review.googlesource.com/338065
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-04-11 14:36:40 -07:00
Shawn Nematbakhsh
d2e77ddbc9 pd: Add config to disable PD communication in locked RO
The scheme to disable PD communication in locked RO needs to be
implemented on other platforms, so move it to common code, behind
CONFIG_USB_PD_COMM_LOCKED.

BUG=chrome-os-partner:52157
BRANCH=glados
TEST=Manual on chell. Lock system and boot to recovery, then verify PD
communication is functional. Enable CONFIG_USB_PD_COMM_LOCKED and verify
PD communication isn't functional under the same test conditions.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I8d1f24c0b60cf1c54e329af003b7083ee55ffc40
Reviewed-on: https://chromium-review.googlesource.com/338064
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-04-11 14:36:40 -07:00
YH Huang
a3341ee7e9 oak: increase HOSTCMD task stack size
Use LARGER_TASK_STACK_SIZE to increase stack size to 640 bytes.
Check HOSTCMD stack usage with "taskinfo" command while running
the suspend/resume stress test.

8 R HOSTCMD          00000001   21.133553  496/640

It exceeds 488 bytes of TASK_STACK_SIZE.

BUG=chrome-os-partner:51773
BRANCH=none
TEST=enter "suspend_stress_test -i spi32766.0" in AP to do
suspend test. System won't do cold reboot which is cause by
"Stack overflow in HOSTCMD task!".

Change-Id: Ic5edebc6b77637ca2c648798398e3f24bc87ca27
Signed-off-by: YH Huang <yh.huang@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/336593
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-04-11 04:14:59 -07:00
Mary Ruthven
a5e74e6b45 cr50: forward console through USB
This change adds support for forwarding the EC console through USB.

BUG=chrome-os-partner:49960
BRANCH=none
TEST=load the google-serial udev rules in extra/usb_serial/, build the
raiden.ko module, and then check that the console can be accessed from
/dev/google/Cr50/serial/Shell

Change-Id: I35e0bb39fdc8f9485a14c03eb3a4d2f024884e17
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/334132
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-07 13:00:41 -07:00
Mary Ruthven
8a0d5ba17e cr50: enable AP and EC UART forwarding
Cr50 will be used to debug the EC and AP through USB. This change
enables exporting the EC and AP UART through USB by adding the endpoints
and enabling the UART and USB streams.

BUG=chrome-os-partner:50702
BRANCH=none
TEST=Load the serial driver in ec/extras and verify that the EC and AP
UARTs can be accessed through /dev/google/Cr50*/serial/AP and EC.

Change-Id: I3249b250d0ecc41a206c45c5ca66b5a6a5622e62
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/337294
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-07 13:00:39 -07:00
Mary Ruthven
8264b91a5b cr50: export AP and EC UART through USB
Add support for exporting the EC and AP UARTs to USB.

BUG=chrome-os-partner:50702
BRANCH=none
TEST=Verify the EC and AP UARTs are forwarded to the EC and AP endpoints

Change-Id: Icaeb7929dbaaf71a40f0752aa6cb5a2319373651
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336317
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-07 13:00:39 -07:00
Mary Ruthven
fa643a9fc7 cr50: add support for creating multiple serial endpoints
CR50 will need three serial endpoints for the streaming AP and EC UART
and exporting its own console through USB. This change adds a macro to
create endpoints that can be recognized by the usb_serial driver.

BUG=chrome-os-partner:50702
BRANCH=none
TEST=Verify "/dev/google/Cr50*/serial/Blob" prints capital letters when
lower case letters are input.

Change-Id: Iddf2c957a00dc3cd5448a6a00de2cf61ef5dd84c
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336441
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-07 13:00:39 -07:00
Vincent Palatin
1a5fd44c31 chell: increase HOSTCMD task stack size
Some host commands might trigger a stack overflow on HOSTCMD, let's
increase the stack size for this task.

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

BRANCH=glados
BUG=chrome-os-partner:51633
TEST=run 'ectool usbpd 0 sink' and verify stack canary with 'taskinfo'

Change-Id: Ida6d1656bd14c6a728a4d6624b4fe10fe4b02423
Reviewed-on: https://chromium-review.googlesource.com/334892
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
(cherry picked from commit 952b20a8d7894e1c72c67ada2d25298157f51b79)
Reviewed-on: https://chromium-review.googlesource.com/337306
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
2016-04-06 22:10:10 -07:00
Bill Richardson
5aec786f4c Cr50: Specify pinmux wake sources in gpio.inc
This adds (and uses) some additional flags for gpio.inc's
PINMUX() macro, to configure specific pads as wake sources when
the SoC is sleeping.

BUG=chrome-os-partner:49955
BRANCH=none
TEST=make buildall; test on Cr50

The sleep/deep sleep behavior is unchanged. This just replaces
hard-coded wake sources with pads configured in gpio.inc and the
chip/g/sps.c module. Tests from previous CLs still pass.

Change-Id: I6608dc959524f42fd589feb804fa06f29cfd9b9c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336838
Reviewed-by: Dominic Rizzo <domrizzo@google.com>
2016-04-05 16:54:03 +00:00
Kevin K Wong
bf24d5b264 temp sensor: add support for G782
modify g781.c/.h to g78x.c/.h to suppor both G781/G782 temp sensor
based on CONFIG_TEMP_SENSOR_G781 or CONFIG_TEMP_SENSOR_G782

BUG=none
BRANCH=none
TEST=make buildall; able to get temperature data on board with G782

Change-Id: Ia32c85e9964bfd7c0c5263f04368bc001a27fe10
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/334228
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-04-03 10:27:40 -07:00
Shawn Nematbakhsh
33fd731ca1 charge_manager: Report UNKNOWN USB charger for 2 seconds after change
After a charger is attached, we may set a charge limit based upon BC1.2
or USB-C Rp before PD negotiation completes. Therefore, allow 2 seconds
for all negotiation to complete. Previously this behavior was implicit
when using SW charge ramp.

BUG=chrome-os-partner:51280
BRANCH=glados
TEST=Manual on chell. Insert stock charger, verify that it is detected
as TYPE_UNKNOWN until timeout.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I52f02de46fa92b66a9fbaddb94a062310688f028
Reviewed-on: https://chromium-review.googlesource.com/334312
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-04-03 10:27:36 -07:00
Shawn Nematbakhsh
be731e262c samus_pd: Use less flash space
- Reduce the size of some board-level strings
- Undef two rarely-used console commands

BUG=chrome-os-partner:34489
BRANCH=None
TEST=`make buildall -j`

Change-Id: I34d599adccce97a62e28e7444854081f068029c3
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336814
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-04-03 10:27:36 -07:00
Devn Lu
93be0c3b0a ectool: Support keyboard factory scanning
This is keyboard test mechanism request for "multiple key press test",
we can thru the testing to scan out kso ksi pins shortting or keyboard has
multiple key pressing, below was the testing steps:

1. Turn off internal keyboard scan function.
2. Set all scan & sense pins to input and internal push up.
3. Set start one pin to output low.
4. check other pins status if any sense low level.
5. repeat step 3~4 for all keyboard KSO/KSI pins.
6. Turn on internal keyboard scan function.

BUG=chrome-os-partner:49235
BRANCH=ToT
TEST=manual
  Short any KSO or KSI pins and excute "ectool kbfactorytest", it shows failed.
  if no pins short together, it shows passed.

Change-Id: Id2c4310d45e892aebc6d2c0795db22eba5a30641
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/332322
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-04-01 00:21:35 -07:00
Kevin K Wong
6711629163 sensor: update sensor driver to use I2C port from motion_sensor_t
this allow motion sensor devices to be locate on different I2C port

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: Ia7ba2f5729ebb19561768ec87fdb267e79aafb6a
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/334269
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-31 21:35:56 -07:00
Mary Ruthven
59c03bc4c6 cr50: enable use of multiple UARTs
cr50 has three UARTs that it will be using. This change modifies the
uart api to specify which uart to use.

BUG=chrome-os-partner:50702
BRANCH=none
TEST=change the interrupts and CONFIG_UART_CONSOLE to see that the
different UARTs can be used.

Change-Id: I754a69159103b48bc3f2f8ab1b9c8b86cea6bea5
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/333402
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-03-31 14:53:54 -07:00
Shawn Nematbakhsh
e2deea3649 kevin: Add battery and charger support
Add support for bd99955 charger and battery.

BUG=chrome-os-partner:51722
TEST=Verify kevin charges at 3A input current when zinger is inserted,
and verify battery actually charges.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Iccd8185585fe39440681f5830cf58acafe6291b8
Reviewed-on: https://chromium-review.googlesource.com/335538
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-03-31 14:53:52 -07:00
nagendra modadugu
7aa42e2ba9 CR50: add NULL padding support for RSA encrypt/decrypt
NULL padding (aka vanilla RSA) support is required by
the TPM2 test suite (referred to as TPM_ALG_NULL in the
tpm2 source).

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=tests under test/tpm2 pass

Change-Id: I9848fad3b44add05a04810ecd178fbad20ae92cc
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/328830
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Nagendra Modadugu <ngm@google.com>
2016-03-31 07:08:01 -07:00
Bill Richardson
91684d5e33 Cr50: Add stubs to support low-power idle
This just adds the framework to use for implementing sleep and
deep-sleep. This provides a custom idle task, and a new "idle"
console command to control what that task should do (nothing,
yet).

BUG=chrome-os-partner:49955
BRANCH=none
TEST=make buildall; test on Cr50

Other than the new idle command which does nothing, there is no
visible change. This is just a stub.

Change-Id: I8a9b82ca68dd6d1e3e7275f4f6753a23a7448f1d
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336420
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-03-30 20:38:12 -07:00
nagendra modadugu
19bfaa46e5 CR50: add support for RSA PKCS1-PSS padding
Add support for PSS padding as per RFC 3447.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=tests under tpm2 pass

Change-Id: I14c58394f742daa5de4ec2fbeb7e7f14e54c9fcc
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/328778
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Nagendra Modadugu <ngm@google.com>
2016-03-30 20:38:12 -07:00
Mary Ruthven
170d6bdd44 cr50: update GPIOs
Update the GPIO mapping based on the Kevin P0 schematic and drive the EC
and AP select signals low.

BUG=chrome-os-partner:50728
BRANCH=none
TEST=test that DIOB2 and B3 default to low, but can be set high or low.

Change-Id: If574436913ad0271540bcce2939fe1f4574dae97
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/335381
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-03-29 15:56:30 -07:00
Shawn Nematbakhsh
fa2b676d6c kevin: Change battery i2c frequency to 100 KHz
Battery does not support frequency higher than 100 KHz.

BUG=chrome-os-partner:51722
TEST=Verify `battery` on kevin shows battery stats.
BRANCH=None

Change-Id: Ia75e0ffec9344dfc432205acce0ad31ca6d3fb3e
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/335374
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-03-29 15:56:22 -07:00
Shawn Nematbakhsh
bfb7b69029 power: rk3399: Add power down sequencing
Add simple power down control for rk3399.

BUG=chrome-os-partner:51722
TEST=Verify power button powers up SOC. Verify next power button press
powers down SOC.
BRANCH=None

Change-Id: Ibf4c9c3cb155b59ca7f2b6feb4f51ff173f407c7
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/335531
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-03-29 15:56:22 -07:00
Bill Richardson
fabb15c706 Cr50: Remove CONFIG_HOSTCMD_SPS support
This config option allowed us to disable the TPM protocol on the
SPI slave bus and replace it with our EC-style host command
protocol. We only used this for early testing and don't need it
anymore, so we can get rid of it completely for this SoC.

BUG=none
BRANCH=none
TEST=make buildall; test on cr50

Change-Id: I2126537e8bcc78e583cf426a3a83962c9ff1a121
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/334762
Reviewed-by: Scott Collyer <scollyer@chromium.org>
2016-03-24 20:51:06 +00:00
YH Huang
dbc03d1bf9 oak: allow charging of dead battery requesting nil
On oak battery, when the battery is dead it reports 0 for desired
voltage, current, and state of charge. In this case we should allow
charging.

Added a CONFIG option for this that should be removed as soon as
the battery side is fixed.

With this CL, when a dead oak battery is used and a charger is
connected, we attempt to charge it.

BUG=chrome-os-partner:51454
BRANCH=none
TEST=test on an oak with a dead battery. w/o this CL, the battery
never charges because the charging not allowed flag is set. With this
CL, the battery charges.

Change-Id: If9f1250cd41aec265838e1d109f53c1bcd58c111
Signed-off-by: YH Huang <yh.huang@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/334471
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-23 02:44:46 -07:00
Dino Li
ba6e37787a it83xx: keyboard: remove "CONFIG_IT83XX_KEYBOARD_KSI_WUC_INT" and fix ISR
1. Always use wake-up control interrupt for keyboard KSI. This can also
   wake-up EC from deep doze / sleep mode.
2. In keyboard ISR, we just clear interrupt status to prevent keyboard
   interrupt can't be re-enabled.
   (for example, a KSI interrupt wakes up keyboard scan task,
   but keyboard_raw_read_rows() got 0.)

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=keyboard function is normally.

Change-Id: If8c292189c6133b179a63dedcb7a18abbc091312
Reviewed-on: https://chromium-review.googlesource.com/333865
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-03-22 21:39:26 -07:00
Dino Li
47e2912f4b chip: it83xx: remove "CHIP_FAMILY_IT839X"
The new IC is backward compatible with it839x, so we removed it.

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=make -j buildall

Change-Id: I8de3d3c13b0f07f50ffffffc80723e44a923c7c8
Reviewed-on: https://chromium-review.googlesource.com/333864
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-03-22 21:39:24 -07:00
Anton Staaf
fa1653d240 GPIO: Rename and move board_set_gpio_hibernate_state
This function is no longer GPIO specific and fits better as part of the
system API, so this moves it there and renames it board_hibernate_late.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

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

Change-Id: I39d3ecedadaaa22142cc82c79f5d25c891f3f38c
Reviewed-on: https://chromium-review.googlesource.com/330124
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-21 13:16:35 -07:00
Nick Sanders
d3a8bd0c36 servo_micro: add initial servo_micro build
* Update flash_ec to allow flashing servo_micro
* Add servo_micro build

BUG=chromium:571477
BRANCH=None
TEST=updated servod is able to control gpio, gpio extender,
     SPI flash, ec uart, ap uart on test yoshi

Signed-off-by: Nick Sanders <nsanders@google.com>

Change-Id: I4d69c83ae581cb41da928a27c39b7152475d7ca8
Reviewed-on: https://chromium-review.googlesource.com/327214
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-03-16 16:19:53 -07:00
Koro Chen
74d2e46ea3 oak: Clean up CONFIG_PMIC_FW_LONG_PRESS_TIMER related codes
CONFIG_PMIC_FW_LONG_PRESS_TIMER was ported long time ago from
Tegra, but the codes are actually not used and erroneous.
It might wrongly trigger set_pmic_pwron(0), and turn off
PMIC power accidentally. This causes POWER_GOOD lost and
power state will go back to S5 during boot up.

Clean up the codes by referencing check_for_power_off_event()
of Rockchip.

BRANCH=none
BUG=none
TEST=bootup and press power button quickly right after we are in S0.
Bootup should still complete normally.

Change-Id: Ie034efa3575dbebae4debb1afc206fddd9116350
Signed-off-by: Koro Chen <koro.chen@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/332724
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-16 06:43:24 -07:00
Wei-Ning Huang
51fa74ec6f oak: rev5: increase cycle time for LED in SUSPEND
Increase LED blink cycle time to reduce power consumption on Oak rev5
with GlaDOS ID.

BUG=chrome-os-partner:50317
TEST=`make EXTRA_CFLAGS=-DBOARD_REV=5 BOARD=oak -j`

Change-Id: Ic00512434965471a82b94ef431e0ec88c9e4c0c3
Reviewed-on: https://chromium-review.googlesource.com/332346
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2016-03-16 02:28:45 -07:00
Duncan Laurie
e21f3401e1 chell: Indicate when charging in suspend
Currently when in suspend the LED blinks white no matter what the
state of the battery or charging is.  This is very confusing for
users who expect to be able to plug in a charger with the system
in suspend and see that it starts to charge.

Past platforms from this OEM have had two LEDs so this has not
been an issue.

BUG=chrome-os-partner:49151
BRANCH=glados
TEST=put chell in suspend, plug in charger to see amber LED and
then remove the charger and see that it blinks white again.

Change-Id: I60e849d7b8b717fb568d7d5d64046621c1c34157
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/332625
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-15 18:05:56 -07:00
Shawn Nematbakhsh
1f74a45132 kevin: Add rk3399 power sequencing
BUG=chrome-os-partner:50819
BRANCH=None
TEST=`make buildall -j`

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I4e1c44a897aae7f22605911fbf4e8de3056b9bbd
Reviewed-on: https://chromium-review.googlesource.com/331659
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-03-14 20:11:25 -07:00
Bill Richardson
1c0b8dc816 Cr50: cleanup: put macro args inside parens
Just to be safe...

BUG=none
BRANCH=none
TEST=make buildall; try on Cr50 board

Change-Id: I5b605a50f85dbfeb404fa93b59d795b7f8a0d5c5
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/332197
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-03-11 15:17:33 -08:00
Kevin K Wong
5ed0b29cec kunimitsu: remove CONFIG_POWER_SHUTDOWN_PAUSE_IN_S5
skylake.c does not make use of pause_in_s5 and related code, so
it will always has 10 second pause in POWER_S5 before transition
to POWER_S5G3, and this CONFIG flag is adding about 290 bytes of
unused code for host command and console command.

BUG=none
BRANCH=firmware-glados-7820.B
TEST=make buildall; system can shutdown and enter SOC-G3 properly

Change-Id: I1d507b925e13f794e9826a43ebdad898087a6663
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/332025
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-11 15:17:30 -08:00
Kyoung Kim
c914d38c92 Kunimitsu/Lars: correct adc voltage reading
Add adc correction parameter for VBUS channel.

BUG=chrome-os-partner:49192
BRANCH=glados
TEST=make -j buildall

Change-Id: Ia613d92936a1f4d2dcd9f1cd26f43ecfe9c0eab1
Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/331401
Commit-Ready: Kyoung Il Kim <kyoung.il.kim@intel.com>
Tested-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-11 15:17:29 -08:00
Shawn Nematbakhsh
d0523f15d2 kevin: Initial board commit
Initial EC board support for kevin, a npcx5m5g part with SPI host
interface.

BUG=chrome-os-partner:50819
BRANCH=None
TEST=`make BOARD=kevin`

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I0d878edd7e8c7f59cfcb8e16637a5b589552eba9
Reviewed-on: https://chromium-review.googlesource.com/330856
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-03-10 15:24:09 -08:00
Ryan Zhang
6c116f0ffc Lars: Manually Revert "Lars: Add ALS support"
- als
* revert#315470 has conflict error msg

BUG=chrome-os-partner:50730
BRANCH=lars
TEST=`make -j buildall`

Change-Id: I955916d5ff052820337aac8e59ff38af33655320
Signed-off-by: Ryan Zhang <Ryan.Zhang@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/331004
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-08 19:43:07 -08:00
nagendra modadugu
6e0de1df5f CR50: move platform independent stub calls back to third_party
Move _math__Comp and _math__uComp from stubs.c back to
third_party/tpm2 as they are platform independent.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
CQ-DEPEND=CL:330855
TEST=compilation succeeds

Change-Id: I2a1611e0b264720d71ac1fa0935cfa2498e04fdc
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/330951
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-03-08 19:43:04 -08:00
Shawn Nematbakhsh
541de8a5a3 npcx: Rename CONFIG_SHI to CONFIG_HOSTCMD_SPS
CONFIG_SHI ("SPI host interface") has identical meaning to
CONFIG_HOSTCMD_SPS ("Accept EC host commands over the SPI slave"). Use
CONFIG_HOSTCMD_SPS, since it came first and is already defined in config.h.

BUG=chrome-os-partner:50819
BRANCH=None
TEST=`make buildall -j`

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I665c405ad72caa3b84e583a80c0893e4c625632a
Reviewed-on: https://chromium-review.googlesource.com/331342
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-03-08 13:56:38 -08:00
Mary Ruthven
9f39ce1903 lucid: fix adc vbus sensing
This change changes the full ADC range for VBUS to the correct value.

BUG=none
BRANCH=none
TEST=Verify VBUS voltage reported by `adc` matches measured voltage
on scope.

Change-Id: I3497ea790c4cbce66845d4cc661e1a0437c1cdfd
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/331283
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-08 12:17:03 -08:00
nagendra modadugu
6e0309ffa9 CR50: set result size in _cpri__GenerateKeyEcc, _cpri__GetEphemeralEcc
_cpri__GenerateKeyEcc, and _cpri__GetEphemeralEcc are expected to
set the size of the result in accordance with the curve being used.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=tests in test/tpm/tpmtest.py, test CPCTPM_TC2_2_14_02_05 passes

Change-Id: I558cc56f689c2d33c12876ddbfde7e9659613d2c
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/331210
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-03-07 20:03:30 -08:00
Koro Chen
86d94fa3b5 oak: Fix rev5 battery LED
rev5 battery LED control was misplaced in wrong function.
Move it back to oak_led_set_battery().

BRANCH=none
BUG=chrome-os-partner:49375
TEST=ectool led battery [green red off] are correct

Change-Id: I83bc24c7ea7695be2a638e97b7db6e0c38840a16
Signed-off-by: Koro Chen <koro.chen@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/330509
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-07 10:03:39 -08:00
Mulin Chao
dca765004f npcx: Add CHIP_VARIANT variant for different versions of npcx ec.
In order to support 256 KB ram version of npcx ec, we add CHIP_VARIANT
variant to distinguish which verson ec is.

In config_chip.h, we use CHIP_VARIANT to specify the size and start address
of program memory. Ecst tool also needs a chip parameter to make sure
the address range checking of entry pointer won't fail.

Modified sources:
1. config_chip.h: Use CHIP_VARIANT to specify the different hardware spec
   of npcx ec.
2. config_flash_layout.h: Replace constant value with
   CONFIG_PROGRAM_MEMORY_SIZE for CONFIG_RO_SIZE.
3. build.mk: Add -chip parameter for ecst tool to check entry address.
4. npcx_evb\build.mk: Add CHIP_VARIANT definition (npcx5m5g).
5. npcx_evb_arm\build.mk: Add CHIP_VARIANT definition (npcx5m5g).
6. wheatley\build.mk: Add CHIP_VARIANT definition (npcx5m5g).

BUG=chrome-os-partner:34346
TEST=make buildall -j; test nuvoton IC specific drivers
BRANCH=none

Change-Id: I1b8b9b9d0a59bdc01210f498ac67e4a342743b47
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/330072
Tested-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-05 11:36:32 -08:00