Commit Graph

8254 Commits

Author SHA1 Message Date
Scott Worley
f8dc461712 ec_flash: Add W25Q128 SPI flash
Add W25Q128 flash device support.

BRANCH=none
BUG=
TEST=Modify a board build for W25Q128 and check
SPI code sets flash security bits correctly.

Change-Id: I6173f4cf751f3fbf68af75983f44d357a0b954f6
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 14:50:32 -08:00
Scott Worley
940dd625b9 ec_driver: Add ADT7481 and TMP411 I2C sensors
Added I2C sensors ADT7481 and TMP411 with config
items and build rules.

BRANCH=none
BUG=
TEST=Define CONFIG_TEMP_SENSOR_ADT7481 or _TMP411
and build board.

Change-Id: I4d1eb55ee56ad3f42787538bb839193e683d0a60
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 14:50:31 -08:00
Scott Worley
eb29ab7acd ec_chip_mchp: Add PWM and fan files
Add Microchip MEC17xx family PWM and fan
source files for review

BRANCH=none
BUG=
TEST=Review only.

Change-Id: I91439ab999a4662d690b58b0fbbb887f643b3673
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 14:50:31 -08:00
Scott Worley
0a6a7be572 ec_chip_mchp: Add SPI files
Add Microchip MEC17xx family SPI master
controllers and flash files. SPI implements
public interface wrapper for QMSPI and GPSPI.
MEC17xx family uses QMSPI for loading
EC firmware. GPSPI is for general use (sensor).

BRANCH=none
BUG=
TEST=Review only.

Change-Id: I23001e254dd437caa0917949f4dd2eb903f1adb1
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 14:50:30 -08:00
Divya Sasidharan
bc8fda9e0f glkrvp: Enable discharge on AC config
This CONFIG DISCHARGE_ON_AC enables discharging
battery even when AC is connected.

BUG=b:71364739
BRANCH=glkrvp
TEST=On glkrvp EC console, execute command
     "chgstate discharge on" and verify if battery
     is discharging with "battery" command.

Change-Id: I709c7b5ccfea9058961d387a1575db9aebe70707
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
2017-12-28 14:50:30 -08:00
Divya Sasidharan
d41766df11 glkrvp: Fix hibernate <sec> to allow wakeup from hibernation
Issue was found when EC would not wake up from hibernate after
specified time period.

The infinite while loop blocks further hibernate functions
that needs to be executed after the board specific
hibernate method.
Remove this while loop to complete hibernation logic.

Also in hibernate function we should not be cutting down power
to EC (SMC_SHUTDOWN) as this will limit supporting wake sources
feature. Removing it in this patch.

BRANCH=master
BUG=b:70690772
TEST=On glkrvp EC console, check if "hibernate 30" wakes up EC
     after 30 sec, with only battery, only AC, with AC+battery.

Change-Id: Iae735cc26eeef8e205771d2f3c6e5260918e093e
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
2017-12-28 14:50:29 -08:00
Scott Worley
304bb8b09c ec_als: ALS now uses CPRINT macros
Modify ALS module to use CPRINT macros with
channel support.

BRANCH=none
BUG=
TEST=Build board(s) with ALS support such glados.
Test ALS CPRINT messages go out over EC UART and
can be masked off by channel mask UART command.

Change-Id: I65ffc889d63a778f3fb8995f508773842ba875ef
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 14:50:29 -08:00
Scott Worley
5b6ec95320 ec_gpio: Add GPIO power down support
Experimental and disabled by default feature for
powering down GPIO pins on those EC's supporting it.
Pins may be powered down by module ID or pin name.
Goal is to make use of common GPIO pin table.
If enabled, developer must implement power down
support in chip level. Developer re-powers module
pin(s) by calling the current gpio module enable
API in the wake path.

BRANCH=none
BUG=
TEST=Feature is disabled by default. Build all
boards with feature disabled.

Change-Id: Ifacd08e51def6424baf5c78c84b24f1d9f4bc4aa
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 12:35:08 -08:00
Scott Worley
4e9588ddcf ec_chip_mchp: Add MCHP chip folder
BRANCH=none
BUG=
TEST=Review only. Committing small pieces until
all code passes review.

Change-Id: I9d16f95314a7c97b11c4fe61602c6db2621e6024
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 12:35:07 -08:00
Scott Worley
c334f648bd ec_chip_mchp: Add ADC and DMA files
Add Microchip MEC17xx family ADC and DMA
source files for review.

BRANCH=none
BUG=
TEST=Review only.

Change-Id: Iccf19223ddd3f6774b90d5fca32079be9b0c4bcc
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 12:35:06 -08:00
Scott Worley
2f1f5a5551 ec_chip_mchp: Add LFW files
Add Microchip MEC17xx family little-firmware
(LFW) folder and files.

Change-Id: I9142266d41234574730fadccd5a2cc27fe3d8fd7
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
2017-12-28 12:35:06 -08:00
Daisuke Nojiri
137a0e850a Nami: Derive board files from Nautilus
BUG=b:70157960
BRANCH=none
TEST=make buildall

Change-Id: Iecbca185a3575818892f66f988ad36b0b175f317
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
2017-12-27 15:32:03 -08:00
Shawn Nematbakhsh
1c87ad4153 charger: Use shorter poll timeouts when on-ac
If AC is present but we're not charging yet, it's very possible this
status is transient (eg. due to cut-off battery, brief spike in current
useage, etc), so don't use very long task timeout.

BUG=b:70554834
BRANCH=None
TEST=Verify soraka doesn't take over a minute to boot when exiting from
ship mode.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I9dbfd8cb7dfc54cb8017bb0c7d633c5d64a15025
2017-12-27 13:18:41 -08:00
Vincent Palatin
90d735c3c3 stm32: re-factor registers.h addresses
Move all the peripheral blocks base addresses in a common block rather
than spread among the register definitions.
This will help making a cleaner STM32H7 implementation whose base
addresses are all different from other families.

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

BRANCH=none
BUG=b:67081508
TEST=compare all the ec.bin generated by 'make buildall' and verify
they are bit-identical with and without the change.

Change-Id: I52cafd2f3c9145dbcd585166df3fc78e38573bb4
2017-12-25 17:17:26 -08:00
Vincent Palatin
b8313fa5ae eve_fp: enable %li printf format
libfpsensor is using it.

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

BRANCH=none
BUG=b:70320279
TEST=run on Eve FP MCU with external library and see its traces are
correctly printed.

Change-Id: Iea1bc04d7ea7931478d14d655a7e986a0839a51a
2017-12-25 17:17:25 -08:00
Vincent Palatin
5e93965e94 printf: add %li format for compatibility
For compatibility/convenience, implement the '%li' printf format
as a *32-bit* integer format, as it might be expected by non-EC code.

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

BRANCH=none
BUG=b:70320279
TEST=run on Eve EVT with unspecified external binary and see its traces
are correctly printed.

Change-Id: Iac20e823c74aac4f659176416eebd804c321d47c
2017-12-25 17:17:25 -08:00
Nicolas Boichat
809244140d nautilus/poppy: Drop comment about thermistor
NCP15WB is actually the correct thermistor, let's drop that
copy-pasted comment.

BRANCH=none
BUG=b:35585396
TEST=make buildall -j

Change-Id: I5577bb70e354a6f2ef6338894793b808fe4b0e9a
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
2017-12-24 07:17:56 -08:00
Nicolas Boichat
292b4e1bcf fizz/nami: Drop CONFIG_THERMISTOR_NCP15WB
Nothing in fizz/nami code uses that thermistor: the 2 places that
would use it (ec_adc.c and bd99992gw.c) are not compiled in on
fizz/nami.

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

Change-Id: Ib2af8ad066eb05cd9510669600feb26641433eed
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
2017-12-21 22:50:38 -08:00
Nicolas Boichat
7eacce9720 ec_ec_comm_slave: Define extpower_is_present
On dual-battery slave, we use the charging allowed signal from
master to indicate whether external power is present.

In most cases, this actually matches the external power status
of the master (slave battery charging when AC is connected, or
discharging when slave battery still has enough capacity), with
one exception: when we do master to slave battery charging (in
this case the "external" power is the master).

BRANCH=none
BUG=b:65697962
TEST=Deplete wand battery to 5%, see that lux still provides power
     to it but the battery does not charge.

Change-Id: I8bd9f52c386a0a9edfae3837ba33725b3101a008
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
2017-12-21 22:50:34 -08:00
Nicolas Boichat
6040852eb7 poppy: Do not print base detection value if base stays connected
Reduces amount of spam during EC-EC communication.

BRANCH=none
BUG=b:65697962
TEST=Flash lux and wand, less spam on console

Change-Id: Ie66a3d0f4711741bf3d605f13e7595373c5246f5
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/725124
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-21 20:33:02 -08:00
Philip Chen
2401871112 scarlet: Set the maximal source current as 1.5A
Scarlet has only one PD port.
Let's always source 1.5A instead of 3A.

BUG=b:70524967
BRANCH=none
TEST=Monitor PD packets, see Scarlet rev2 broadcast
source_cap as 'FixedVol=5.00V, MaxCur=1.50A'

Change-Id: Id9bcd69f3a20ef5eb55eb7b17539fd304abb08e4
Signed-off-by: Philip Chen <philipchen@google.com>
2017-12-20 20:41:16 -08:00
Philip Chen
efc338869d power/rk3399: Fix the power sequence length passed to power_seq_run()
BUG=b:63037490
BRANCH=none
TEST=build scarlet

Change-Id: I80b068a7846037f43e7b385cf8e2ee0b08f42b15
Signed-off-by: Philip Chen <philipchen@google.com>
2017-12-20 20:41:11 -08:00
Philip Chen
be434eadd8 cleanup: power/rk3399: Remove unused power sequence
BUG=none
BRANCH=none
TEST=make buildall -j

Change-Id: I87c7a6274cbcb355a71987b26e8f092fbdbe8fa0
Signed-off-by: Philip Chen <philipchen@google.com>
2017-12-20 20:41:11 -08:00
Philip Chen
e896e732ae cleanup: Remove Nefario board
It's a dead board.

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

Change-Id: I9f5530afdea07bb5787fa2b674984147f8425fba
Signed-off-by: Philip Chen <philipchen@google.com>
2017-12-20 20:41:10 -08:00
Aseda Aboagye
d8f08ae1a0 meowth: zoombini: Add support for battery cutoff.
BUG=None
BRANCH=None
TEST=Flash meowth; 'cutoff'; Verify battery is cutoff.

Change-Id: I95c3d1c10512c49da4768824c4126a3755af2b1a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
2017-12-20 18:32:02 -08:00
Aseda Aboagye
4a7aceed59 power: cannonlake: SLP_SUS_L deasserted == S5.
When SLP_SUS_L is deasserted, that means the chipset is in S5.

BUG=None
BRANCH=None
TEST=Flash meowth; boot from AC only, verify that when SoC actually
boots the power state is reported as S0 instead of G3.

Change-Id: Ib9cd76aa9efd6f81df432205b8c1e8c342e32af6
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/837485
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-12-20 18:32:01 -08:00
Daisuke Nojiri
7c688c0f69 Fizz: Restore BJ current and voltage after sysjump
This patch makes EC save the max current and voltage of a barrel jack
adapter before sysjump and restore them after sysjump.

BUG=b:64442692
BRANCH=none
TEST=Boot Fizz and let coreboot set the adapter current and voltage.
Verify EC-RW inherits the current and voltage set by coreboot.

Change-Id: Ib1addf6e5ce059a39cb2d8b355515df1138409eb
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/835628
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-20 10:14:45 -08:00
Daisuke Nojiri
66db5b4e87 Fizz: Set default BJ voltage and current
BUG=b:64442692
BRANCH=none
TEST=make runtests && buildall. Boot Fizz and let coreboot set
the adapter current and voltage.

Change-Id: I1afc37b7d7b8a5d88becdae2ec6644a86022dfba
Reviewed-on: https://chromium-review.googlesource.com/831398
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-20 10:14:45 -08:00
Nicolas Boichat
9a284576a8 wand: Add wand board
hammer derivative, with a battery.

BRANCH=none
BUG=b:66575472
TEST=make BOARD=wand -j, flash to reworked hammer board,
     battery charging works.

Change-Id: I42366f4738b35c352b9be0c44a17ebeb323adfd1
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/678756
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-20 05:49:34 -08:00
Nicolas Boichat
764c42ca94 charge_state_v2: Update battery information in EC-EC slave mode
With this, the EC-EC communication slave (base) updates the battery
information, to be transmitted to the master (lid).

Note that, in the future, we might want to use a similar mechanism
to pass battery information on all boards (not only the ones that
use EC-EC communication to pass information to the lid), and TODO
are left in the code for this reason.

BRANCH=none
BUG=b:65697962
BUG=b:65697620
TEST=Flash lux and wand, EC-EC communication works.

Change-Id: I042138ee066a65c3664fbeb93aadabf483a6ceea
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/725125
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-12-20 05:49:34 -08:00
Nicolas Boichat
6f9b5d62a0 ec_ec_comm_slave: EC-EC communication slave task and functions
This adds functions required for the slave in EC-EC communication,
including the task that processes requests from the master.

This also adds required CONFIG_EC_EC_COMM_SLAVE/MASTER/BATTERY
config options.

BRANCH=none
BUG=b:65697962
TEST=Build wand and lux boards, flash it, EC-EC communication works.

Change-Id: I772d9023a830f4fbc37316ca31e4da8240de7324
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/828180
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-20 05:49:33 -08:00
Daisuke Nojiri
363853006e Fizz: Avoid activating BJ port if unplugged
This patch makes EC check the presence of power from a barrel jack
adapter before activating the BJ port.

BUG=none
BRANCH=none
TEST=Boot Fizz on type-c. Boot Fizz on BJ.
Switch power from type-c to BJ at G3 and S0.
Switch power from BJ to type-c at G3 and S0.

Change-Id: Iec982278e1ceb9b997069f66eb0e14f2e361efd2
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/777824
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-12-19 22:28:46 -08:00
Nicolas Boichat
752851a524 ec_commands: Add commands required for EC-EC communication
This adds 3 commands to obtain static and dynamic battery
information, as well as control base charger state.

These host commands are meant to be used as part of the EC-EC
communication protocol (based on hostcmd v4 protocol), but could
be used in the future to pass information between AP and EC,
especially when more than 1 battery is present, which would be
hard to support with the current MEMMAP-based approach.

BRANCH=none
BUG=b:65697962
BUG=b:65697620
TEST=Build wand and lux boards, flash it, EC-EC communication works.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Change-Id: I263454794394838918832c9e4623835ab2f3a3da
Reviewed-on: https://chromium-review.googlesource.com/670380
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-19 22:28:44 -08:00
Aseda Aboagye
8f63140a2b meowth: Add support for button trigerred recovery.
Also, add the button command.  It will be needed for FAFT at some point.

BUG=b:69140339
BRANCH=None
TEST=`make -j buildall`

Change-Id: I66f3193e54dd8f089f34428dd952330a56e7100e
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/830918
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-18 22:55:03 -08:00
Aseda Aboagye
a6509d28ab config: Add CONFIG_BUTTON_TRIGGERED_RECOVERY.
The CONFIG_BUTTON_RECOVERY option was a little confusing especially when
we have the CONFIG_DEDICATED_RECOVERY_BUTTON option.  This commit
renames CONFIG_BUTTON_RECOVERY to CONFIG_BUTTON_TRIGGERED_RECOVERY to
help make things a little clearer.

Additionally, to avoid copy paste, defining
CONFIG_BUTTON_TRIGGERED_RECOVERY will populate the recovery_buttons
table with either the volume buttons or a dedicated recovery button
depending what the board is configured for.

Lastly, if CONFIG_DEDICATED_RECOVERY_BUTTON is defined,
CONFIG_BUTTON_TRIGGERED_RECOVERY is defined as well since it's implicit.

BUG=chromium:783371
BRANCH=None
TEST=make -j buildall

Change-Id: Idccaa4d049ace0df3b98b35bdd38ac9dbd843200
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/830917
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2017-12-18 22:55:02 -08:00
Philip Chen
f889d14d4e charger/rt946x: Increase boost current threshold
We should at least be able to source 1.5A.

BUG=b:70524967
BRANCH=none
TEST=Confirm reg 0x0a is set correctly

Change-Id: Ia21af18d72138b5ab81f683df5aaa92c50981694
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/830896
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-18 20:33:07 -08:00
Aseda Aboagye
1ca59fb7b1 meowth: zoombini: Mask off 5V PGOOD and COMP_C.
The boards need to have 5V masked off from the power good tree.
Additionially, Meowth needs to have the COMP_C fault masked from the
fault mask because its enable is connected and not grounded like on
Zoombini.

BUG=b:69935563
BRANCH=None
TEST=flash zoombini; Verify that we can boot to S0.

Change-Id: Ia51004a131e7c31d0e5ee59d87ab13455b822779
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/807632
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-18 20:33:00 -08:00
Nicolas Boichat
bbb40ce21d consumer: Remove flush operation
Nobody is calling the flush function for consumer_ops structure,
so let's remove it to save flash space, until we find a use for it.

CQ-DEPEND=CL:*529221
BRANCH=none
BUG=chromium:795624
TEST=make buildall -j, saves from 40 to 128 bytes on some boards.

Change-Id: Iad18b30f419ccebc54a90914ec46da84b8d19601
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/826905
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-18 20:32:58 -08:00
Philip Chen
6aa967e4bb charger/rt946X: Set boost current threshold correctly
rt946x_closest_reg_via_tbl() is buggy and doesn't
return the right reg value because of misuse of ARRAY_SIZE().
We should fix it.

Meanwhile, since rt946x_closest_reg_via_tbl() is only called in
rt946x_set_boost_current(), let's just delete rt946x_closest_reg_via_tbl()
and move its code to rt946x_set_boost_current().

BUG=b:70524967
BRANCH=none
TEST=Confirm reg 0x0a is set correctly

Change-Id: Ie9c90ebf63596a52f864ff5809488731edc41fff
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/830895
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-18 17:55:00 -08:00
Aseda Aboagye
34788758ac meowth: Fix PPC configs.
There are 2.

BUG=None
BRANCH=None
TEST=Flash meowth.  Verify that EC doesn't panic.

Change-Id: Iba0ea28a93ecb67c8b799440b1a7395d4564893b
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/829919
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-18 17:54:59 -08:00
Aseda Aboagye
194772813e meowth: Init LEDs off.
Turn off all LEDs at init such that we have them in a known state for
now.

BUG=None
BRANCH=None
TEST=Flash meowth and zoombini, verify that there are no unexpected
colors.

Change-Id: I927dc3c6f28bfa94fb163c379b3fc548696fdaaf
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/833023
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-18 17:54:59 -08:00
Nicolas Boichat
575c03f31c chip/stm32: Add support for half-duplex UART
BRANCH=none
BUG=b:65697962
TEST=make BOARD=wand -j

Change-Id: I2af4acb5cce6da6ce2f01d6d60cf5e806c9a4ed2
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/821891
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-12-15 05:32:29 -08:00
ayowu
7610082ddc ec: Re-configure GPIO02 to be INPUT | PULL_UP for power saving
GPIO02 (EC_HAVEN_RESET_ODL) is now configured to GPIO_ODR_HIGH,
designed for EC to reset H1. And it's no longer used with just
the HW path reserved (DNS R267 on schematic).
Tests showed that INPUT | PULL_UP has lower EC power consumption
so reconfiguring here.

BUG=b:64503543
BRANCH=none
TEST=manual
(on chroot)
$ make BOARD=soraka -j
$ ./util/flash_ec --board soraka
(on DUT)
$ powerd_dbus_suspend
(on chroot)
$ dut-control -p $PORT pp3300_dsw_ec_ma -t 10 | grep @@
> @@               NAME  COUNT  AVERAGE  STDDEV    MAX   MIN
> @@   pp3300_dsw_ec_ma   5629     1.25    0.71  16.60  1.12

Without the change, the original setting gives:
> @@               NAME  COUNT  AVERAGE  STDDEV    MAX   MIN
> @@   pp3300_dsw_ec_ma   4674     2.69    1.98  12.00  2.00

Change-Id: I4e2268612109155f57fdd236088cadaaba54bb3f
Signed-off-by: Ayo Wu <ayowu@google.com>
Reviewed-on: https://chromium-review.googlesource.com/786951
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-12-14 23:57:29 -08:00
Rachel Nancollas
ae00aa8022 zoombini: Add support for P1 PPC (port 1 and 2)
Added code to support port 1 and 2 power path controller
since we didn't have the parts on rev 0.

BUG=None
BRANCH=None
TEST=make board=zoombini, make board=meowth
TEST=Make sure Zoombini can charge in on all ports.
TEST=Make sure Zoombini can charge out on all ports.

Change-Id: Idf174125cc5a617ad77378ce65d5c0f6cbb9fce4
Signed-off-by: Rachel Nancollas <rachelsn@google.com>
Reviewed-on: https://chromium-review.googlesource.com/823211
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-12-14 18:11:53 -08:00
Daisuke Nojiri
b4e6b8eef9 Fizz: Remove power control of V3P3_USBPD
PU62 used to be used to turn on power to PS8751 but it's been removed.
PS8751 is powered directly from PP3300_EC. So, EC doesn't need to
enable it.

BUG=b:65212601
BRANCH=none
TEST=On Kench EVT SKU5, verify type-c port is powered.

Change-Id: I2a1ce28efe09212a4ce7e7b57c0560e42e137cec
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/826256
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-12-14 18:11:52 -08:00
Nicolas Boichat
b9939cf42b touchpad_elan: Add support for debugging mode
We add 2 hashes that each map to a list of allowed commands
(command list is secret, and provided by Elan).

UPDATE_EXTRA_CMD_TOUCHPAD_DEBUG on the USB interface have the
following format for the parameter:
- param[0]: must be 0xff
- param[1]: offset of the I2C command in data
- param[2]: command length
- param[3-4]: read-back length (MSB first) over I2C, can be 0
- param[5-49]: data, is verified using SHA-256 hash.

The I2C command pointed at by param[1-2] is then sent over
I2C, and the data is read back into a shared buffer of size
param[3-4].

The data can be fetched over USB by a single byte USB update
touchpad debug command (indicating an offset in 64-bytes unit),
fetching data from the shared buffer in blocks of 64 bytes.

BRANCH=none
BUG=b:63993891
TEST=Elan can run debugging commands using their proprietary tool.

Change-Id: Idb19bcb940b7f030c3b3aeaf39d6b725fcb9ef34
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/763576
Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
2017-12-14 18:11:52 -08:00
Philip Chen
d99b8722c9 scarlet: Enable DMA for UART_RX
BUG=b:70565700
BRANCH=none
TEST='firmware_FwScreenPressPower' passes 4/4

Change-Id: Ifd87a7a212b3731a25630a791343ff96aef0e9cb
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/826475
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-14 15:27:04 -08:00
Rachel Nancollas
cb3a155b90 meowth: fixed EN_PP3300_WLAN and USB_PD_RST_L states
In gpio.inc, fixed EN_PP3300_WLAN so it's always high
since CNVi requires PP3300_WLAN power up at the same
time as PP3300_A.
Also, fixed USB_PD_RST_L to be an OD output.

BUG=b:69139536
BRANCH=none
TEST=make BOARD=meowth and BOARD=zoombini
runs with no errors

Change-Id: I3c2a4e7ca7b1ab5f9122d17324822dc5e61e70a8
Signed-off-by: Rachel Nancollas <rachelsn@google.com>
Reviewed-on: https://chromium-review.googlesource.com/778120
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-12-14 15:27:01 -08:00
Nicolas Boichat
27c01992fc usb_updater2: Increase touchpad debug buffer length to 50 bytes.
We would like to use all 64-bytes of the buffer as parameter to
UPDATE_EXTRA_CMD_TOUCHPAD_DEBUG (12 bytes for update_frame_header,
2 bytes for the extra command type, leaving 50 bytes of payload).

BRANCH=none
BUG=b:63993891
TEST=./usb_updater2 -g 00 -d 18d1:502b

Change-Id: I023aa760f1a4cf9cacf9262a758cba1120d4f380
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/780372
Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
2017-12-14 04:22:40 -08:00
YB.Ha
313ea684c3 nautilus: Limit input current to fraction of negotiated limit
Limit input current to 96% of negotiated limit

BUG=b:70481533
BRANCH=none
TEST=build/flash nautilus, connect adapter and check input current

Change-Id: I20e250d8a37f22b471a69329b2e74da2c7ff2763
Reviewed-on: https://chromium-review.googlesource.com/818844
Commit-Ready: YongBeum Ha <ybha@samsung.com>
Tested-by: YongBeum Ha <ybha@samsung.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-12-13 22:33:27 -08:00