Commit Graph

1991 Commits

Author SHA1 Message Date
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
Mulin Chao
f02a5e9045 npcx: Add 1.8V IO support for some GPIOs and I2C pins.
Add 1.8V IO support for some GPIOs and I2C pins. We use a array
(gpio_lvol_table) to confine which IO pins can switch to 1.8V. Before
setting it to support low voltage level, FW should set IO pin's type to
open-drain and disable internal pulling up or down.

We also add examples in gpio.inc of npcx_evb and npcx_evb_arm to indicate
how to set GPIO & I2C pins to 1.8V if user adds CONFIG_TEST_1P8V definition
in board.h.

In i2c.c driver, this version removes the internal pull-up feature of
i2c ports since the driving force is too weak. (about 30K ohm)

Modified sources:
1. gpio.c: Add 1.8V IO support for some GPIOs and I2C pins.
2. i2c.c: Remove internal pull-ups feature for i2c pins and move 1.8V
   support to gpio.c.
3. register.h: Modified NPCX_LV_GPIO_CTL register & bits definitions.
4. npcx_evb\gpio.inc: Add examples of 1.8V IO.
5. npcx_evb_arm\gpio.inc: Add examples of 1.8V IO.

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

Change-Id: I73a840ae321820212e50d609dab17576117a7d64
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/330037
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-05 04:03:23 -08:00
Ricky Liang
dc73b3ed74 oak: set up base accelerometer rotation matrix
The base accelerometer on oak rev5 needs to be rotated 180 degrees
along the z-axis to match the standard reference frame.

BUG=chrome-os-partner:50312
BRANCH=none
TEST=manually rotate my oak rev5 and verify that `ectool motionsense`
     reports correct accelerometer readings

Change-Id: I05a377b5f0827e2aad47d388dc3264d451580989
Signed-off-by: Ricky Liang <jcliang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/330484
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-04 11:35:54 -08:00
Rong Chang
fc715ba428 oak: fix issues on building oak rev1-4 EC
The default target hardware is rev5. This is a maintainess change for
old and deprecated HW.

BRANCH=none
BUG=chrome-os-partner:49114
BUG=chrome-os-partner:50720
TEST=manual
  for N=1,5 do
  make BOARD=oak clean && make BOARD=oak EXTRA_CFLAGS="-DBOARD_REV=$N" -j

Signed-off-by: Rong chang <rongchang@chromium.org>
Change-Id: Ibb4ebf9fab429964ace7c3e548598f0fb08e7dea
Reviewed-on: https://chromium-review.googlesource.com/330065
Commit-Ready: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
2016-03-03 06:21:57 -08:00
Shawn Nematbakhsh
3f85f1be7e chell: Enable HW charge ramping for BC1.2 suppliers
Use ramp limits from glados.

BUG=chrome-os-partner:50689
BRANCH=glados
TEST="reboot ap-off" on chell, then attach DCP, SDP and proprietary
chargers. Verify through "battery" charge current that input current is
ramps and settles on a value within spec.

Change-Id: I6ff42510cd33a0678329e8de528917653fef3424
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/330155
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-03-02 20:26:30 -08:00
Rong Chang
6877eee247 oak: enable lid angle update
This change enables lid angle update that turns off keyboard scan in
tablet mode.

BRANCH=none
BUG=chrome-os-partner:49114
TEST=make BOARD=oak runtests
  make BOARD=oak -j && make BOARD=oak_pd -j
  load on oak and boot to vt2 console.
  flip lid to disable range, type keyboard and check.

Signed-off-by: Rong Chang <rongchang@chromium.org>
Change-Id: Ibd2f0d6ae33a95380c9fc52a7568166a04c119e9
Reviewed-on: https://chromium-review.googlesource.com/328884
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
2016-03-02 13:39:47 -08:00
Ben Lok
ec32233219 oak: change the default board revision to OAK_REV5.
revise the OAK_REV_DEFAULT to OAK_REV5 for Oak-rev5 board.

BRANCH=none
BUG=chrome-os-partner:49375
TEST=make -j buildall

Change-Id: I378aaae9073b308ba403b292d41ca360c81f9b1d
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/321583
Commit-Ready: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-02 13:39:47 -08:00
Anton Staaf
e3d6310cc9 NPCX: Convert keyboard pins to use ALTERNATE macro
Previously the keyboard row and column pins could not use the GPIO
alternate function mechanism because their DEVALT bits were inverted
with respect to all of the others, making it impossible to correctly
configure them.  With the refactor of the GPIO driver we can now add
the keyboard DEVALT entries to the gpio_alt_table, and use the
ALTERNATE macro and associated APIs to control the keyboard pin states.

The Wheatley RO firmware image is still 320 bytes smaller than before
the GPIO refactor.

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

BRANCH=None
BUG=None
TEST=make buildall -j
     Ran on Wheatley, manually verified keyboard functionality

Change-Id: Id04bc010834b5d95050b03ace6b0e1c5690757bf
Reviewed-on: https://chromium-review.googlesource.com/329762
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-03-02 11:22:51 -08:00
Ben Lok
afc76f1adf oak: updates for rev5
1. Muxer of USB C1 port changes to Parade PS8740.
2. Add control of DP switch TS3USB3000RSER, using for switch DP to port 0/1
   (same as rev2).
3. LED control logic is same as rev2.
4. Updates GPIO setting for rev5 pinouts.

BUG=chrome-os-partner:49375
BRANCH=none
TEST=build -j buildall tests

Change-Id: Ifc45ac30be8d46caa1cdb032ccce7569e5a14b99
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/321024
Commit-Ready: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-01 08:25:59 -08:00
Ben Lok
0c9e75f017 oak: Add base accel & gyro via SPI bus for rev5
refer to commit d341615383,
adds the base accelerometer as well as the gyroscope to the list of
motion sensors on the board, connect with SPI bus. They are currently
wrapped behind an ifdef for HAS_TASK_MOTIONSENSE and OAK_REV5.

BUG=chrome-os-partner:50312
BRANCH=none
TEST=Build Oak EC with driver enabled and verify that we can calcuate
a valid lid angle.
TEST=Verify that signs of accelerometer conform to those shown in the
Chrome/Android/HTML5 doc/spec. See description in accelerometer_types.h
TEST=Verify that signs of gyroscope conform to those shown in the
"Sysfs interface to EC accelerometers" document.
TEST=make buildall tests

Change-Id: I4d900bc6bd7329db6ea53660fae86e5e2bbe9028
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/319295
Commit-Ready: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-01 08:25:58 -08:00
Ben Lok
a36a6ca96e oak: Add kx022 lid accelerometer for rev5.
refer to commit 574c806571,
adds the lid accelerometer to the list of motion sensors on the rev5.
Since commit bc404c94b4,
math_util.c is no longer to include "math.h" header file.

BUG=chrome-os-partner:50312
BRANCH=none
TEST=Build Oak EC with driver enabled and verify that valid
accelerometer data is read, and that range, resolution, and odr can all
be modified.
TEST=Verified that signs of accelerometer data conform to those shown in
the doc.
TEST=make buildall tests

Change-Id: I8df1b2331a1fbea82015b97985541e2ebc393d10
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/319332
Commit-Ready: Rong Chang <rongchang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-03-01 08:25:58 -08:00
Bill Richardson
ee86be472d Cr50: SAFE MODE: all GPIOs are inputs for Kevin0
Except for the console UART TX and the SPI slave MISO, this CL
configures all the formerly output GPIOs as inputs. The Cr50
firmware at this point doesn't actually DO anything useful with
the GPIOs that would normally be outputs on the Kevin board (we
don't assert SYS_RESET, or EC_FLASH_SELECT, for example), and the
board *should* be designed so that no important signals like
those just float.

By using this configuration, we're trying to limit the potential
harm done by unexpected schematic changes. Once the system boots,
we should be able to use the SPI bus to update Cr50 to add more
features, such as testing Cr50 GPIOs individually.

BUG=chrome-os-partner:49952
BRANCH=none
TEST=make buildall, run on Cr50 board

Change-Id: I1f0a164e2cd3e4f632b862e33dba69f0dc944322
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329557
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-27 03:25:53 -08:00
Vadim Bendebury
b6f3e288c1 cr50: use the correct signer invocation options
The new signer command line option should be used by some boards, not
all of them. Add it for cr50 for now.

BRANCH=none
BUG=none
TEST=verified that --cros is added to the command line when cr50 blobs
      are signed, and that the signed blob boots fine on b1.

Change-Id: Ibc38cc6233b57838129ae7d554921c1bae0e6b8c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329595
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-02-27 03:25:52 -08:00
Bill Richardson
30585eb36b Cr50: Configure GPIOs for Kevin proto0
BUG=chrome-os-partner:49952
BRANCH=none
TEST=make buildall, run on Cr50 board

It's kind of hard to test GPIOs that aren't attached to anything,
but I've examined all the PINMUX controls and ARM GPIO settings,
and I *think* they're right.

Change-Id: I66ae94118f73c41193c6ca5c0af9708f6cc8a3e8
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329526
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-27 00:38:19 -08:00
Bill Richardson
55bc46fe45 Cr50: cleanup: Remove some unneccessary code
Removing a declaration for a function that no longer exists, and
deleting some extra PINMUX config that is also (and correctly)
being done in the module that uses it (chip/g/sps.c).

BUG=none
BRANCH=none
TEST=make buildall and test image on Cr50

Change-Id: Ie381862cfcd3c043ebf78171d18a51593b3677f7
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329525
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-27 00:38:19 -08:00
Mary Ruthven
9b4f662a8e lucid: add support to detect BC1.2 suppliers
Use built-in USB periperal to detect BC1.2 suppliers and update the
charge manager.

BUG=chrome-os-partner:48658
BRANCH=None
TEST=manual for lucid. Use a samus as the supplier, and insert the
charger into Lucid. Verify that it identifies it as SDP. Use a wall
charger and verify that Lucid identifies it as DCP.

Change-Id: I7842e9f75874f727837df5bfc28690662caf821c
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329236
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-02-26 21:22:07 -08:00
Ben Lok
60552e57b6 oak: Enable TI OPT3001 ambient light sensor for rev5
Refer to commit 3f2dc44158,
enable light sensor driver for oak rev5

BUG=chrome-os-partner:50312

Change-Id: I896cf99fd781f5d4d8dad206d43f5a3d8faeb9a2
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/319271
Reviewed-by: Rong Chang <rongchang@chromium.org>
2016-02-26 05:56:11 -08:00
Shawn Nematbakhsh
e44f7b1029 glados_pd: Add WP_L input GPIO for future boards
Future glados-derived boards are adding a WP_L GPIO input. Add support
for this input, which will apply only if CONFIG_SYSTEM_UNLOCKED is not
defined. Undefining CONFIG_SYSTEM_UNLOCKED will result in unpredictable
WP GPIO behavior for all boards that currently exist, so it should only
be undef'd right before MP FW is released.

BUG=chrome-os-partner:50518, chrome-os-partner:50519
BRANCH=glados
TEST=Verify 'ectool gpioget A13 --dev=1' always indicates a GPIO state
'1' on an old chell_pd without WP_L input.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Id50a13cce54bc2013d83613ce5599ffde6a6837b
Reviewed-on: https://chromium-review.googlesource.com/329370
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-02-25 18:25:41 -08:00
Bill Richardson
5a9a8f3dbf cleanup: Add warning comment to gpio.inc files
With commit e9883124ff, a GPIO_INT macro was added. That change
also required that all instances of GPIO_INT in a board's
gpio.inc file come before any GPIO macros, or the interrupt
handler wouldn't work properly.

This CL just adds a warning comment about requirement to all
gpio.inc files.

BUG=chromium:471331
BRANCH=none
TEST=make buildall, test image on Cr50

This is a change to comments only. There is no new behavior to
verify, although I did run try out one new image just to be sure
nothing stupid happened.

Change-Id: I83f7819929a53bce3a8bae04d15b3ee3bda11738
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329334
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-25 18:25:37 -08:00
Bill Richardson
8376cf5cca Cr50: Remove GPIOs left over from FPGA boards
Let's just get rid of the old GPIOs before configuring the new
ones.

BUG=chrome-os-partner:49952
BRANCH=none
TEST=make buildall, test on Cr50 B1 boards

None of the FPGA buttons or LEDs are present on the B1 board, so
there's no visisble difference between talking to non-existent
components and NOT talking to non-existent components.

Change-Id: I839982ac06a983879f0240635442b51f794daffb
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329267
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-25 18:25:36 -08:00
Bill Richardson
4d5adcac87 Cr50: Cleanup some of the GPIO handling code
Just a bit of refactoring. This cleans up some macro definitions
and error checking, and removes a duplicate list of GPIO signal
names.

BUG=none
BRANCH=none
TEST=make buildall, test on Cr50

No functional changes, so nothing new to test.

Change-Id: Iecacc5a0b7da02aa9d0b94f171c70f0b73e8edd5
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329303
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-25 18:25:36 -08:00
Aseda Aboagye
29b084094f jerry: Increase UART TX buffer size.
Found out that the string that is printed from console_init() doesn't
show up on the EC console for jerry.  It seems that perhaps due to the
priority of the console task and the numerous prints during boot, that
print never makes it to the TX buffer.  Currently, there's about 7200
bytes available in the shared memory region, which indicates that
there's still a lot of free space.  Therefore, increase the UART TX
buffer size.

BUG=None
BRANCH=None
TEST=Flash jerry and verify that 'console is enabled' string shows up on
the EC console.
TEST=make -j buildall tests

Change-Id: Id0603a3b758b5c600d0b59f27040ead2ce48bbaf
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/329180
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-02-23 22:40:23 -08:00
Vadim Bendebury
024a2447e9 cr50: upgrade: fix debug messages to show address instead of offset
Debug messages generated by the firmware upgrade extension command
show flash offsets (the values used when calling flash API), but the
user is more interested in absolute addresses, as they are reported by
some other debug printouts.

Change fw_upgrade_command_handler() debug output to report absolute
flash addresses.

BRANCH=none
BUG=chrome-os-partner:37754
TEST=ran upgrade test, observed proper addresses reported:
  fw_upgrade_command_handler: programming at address 0x84000
  fw_upgrade_command_handler: programming at address 0x84400
  ...

Change-Id: I8a6cd6020e5ddcbf41f5931cf7632fc598d4745e
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/328810
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-02-23 12:19:38 -08:00
nagendra modadugu
9f5782ba05 CR50: add in-place decrypt support for AES-CFB
The api  _cpri__AESDecryptCFB is expected to
support in-place decryption, which the previous
implementation did not support (i.e. part of
the input was was written to prior to being read).

Switch to CTR mode to ECB mode in order to support
in-place decrypt.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=corresponding TPM2 test suite command passes

Change-Id: I8a096bdab7a1ca130a07d992c9fce3fc19016e17
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/328761
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
2016-02-23 12:19:28 -08:00
Kyoung Kim
2af857276d Lars_PD: GPIO correction
Reconfigure EC_INT pin due to external PU
for lower suspend power

BRANCH=firmware-glados-7820.B
BUG=chrome-os-partner:50159
TEST=measure PD power at S3/S0ix/SOC-G3

Change-Id: I94c89113e4feb12b63fbe402a6c6cfe0c2d10394
Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/327995
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-02-22 23:51:27 -08:00
Anton Staaf
8ae8dca6d4 cr50: Switch from ALTERNATE to PINMUX macros
Previously the g chip and cr50 board abused the ALTERNATE macro to
encode the pinmux configuration.  This switches them over to using a
PINMUX macro that is designed for this purpose.

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

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

Change-Id: I5c1f70b7aa92d87cc105e672aa66aee7f267c9a2
Reviewed-on: https://chromium-review.googlesource.com/328823
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-02-22 23:50:53 -08:00
Anton Staaf
0a644a9125 GPIO: Move definitions of GPIO_KB_INPUT and OUTPUT
Previously these were often done in board.c files, which made it
impossible to include the gpio.inc anywhere else.  As part of
refactoring the GPIO code we now need to be able to include gpio.inc
from common/gpio.c.  Moving these defines into gpio.inc makes them
available wherever gpio.inc is included.

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

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

Change-Id: I28e7b5a1d40b113ae824b18f020b2d1e51e0c08a
Reviewed-on: https://chromium-review.googlesource.com/328822
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-02-22 23:50:52 -08:00
Shobhit Srivastava
2435c91b3a Kunimitsu: Enable config REPLACE_LOADER_WITH_BSS_SLOW
If during EC boot we have space issue in shared memory then
ec hash calculation aborts and we cannot boot to RW.
This patch enables the config option to reclaim space from
little firmware loader. This leads to more shared memory
availability and resolves the boot issue.

BUG=chrome-os-partner:50127
BRANCH=glados
TEST=Build/Flash and verify DUT boots to RW. Increase PD logging
size to 512 and verify again that DUT boots to RW

Change-Id: Ic49e37fbc83e12a52cadd9796c5ef6f47d8cf33f
Signed-off-by: Shobhit Srivastava <shobhit.srivastava@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/327656
Reviewed-by: Srinivas Kowtal <srinivas.kowtal@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
(cherry picked from commit 22f8c71aca4d5bf225e420507e34032eef2ea5c0)
Reviewed-on: https://chromium-review.googlesource.com/328330
Commit-Ready: Divagar Mohandass <divagar.mohandass@intel.com>
Tested-by: Divagar Mohandass <divagar.mohandass@intel.com>
Reviewed-by: Jenny Tc <jenny.tc@intel.com>
2016-02-19 04:49:11 -08:00
Kevin K Wong
5efbecb770 kunimitsu: hibernate: enable PseudoG3 support at board level
this is to move the existing code from chipset level to board level
since PseudoG3 is a board feature that required specific hardware.

BUG=none
BRANCH=glados
TEST=use hibernate command to enter PseudoG3

Change-Id: I309ef89e0ff7057ce46c634baa9791731a771984
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/327677
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-02-18 17:35:16 -08:00
Dino Li
5a7767a20e config: it83xx: remove "CONFIG_IT83XX_PECI_WITH_INTERRUPT"
IT839x and the new series all support interrupt of PECI, so we remove it.

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

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

Change-Id: Ib126cb418a4ba5ef313ee93948bc2fbb96bc936d
Reviewed-on: https://chromium-review.googlesource.com/327643
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-02-17 20:57:01 -08:00
Kyoung Kim
ebe37f0008 Lars: S0ix/S3 EC power improvement
USB2_OTG_ID and USB2_OTG_VBUSSENSE pins were floated due to open drain
configuration. Improve EC power and remove power difference between S3
and S0ix. Improve EC power for SOC G3.

BRANCH=firmware-glados-7820.B
BUG=none
TEST=measure EC powers at S3/SOC-G3 and S0ix and check if there
are difference

Change-Id: I0535be675bc3a3a84214590e8190f1fedae1142c
Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/327070
Reviewed-by: Shawn N <shawnn@chromium.org>
(cherry picked from commit 6dbad7f06e245bfa99e37326ed0517e81e207ef9)
Reviewed-on: https://chromium-review.googlesource.com/327480
Commit-Ready: Kyoung Il Kim <kyoung.il.kim@intel.com>
Tested-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
2016-02-17 12:01:42 -08:00
Vadim Bendebury
93f2848eb9 cr50: upgrade command extension
This patch suggests a firmware upgrade mechanism implemented through
an extended TPM command.

The firmware is transmitted in chunks, each chunk accompanied by its
checksum (first 32 bits of SHA1) and the base address.

The first chunk is of size zero and has the base address set to zero.
When the first chunk is received, the command handler determines the
destination flash space (A or B), erases it, and returns its base
address to the caller, such that the firmware update agent can tell in
which of the two spaces it should write the update.

The ultimate verification happens after the device is reset - the
integrity and authentity of the firmware upgrade is verified at that
point, the new firmware will not be started unless it is properly
signed.

BRANCH=none
BUG=chrome-os-partner:37754
TEST=with all patches applied it is possible to upgrade firmware in
     both spaces A and B.

Change-Id: I6aedc587ec630d65ba81000496f372c9044959a0
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/327415
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-02-17 12:01:32 -08:00
Vadim Bendebury
ffd5819d32 cr50: allow board to provide flash configuration
The g chip is used in multiple designs, likely to have different flash
memory layout and access permissions.

This patch introduces a mechanism which allows the board layer to
provide flash configuration information to the flash driver.

The flash region which is going to be enabled for write access depends
on the area the code is executing from. If running from the bottom
half (A), the whole top half should be writeable (this includes both
NVRAM area and the B code space). If running from B, the writeable
area starts on top of RO and extends to the end of NVRAM.

CQ-DEPEND=CL:*248190
BRANCH=none
BUG=chrome-os-partner:37754
TEST=with the rest of the patches applied verified that software
     update can happen in both spaces, A and B.

Change-Id: Iab1c1a2766ae9bcfe04ff170c010f180cd1f770f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/327412
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Nadim Taha <ntaha@chromium.org>
2016-02-17 12:01:31 -08:00
Mulin Chao
38c64408f7 wheatley / nuc: Modified the internal ref voltage of ADC to 2.816V
In order to prevent the influence of the deviation of AVCC during ADC
conversion, the internal reference voltage (Vref) of ADC is fixed to
2.816V even it derives from AVCC.

Modified sources:
1. wheatley/board.c: Modified max adc voltage of ADC to 28.160V.
2. adc_chip.h: Modified internal ref voltage of ADC to 2.816V.

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

Change-Id: Ib514f4bdc114802870eb3c77c650e18c05eb9617
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/327046
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-02-17 02:02:03 -08:00