Commit Graph

2111 Commits

Author SHA1 Message Date
Aaron Durbin
90b934d4e9 reef: keep analogix pd chip in reset
The gpio settings for the USB_PD_RST_ODL signal had the default
state high while the power enable, EN_USB_TCPC_PWR, was low. This
is combination of settings is invalid for the part. Therefore,
keep USB_PD_RST_ODL low until board_set_tcpc_power_mode() is called
to bring the pd chip online.

BUG=chrome-os-partner:53035
BRANCH=None
TEST=Rachel confirmed things still working.

Change-Id: I8b6b54a474c00165a4d0af944fb60f2923b9ef5c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347000
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-24 15:46:02 -07:00
Aaron Durbin
c8a4948417 reef: change USB_C0_PD_INT voltage tolerance
The USB_C0_PD_INT signal is actually at 3.3V levels. Don't mark
the voltage sensitivity to 1.8V.

BUG=chrome-os-partner:53035
BRANCH=None
TEST=Rachel ran with resulting image. Nothing bad observed.

Change-Id: I36bc3f911b715dc967cc8f23dfc70c3d0e5023d2
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346734
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-24 15:46:02 -07:00
Aaron Durbin
58b9c3ef17 reef: don't reset analogix pd chip out of band of driver
board_reset_pd_mcu() was provided to ensure a microcontroller USB PD
implmenetation was reset. However, performing this sequence without
coordinating with the analogix driver results in a mismatch of
expectations regarding the internal polarity. The driver already
sets the expected interrupt polarity, but performing this reset
in chipset_pre_init() changes the expected setting which results
in occasional power sequence state machine hangs since
tcpc_get_alert_status() was always returning true. Lastly, added
comment to board_reset_pd_mcu() indicating how that sequence is likely
not needed if it's only invoked in the EC reset path.

Getting the analogix chip out of reset works in conjunction with the
default gpio settings for USB_PD_RST_ODL as well as the implementation
of board_set_tcpc_power_mode().

BUG=chrome-os-partner:53035
BRANCH=None
TEST=Rachel tested with change. Consistent power sequencing completes
     without any hangs.

Change-Id: I9ffabaf85f33d6a361caef631e3e6d86c4cf8081
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/346733
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-24 15:46:02 -07:00
Vijay Hiremath
313355302b Driver: BD99955: Enable BC1.2 support
BUG=none
BRANCH=none
TEST=Manually tested on Amenia.
     Connected Zinger, Type-C, DCP & CDP chargers. Device can negotiate
     to desired current & voltage and the battery can charge.
     USB2.0 sync device is detected by Kernel.

Change-Id: I58cb69289eef9a966e06bef8fe31d35beaec5e27
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/341030
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-24 15:46:01 -07:00
Kevin K Wong
f4e617e118 amenia: enable tcpc support for amenia 1.2
added Analogix AXN7428 and ParadeTech PS8751

note: hdp support is wip

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I4ff1a2ad03da8e625e869482102d6c3a1ca2aa50
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/341535
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-24 15:46:01 -07:00
Vijay Hiremath
f63124791d amenia: update for amenia 1.2 hardware
updated the following based on amenia 1.2 hardware change:
gpio change
invert kbd col 2
g782 temp sensor
adc ch0, 2 reading
kx022 base accel
lid gyro/accel/mag i2c port change
bd99955 charger

bc1.2 support (CL:341030)
tcpc support (CL:341535)

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I178baf326c8edd8e0dadac6a6480625177d90a09
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/341534
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-24 15:46:01 -07:00
Shelley Chen
a84aa5ace7 kevin: rk3399: enabling RTC wakeup
Enabled CONFIG_CMD_RTC_ALARM.  EC_HOST_EVENT_RTC
is enabled when the rtc_alarm goes off,
alerting the AP to transition from S3->S0.

BUG=chrome-os-partner:52218
BRANCH=None
TEST=rtc_alarm <num> and see event set in ec console
     after <num> seconds.  Also, check if new bit set
     through hostevent command in ec before/after
     rtc_alarm goes off.

Change-Id: I53b1705ce0925000f35b9f80752035d198db3310
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/345474
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-23 13:14:17 -07:00
David Hendricks
b14f89cfdb reef: Initial commit
This adds the basic framework for Reef including full GPIO listing,
board config file, and rudimentary functionality. It has not been
fully tested and still has several TODOs/FIXMEs. For now we just need
something that will build and can be incrementally improved.

BUG=chrome-os-partner:53035
BRANCH=none
TEST=EC and AP both boot, seems reasonably stable for now

Change-Id: I4934ad00917e251dd1d7eb759207a92c45a36136
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/339292
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-20 17:08:34 -07:00
tonycwlin
828d5c19f6 elm: Set internal pull-high to GPI pins below.
PE1 (BC12_ANX7688_INT_L)
     PE7 (ANX7688_CABLE_DET_EC_L)

Cost down 2 resistors.

BUG=none
BRANCH=none
TEST=Measure this two pins and verify voltage with digital meter.

Change-Id: Ic4456d372171933b4ac45942dba9a28c5bd80d3d
Reviewed-on: https://chromium-review.googlesource.com/345746
Commit-Ready: Tony Lin <tonycwlin@google.com>
Tested-by: Tony Lin <tonycwlin@google.com>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-05-19 06:05:57 -07:00
Dino Li
f817140c3e chip: it83xx: Optimize interrupt usage of LPC access
LPC access interrupt only enabled when EC entering deep doze mode. This
will reduce interrupt of LPC access. Also, this interrupt is always
enabled for LPC platform to support "CONFIG_LOW_POWER_S0".

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

BRANCH=none
BUG=none
TEST=Tested ectool command 'version' x 10000.

Change-Id: I9053c4018b38a8a852c3c6254e1fcde625f3fa3a
Reviewed-on: https://chromium-review.googlesource.com/336112
Commit-Ready: Dino Li <dino0303@gmail.com>
Tested-by: Dino Li <dino0303@gmail.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-05-18 19:44:09 -07:00
Shawn Nematbakhsh
4e889ab4a0 kevin / gru: Update battery parameters
Update battery parameters to match the batteries actually present on
these devices.

BUG=chrome-os-partner:53002
BRANCH=None
TEST=Manual on kevin. Verify battery successfully charges and discharges
from AC.

Change-Id: I84579c23fe9fec1aecf133887a2d5b880047772f
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/344935
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-05-18 18:11:31 -07:00
Dino Li
2388211bd7 board: it83xx_evb: support PD EVB
The change is made to combine EC & PD's board code.

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

BRANCH=none
BUG=none
TEST=We can verify PD module on PD EVB and run this board code
     on EC EVB as well.

Change-Id: I92f6ad41643b0536fd78d24026374265cfcf37ea
Reviewed-on: https://chromium-review.googlesource.com/342489
Commit-Ready: Dino Li <dino0303@gmail.com>
Tested-by: Dino Li <dino0303@gmail.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-18 01:27:55 -07:00
Vadim Bendebury
5c9fc1111c shorten long console command names
The EC code expects console commands to be no longer than 14
characters, otherwise the alignment of the help command output breaks.

This patch replaces flash_spi_sel_lock with flash_spi_lock and
fake_disconnect with fakedisconnect to make sure the command names
fit.

BRANCH=none
BUG=none
TEST=the 'help' command output is not misaligned any more

Change-Id: Ia65f1535850a07adccbef0812c8a0922c0264cea
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/345570
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
2016-05-18 01:27:45 -07:00
Koro Chen
73f2b710e1 elm: set up rotation matrices for EVT
Some axes of base and lid accelerometers on EVT needs to be reversed
to match the standard reference frame.

BUG=chrome-os-partner:52776
BRANCH=none
TEST=accelinfo on and check the lidangle reported is correct when I am
changing the lid angle

Change-Id: Id340d28a740d00c7ff4508f5f804fe90fd8ba18c
Signed-off-by: Koro Chen <koro.chen@mediatek.com>
Signed-off-by: Ricky Liang <jcliang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/343490
2016-05-16 20:58:13 -07:00
li feng
2387751095 Amenia: internal pullup added to BAT_PRESENT_L pin
BUG=none
BRANCH=none
TEST=On AMenia, mesaure connector pin 5 3.3v when no battery connected,
and 0v when battery is connected. Without pullup, it's floating.

Change-Id: Iaf81e00f317209821cec1a83c47a1a75e53feba1
Signed-off-by: li feng <li1.feng@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/342486
Commit-Ready: Kevin K Wong <kevin.k.wong@intel.com>
Tested-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-16 15:01:32 -07:00
Wonjoon Lee
849ccf7c91 kevin: Add support bmi160 sensor
BMI168 is twins sensor with BMI160. Adding defines, drv.

BUG=chrome-os-partner:52844
TEST="accelread 0" is working on kevin

Change-Id: I8335ea4a766ae88e049791b9231ab752486be9d4
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/341650
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-12 20:13:53 -07:00
Wonjoon Lee
7a12b82541 kevin: add more board id
BUG=None
TEST=cmd 'ver' gets proper version on kevin

Change-Id: I2404c57cf2aa939e5255fb70f0e77299ddf0776e
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/343619
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-12 20:13:53 -07:00
Shawn Nematbakhsh
e41ee0e3eb kevin: Handle WARM_RESET_REQ input
Trigger warm reset on WARM_RESET_REQ assertion.

BUG=chrome-os-partner:51926, chrome-os-partner:51923
BRANCH=None
TEST=Toggle input pins from sysfs (GPIOs 11, 38), verify that ISR is called
and proper action is taken.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Change-Id: I38ef06bd99a7885647a27cef1a8371ad96c3f051
Reviewed-on: https://chromium-review.googlesource.com/338924
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-05-12 17:15:35 -07:00
Shawn Nematbakhsh
541433abaf cleanup: lars / kunimitsu (and _pd): Remove board-level code
Authoritative firmware for these boards can be found on
firmware-glados-7820.B branch.

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

Change-Id: I78dddef7bc36ecceb5cd9f0eb07052e8e16b6c15
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/343201
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-05-12 13:06:45 -07:00
Shelley Chen
b6b6430daa kevin: Shut down AP at AP_OVERTEMP assertion
coreboot will enable AP_OVERTEMP signal when AP
has surpassed a temperature threshold.  These
changes has the EC do an apshutdown when it
detects this signal going high.

BUG=chrome-os-partner:51926
BRANCH=None
TEST=lower AP_OVERTEMP threshold and make sure
     that AP shutdown occurs.
CQ-DEPEND=CL:342797

Change-Id: Ib9c9d03d2df0d670830c0b4eea3eea3ba5bae0b8
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/343060
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-11 18:24:39 -07:00
Shawn Nematbakhsh
9494fc0dd1 pwm: Add generic PWM control host commands
Add generic PWM host commands for setting + getting duty cycle. PWMs can
be controlled through index (board-specific meaning) or by type
(currently KB backlight and display backlight are supported, more can be
added as needed).

BUG=chrome-os-partner:52002
BRANCH=None
TEST=Manual on chell.
`ectool pwmsetduty kb 100` - Verify KB backlight goes to 100%
`ectool pwmgetduty kb` - Prints 100
`ectool pwmgetduty 0` - Prints 100
`ectool pwmsetduty 0 0` - Verify KB backlight goes to 0%
`ectool pwmgetduty kb` - Prints 0
`ectool pwmgetduty disp` - Error res 3 (unsupported PWM type)
`ectool pwmsetduty 1` - Error res 3 (non-existent PWM index)

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I607c92a291e6c2e3af8238eaf22ad2bb81ffc805
Reviewed-on: https://chromium-review.googlesource.com/344012
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-05-11 18:24:30 -07:00
Vincent Palatin
3e9490031b twinkie: disable tracing when injecting packets
The tracing runs a higher priority task (SNIFFER) than the packet
injection (on CONSOLE task) and both RX and TX are using the same buffer,
so when we are sending a packet, we are getting immediately preempted by
the tracer and bad stuffs happen.

Now, we can manually inject packets and get the text trace of the
response.

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

BRANCH=none
BUG=none
TEST=with the SOP' experimental patch, plug a full-featured cable into
Samus with Twinkie as an interposer, then do the following sequence:
Pretend there is a device
> tw resistor rd 0
Enable the text tracing
> tw trace on
Send discover identity to the cable (and get the descriptors)
> tw sendprime 1 0x104f ff008001
Sent CC1 104f + 1 = 381
165.939687 SRC/0 [0141]GOODCRC
165.942520 SRC/0 [514f]VDM Vff00:DISCID,ACK:ff008041 1c00050d 00000000 030a0000 11082032

Change-Id: Ie0ad57341c6476e983229b532716986dffefa8a1
Reviewed-on: https://chromium-review.googlesource.com/342512
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
2016-05-11 18:24:29 -07:00
Wonjoon Lee
61a0b59cac kevin: reduce program size
Reduce size to port motion sensor

BUG=chrome-os-partner:52876
TEST=Can get build image with sensor job

Change-Id: I7ea0248d0067d25c644eb148c50e36514f9b2598
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/342586
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-11 05:40:36 -07:00
Shawn Nematbakhsh
b8154d0246 kevin: Move RAM from data section to code
Kevin is code space constrained, so use RAM normally used for data
instead for code.

BUG=chrome-os-partner:52876
BRANCH=None
TEST=Verify free code RAM becomes 5732 bytes (was 1636) and free data
RAM becomes 3072 bytes (was 7168 bytes) (measured with pending changes
to add sensor task). Also, verify kevin continues to boot + power sequence.

Change-Id: Ia6470a76f95e87d6cda1bf7273deaab6344f8ee9
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/343191
Commit-Ready: Wonjoon Lee <woojoo.lee@samsung.com>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-05-10 09:34:45 -07:00
Mulin Chao
3391ef950a npcx: shi: Improve reliability of SPI host command interface
- Fix output buffer filling races
- Limit response size to 256 bytes to work-around forced low bit on
  257th byte
- Modify CS glitch to handle CS-to-clock delay
- Make CS GPIO interrupt pri 0 to ensure SHI interrupts aren't serviced
  first

TEST=`while true; do ectool version; done > /usr/local/log` on kevin,
verify failure occurs about every ~72000 commands (~360000 host commands)
BRANCH=None
BUG=chrome-os-partner:52372

Change-Id: I5c3d90bf510ed782973b57c2b7497441434c1708
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341492
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-05-06 18:58:20 -07:00
Wonjoon Lee
cd2ef5a5fa kevin: Add support for SPI_MASTER on kevin
Enabling SPI_MASTER on SPIP port in npcx

BUG=chrome-os-partner:52844
TEST=spixfer rlen 0 0 1 shows 0xd2 on kevin
BRANCH=None

Change-Id: I3fe333a7d69fe16c2c630c3c2487320a0d1c020b
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/341577
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-06 00:25:15 -07:00
Shawn Nematbakhsh
2c162ddade test: host: Fix sbc_charging_v2 test failure
sb_i2c_xfer() assumes 'out' is a valid pointer, which is only true if
out_size is non-zero.

BUG=chrome-os-partner:51207
BRANCH=glados
TEST=`make buildall -j` w/
https://chromium-review.googlesource.com/#/c/342630/

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ia22dcca2b5318b4d69c7afa49f5c8891ab329bd1
Reviewed-on: https://chromium-review.googlesource.com/342635
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@google.com>
2016-05-05 19:16:57 -07:00
Bill Richardson
9b815745fa Cr50: Lower all runlevel permissions to medium
Two permission registers are already lowered. This adds the
remaining two.

BUG=chrome-os-partner:52994
BRANCH=none
TEST=make buildall; run on Cr50

USB works, SPI works, sleep and deep sleep work, tpmtest.py works.

Change-Id: Ifb27d5be81f10537114f4702addb58c6d7e1630c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342455
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-05 15:10:24 -07:00
Shawn Nematbakhsh
b803590c27 hooks: Add relative HOOK_INIT priority for peripherals
Using HOOK_PRIO_DEFAULT for peripheral initialization necessitates using
HOOK_PRIO_DEFAULT+1 for board-level code. Instead, use a
higher-than-default relative priority for peripheral initialization
outside of board.

BUG=None
TEST=Verify PWM and ADC are functional on kevin.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ia8e90a7a866bdb0a661099dd458e3dfcaaa3f6bb
Reviewed-on: https://chromium-review.googlesource.com/342171
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-05 01:12:25 -07:00
Shawn Nematbakhsh
bdbf0810d0 gru: Initial mainboard commit
Clone of kevin w/ minor GPIO / LED changes.

BUG=chrome-os-partner:52736
BRANCH=None
TEST=Verify image boots + sequences on kevin p1.

Change-Id: I7d3f3ce97a8b080516b635a3d2b7bc3c6515c6d9
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/340542
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: David Schneider <dnschneid@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-05-04 16:15:02 -07:00
Shawn Nematbakhsh
15ac27daa1 rk3399: Set power state based on input signals
Use input signals to verify power state and determine power state after
sysjump.

BUG=chrome-os-partner:52878
BRANCH=None
TEST=Manual on kevin.
- Verify AP powers up on 'powerbtn'.
- AP shuts down on 'apshutdown'.
- AP re-powers / resets on 'powerbtn' + 'apreset'.
- AP doesn't shutdown on 'sysjump rw' while in S0.

Change-Id: Id24feb0f8490aa7cb73c46178085ff2e46f8d0a6
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341704
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: David Schneider <dnschneid@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-04 16:15:02 -07:00
Dino Li
32bf8ecb77 board: rename it8380dev to it83xx_evb
Unified board name for IT83-series.

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

BRANCH=none
BUG=none
TEST="make BOARD=it83xx_evb -j" and "make buildall -j"

Change-Id: Ic96d0132fb31fcc8715d0dd810f8bd340035a640
Reviewed-on: https://chromium-review.googlesource.com/341843
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-03 22:00:49 -07:00
Bill Richardson
b6ad3710c4 Cr50: Enable jittery clock
BUG=chrome-os-partner:52576
BRANCH=none
TEST=make buildall; try on Cr50

I manually tested both highsec and highperf variants, as well as
forcing the bootrom init to run. All the bank registers were
loaded with meaningful values, and none of the SPI or USB
functionality showed any problems.

Change-Id: Ia91ba98ef4c667aec74195c4a7bbf72a5d1c8b2d
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342030
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-03 15:40:44 -07:00
nagendra modadugu
97ba687605 CR50: fix issue in ecc parameter endian conversion
Only convert parameters that aren't NULL.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=tests in test/tpm_test/tpmtest.py pass & CPCTPM_TC2_2_20_04_05

Change-Id: I7d8133a0068ba50dc47ead7b4ce002d96d868dbe
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/341846
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-03 15:40:43 -07:00
Nicolas Boichat
427b8f9cd9 elm: Set USB_DP_HPD as input
This makes all board_typec_*dp* functions irrelevant: remove them.

BRANCH=none
BUG=chrome-os-partner:52352
TEST=USB_DP_HPD_C from AP side indicates which output is currently
     in use (native HDMI or ANX7688)

Change-Id: Id60ab97ee9ce987ec4e36e5fd9be9a20908edbfe
Signed-off-by: Nicolas Boichat <drinkcat@google.com>
Reviewed-on: https://chromium-review.googlesource.com/338868
Commit-Ready: Koro Chen <koro.chen@mediatek.com>
Tested-by: Koro Chen <koro.chen@mediatek.com>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-05-03 05:03:08 -07:00
nagendra modadugu
3d030e6409 CR50: remove checks on RSA key buffer size
Remove buffer size checks in _cpri__GenerateKeyRSA().

The TPM stack passes in TPM2B buffers that
may have the size field uninitialized.
Callees are expected to assume that the
buffer size is sufficient for the requested
operation.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=TCG test CPCTPM_TC2_2_20_03_02 reliably passes

Change-Id: I3d9bc2475b82dfaa9ed1d2617b1c333ff4df409d
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/340883
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-03 01:42:52 -07:00
David Schneider
45d9f6afeb Add the lock key to the keyboard mask on kevin
TEST=confirm lock key scancode shows up in matrix
BUG=none
BRANCH=none

Change-Id: I51ef44017ea57abd3cbbc69c55f3d9da7afff42b
Signed-off-by: David Schneider <dnschneid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341469
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-02 21:30:13 -07:00
Wonjoon Lee
c8e38a9314 kevin: Add support 3 color LED
When system on
 .always blue
When system is off
 .discharging : off
 .charging : red
 .full-charged : green
Error : red - green switching

BUG=None
TEST=See LED behavier on kevin

Change-Id: I93f0dbb503c68999825c455c8dc81b6bdaf397b4
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/341113
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-05-01 20:06:01 -07:00
David Schneider
c5d5ae7f1c Invert KSO2 on Kevin
TEST=confirm column 2 keys work
BUG=none
BRANCH=none

Change-Id: Ib474a46ac723657b96970735dc4e3a1d0c8a8505
Signed-off-by: David Schneider <dnschneid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341581
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-04-30 13:26:20 -07:00
nagendra modadugu
b2280c24b4 CR50: point multiply should check point for curve membership
_cpri__EccPointMultiply should check whether the provided
point is on the curve prior to doing a multiply.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=TCG test CPCTPM_TC2_4_13_01_01 passes

Change-Id: Ia92494070c62f7e03b395975138c0c8446a7284d
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/341112
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
2016-04-30 02:43:22 -07:00
Mary Ruthven
61e0653261 cr50: add basic rbox support
This change modifies the behavior of RBOX by blocking the key0 and key1
output, when the power button is pressed. It also adds support for
printing debug statements when various RBOX interrupts are triggered.

BUG=none
BRANCH=none
TEST=On cr50 test board verify key0 and key1 out are not asserted unless
the power button is pressed.

Change-Id: I67a3c1b8009279015bdc87bcf0995cffa9ab6f03
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341470
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-29 16:07:13 -07:00
Shawn Nematbakhsh
43a0c70346 kevin: Decode board version
Decode board version from analog voltage on BOARD_ID.

BUG=chrome-os-partner:52642
BRANCH=None
TEST=Verify 'ver' shows "Board: 0" on proto 1 board.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ifdbdd2e975e463ab45d81ee6eaa4ba017a2f29c0
Reviewed-on: https://chromium-review.googlesource.com/340241
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-04-29 14:38:06 -07:00
Shawn Nematbakhsh
90145968b2 kevin: GPIO changes for new proto build
BUG=chrome-os-partner:52171
TEST=Verify old kevin boards still boot + power sequence.
BRANCH=None

Change-Id: Iacc02beba05ef3e80ffa59aa7fc5718c12bae20c
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338043
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-04-29 14:38:06 -07:00
Mary Ruthven
9eafb5b9dd cr50: set SYS_RST_L as an input
Setitng SYS_RST_L as an output contends with the EC setting it as an
output. We will only drive the pin when necessary.

BUG=none
BRANCH=none
TEST=power on kevin and make sure the AP is able to boot.

Change-Id: Ie40cc4932ff92d20b021765c3aa356d8902f20e1
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341326
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-29 11:02:03 -07:00
Bill Richardson
c5dd305dff Cr50: Move board-specific rdd stuff out of chip/g/
Poking GPIOs is something that belongs in board/ not chip/

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

Change-Id: I798053c3760415ed787800d37eb81c765b826399
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341065
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-04-29 07:34:53 -07:00
Daisuke Nojiri
38c93a26f3 STM32: Add HSE and PLL to clock source selection
This patch adds HSE and PLL as a system clock oscillator for STM32L4.
This allows us to drive the chip at a higher frequency (up to 80 MHz),
which is necessary to big-bang GPIO ports accurately.

BUG=none
BRANCH=tot
TEST=make buildall. Verified console works on STM32L476G-Eval using HSE,
PLL-HSE, PLL-HSI, PLL-MSI as an oscillator. Verified console runs soundly
with different frequencies from 20 Mhz to 80 Mhz. Verified frequencies
using oscilloscope on MCO (Microcontroller Clock Output) port up to 50 MHz.

Change-Id: I493cdb6c323eb4e6a1560f6d030935c1950b1a2a
Reviewed-on: https://chromium-review.googlesource.com/341275
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-04-29 07:34:52 -07:00
nagendra modadugu
66473502c9 CR50: remove unused config option CONFIG_RSA, some cleanup
CR50 does not depend on the rsa implementation
in common  This change removes the corresponding
config option.

Also remove a duplicate CONFIG_SHA256 option, and add a
comment regarding CONFIG_SPS_TEST.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=compilation succeeds

Change-Id: Ie01439899042c5fa981f884a01b83eb0b3eb6e32
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/340539
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-27 23:58:06 -07:00
Shawn Nematbakhsh
0970c2d795 chell: Keep KB light PWM active during low-power idle
BUG=chrome-os-partner:52783
BRANCH=glados
TEST=Enable CONFIG_LOW_POWER_S0 on chell. Verify KB backlight does not
flicker during idle.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib7cbaf955654cbb22a7beb7dc536468b532a769d
Reviewed-on: https://chromium-review.googlesource.com/341003
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
2016-04-27 23:58:04 -07:00
Shawn Nematbakhsh
ab27f42f56 pwm: Add PWM_CONFIG_DSLEEP config flag
Add PWM_CONFIG_DSLEEP PWM config flag, which can be set to keep a
channel active during low-power idle / deep sleep. Currently it's
supported by npcx and mec1322.

BUG=chrome-os-partner:52783
BRANCH=glados
TEST=Manual on chell w/ subsequent commit + CONFIG_LOW_POWER_S0. Verify
KB backlight does not flicker during idle.

Change-Id: Ib9df5879aaa7dfa5764de1583496de84d40d2bb5
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341002
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
2016-04-27 23:58:04 -07:00
Nick Sanders
8d742588ad servo_v4: add initial servo_v4 build
Add initial servo_v4 build, GPIOs, etc.
Supports most features other than PD passthrough.

BUG=chromium:571476
BRANCH=None
TEST=updated servod is able to control gpio, gpio extender on servo v4

Change-Id: I71c9cb2bf24b732dd6a2e101d7b1c849c9f88af8
Signed-off-by: Nick Sanders <nsanders@google.com>
Reviewed-on: https://chromium-review.googlesource.com/332803
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
2016-04-27 18:12:32 -07:00