| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the normal lab use, emulating a sink has no PD comm, like a passive
hub. For the PD FAFT use, we need to validate some PD behavior, should
support sink roles with PD comm enabled. Two new roles "pdsnk" and
"pdsnkdts" are introduced.
BRANCH=servo
BUG=b:134700685
TEST=Typed "cc pdsnk" or "cc pdsnkdts" can transit the DUT port to
the PD state "SNK_READY", instead "SNK_DISCOVERY".
Change-Id: If6a7c39cd296986b8b28de1c1fbe66ee8438c709
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1682920
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support a new flag to enable DRP. The do_cc() function becomes having 4
arguments. So change to merge them into a single cc_config with
different bit masks.
For the force_source or force_sink role, we explicitly set the the Rp
or Rd resistors on CC lines. But for DRP role, the Rp/Rd toggling is
controlled by the PD state machine. So don't set any CC pull resistor
for DRP.
Support an "on" option in "cc" command to restore the previous role
before emulating detach.
Add "usbc_action drp" to toggle the DRP state, which is compatible with
Plankton.
BRANCH=servo
BUG=b:135691171
TEST=Ran the firmware_PDTrySrc test passed, and not break all the
existing PD FAFT tests.
Change-Id: I3b90611c9840f502e496c42f80354e7ee002f96e
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1682919
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the PD policy and comments:
* Only allow data role swap on DUT port;
* Remove the dts mode condition to initiate a data role swap
(not necessary to limit it to dts mode).
BRANCH=servo
BUG=b:135691171
TEST=Checked the CHG port is always UFP.
TEST=Checked the DUT port is SRC/UFP, a data role swap happened (but
it was initiated by DUT).
Change-Id: I668703209301a9542e94768f31f6ce8e2d9eb0f4
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1682918
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pd_config_init() does two things:
* pd_tx_init() to init the GPIO MODULE_USB_PD;
* pd_set_host_mode() to set CC pull resistors.
The pd_config_init() is called on PD phy init hook.
For setting CC pull resistors, calling pd_set_host_mode() is enough.
Don't need to reinit GPIO MODULE_USB_PD.
BRANCH=servo
BUG=b:135691171
TEST=Set "cc" role to "src", "snk", "srcdts", "snkdts", and "off".
TEST=Unplugged and replugged the CHG port cable.
Change-Id: I1e783dfa5da4f8e8f1d9d591818eb1128b7a8caa
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1682917
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Opt for 7bit slave addresses in EC code. If 8bit is
expected by a driver, make it local and show this in
the naming.
Use __7b, __7bf and __8b as name extensions for i2c/spi
addresses used in the EC codebase. __7b indicates a
7bit address by itself. __7bf indicates a 7bit address
with optional flags attached. __8b indicates a 8bit
address by itself.
Allow space for 10bit addresses, even though this is
not currently being used by any of our attached
devices.
These extensions are for verification purposes only and
will be removed in the last pass of this ticket. I want
to make sure the variable names reflect the type to help
eliminate future 7/8/7-flags confusion.
BUG=chromium:971296
BRANCH=none
TEST=make buildall -j
Change-Id: I2fc3d1b52ce76184492b2aaff3060f486ca45f45
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1699893
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In servo v4 hardware logic, both CC lines are wired directly
to DUT. When servo v4 as a snk, DUT may source Vconn to CC2
and make the voltage high as vRd-3.0, which makes the PD
state mess up. As the PD state machine doesn't handle this
case. It assumes that CC2 is separated by a Type-C cable,
resulting a voltage lower than the max of vRa.
It fakes the voltage within vRa so the PD state machine
checks the value as expected.
This is an issue only happening on servo v4 as it wires both
CC lines to DUT.
BUG=b:134700685
BRANCH=servo
TEST=Servo v4 as snk, verified the CC2 is sensed vRa, i.e.
the output "CC1:0" (TYPEC_CC_VOLT_OPEN), instead of "CC1:7"
(TYPEC_CC_VOLT_SNK_3_0).
2019-06-18 15:05:47 > cc snk
2019-06-18 15:05:50 cc: on
2019-06-18 15:05:50 dts mode: off
2019-06-18 15:05:50 chg mode: off
2019-06-18 15:05:50 chg allowed: off
2019-06-18 15:05:50 > C1 st2 SNK_DISCONNECTED
2019-06-18 15:05:50 C1 st3 SNK_DISCONNECTED_DEBOUNCE
2019-06-18 15:05:50 C1 st5 SNK_DISCOVERY
2019-06-18 15:05:51 > tcpc 1 state
2019-06-18 15:05:53 Port C1, Dis - CC:2, CC0:6, CC1:0
2019-06-18 15:05:53 Alert: 0x00 Mask: 0x007d
2019-06-18 15:05:53 Power Status: 0x48 Mask: 0x00
TEST=Ran the PD FAFT test firmware_PDConnect passed.
Change-Id: I10f1ffe80768100ee3ed4c374598df7c2f9a8d05
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1666468
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Servod now uses the "cc" console command to change the dts mode. So no
one uses the "dts" command. Remove it to save the flash space (128
bytes).
BUG=b:131840808
BRANCH=servo
TEST=Flashed the servo v4 firmware and started servod. Tried:
$ dut-control servo_v4_dts_mode
servo_v4_dts_mode:on
$ dut-control servo_v4_dts_mode:off servo_v4_dts_mode
servo_v4_dts_mode:off
$ dut-control servo_v4_dts_mode:on servo_v4_dts_mode
servo_v4_dts_mode:on
Change-Id: I35778ff8975af35e623a9c9c70926264161cff3d
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1669742
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Commit-Queue: Jason Clinton <jclinton@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It fixes a hard reset issue.
After a hard reset, the PD state goes to SNK_HARD_RESET_RECOVER state
and waits for the VBUS "off" and then back "on" again. When the VBUS
goes back to "on", it then transits to SNK_DISCOVERY state that
replies the Source_Cap message. In order to make the VBUS detection
fast enough, these interrupts are needed to wake the PD tasks up;
otherwise, it missed the Source_Cap message
BUG=b:134701032
BRANCH=servo
TEST=Made servo v4 as sink and issued Hard_Reset on either DUT or servo.
2019-06-14 13:55:04 > cc snk
2019-06-14 13:55:06 cc: on
2019-06-14 13:55:06 dts mode: off
2019-06-14 13:55:06 chg mode: off
2019-06-14 13:55:06 chg allowed: off
2019-06-14 13:55:06 > C1 st3 SNK_DISCONNECTED_DEBOUNCE
2019-06-14 13:55:06 C1 st5 SNK_DISCOVERY
2019-06-14 13:55:06 C1 Req [1] 5000mV 3000mA
2019-06-14 13:55:06 C1 st6 SNK_REQUESTED
2019-06-14 13:55:06 C1 st7 SNK_TRANSITION
2019-06-14 13:55:06 C1 st8 SNK_READY
2019-06-14 13:55:07
2019-06-14 13:55:07 > pd 1 hard
2019-06-14 13:55:16 C1 st34 HARD_RESET_SEND
2019-06-14 13:55:16 > C1 st35 HARD_RESET_EXECUTE
2019-06-14 13:55:16 C1 HARD RST TX
2019-06-14 13:55:16 C1 st4 SNK_HARD_RESET_RECOVER
2019-06-14 13:55:16 Repeat msg_id[0] port[1]
2019-06-14 13:55:16 Repeat msg_id[0] port[1]
2019-06-14 13:55:16 Repeat msg_id[0] port[1]
2019-06-14 13:55:16 C1 st5 SNK_DISCOVERY
2019-06-14 13:55:16 Repeat msg_id[0] port[1]
2019-06-14 13:55:16 C1 HARD RST RX
2019-06-14 13:55:16 C1 st4 SNK_HARD_RESET_RECOVER
2019-06-14 13:55:17 C1 st5 SNK_DISCOVERY
2019-06-14 13:55:17 C1 Req [1] 5000mV 3000mA
2019-06-14 13:55:17 C1 st6 SNK_REQUESTED
2019-06-14 13:55:17 C1 st7 SNK_TRANSITION
2019-06-14 13:55:18 C1 st8 SNK_READY
2019-06-14 13:55:18 C1 Req [1] 5000mV 3000mA
2019-06-14 13:55:18 C1 st6 SNK_REQUESTED
2019-06-14 13:55:18 C1 st7 SNK_TRANSITION
2019-06-14 13:55:18 C1 st8 SNK_READY
Issued "pd 0 hard" on DUT:
2019-06-14 13:56:07 > C1 HARD RST RX
2019-06-14 13:56:11 C1 st4 SNK_HARD_RESET_RECOVER
2019-06-14 13:56:12 C1 st5 SNK_DISCOVERY
2019-06-14 13:56:12 C1 Req [1] 5000mV 3000mA
2019-06-14 13:56:12 C1 st6 SNK_REQUESTED
2019-06-14 13:56:12 C1 st7 SNK_TRANSITION
2019-06-14 13:56:12 C1 st8 SNK_READY
Change-Id: I0cc80515df8044ec07fa6795d3723aca2a3dc0ef
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660125
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The DUT may have multiple USB Type-C ports. In order to identify a pair
of PD port partners, the PD FAFT tests asks one partner to emulate a detach
and then checks the other partner if it sees a proper status.
This requires to implement a CC detach on servo v4. A console command
'fakedisconnect' (similar to plankton) is introduced to disconnect for a
given period and then connect back.
BUG=b:131840808
BRANCH=servo
TEST=Manuall tested the commands on servo v4 console to emulate detach.
. > cc
. cc: on
. dts mode: on
. chg mode: on
. chg allowed: on
. > pd 1 state
. Port C1 CC1, Ena - Role: SRC-UFP State: 23(SRC_READY), Flags: 0x1415e
. > cc off
. cc: off
. dts mode: on
. chg mode: on
. chg allowed: off
. > pd 1 state
. Port C1 CC1, Dis - Role: SNK-UFP State: 2(SNK_DISCONNECTED),
. Flags: 0x0000
Checked the DUT EC console to verify the port status as detached.
. > pd 0 state
. Port C0 CC2, Ena - Role: SNK-DFP State: DRP_AUTO_TOGGLE, Flags: 0x0020
Made the servo v4 connect back.
. > cc srcdts
. cc: on
. dts mode: on
. chg mode: on
. chg allowed: on
. > pd 1 state
. Port C1 CC1, Ena - Role: SRC-UFP State: 23(SRC_READY), Flags: 0x1415e
Checked the DUT EC console to verify the port status as connected.
. > pd 0 state
. Port C0 CC2, Ena - Role: SNK-DFP State: SNK_READY, Flags: 0x14946
Typed 'fakedisconnect' command to disconnect for a period.
. > fakedisconnect 1000 2000
. Fake disconnect for 2000 ms starting in 1000 ms.
Verified DUT got disconnected and then connected back.
Change-Id: Ie29cfd4f55ac48b593f71d580762ff5e77ee9602
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1603469
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2fa7472da15a402ba8649344016ab5351cb768e7.
Reason for revert: Use servo I2C driver to access the INA's instead. Don't need the INA driver and the console command in servo v4 firmware.
Original change's description:
> servo_v4: Enable VBUS voltage and current measurement
>
> Enable the INA functions on the VBUS of the DUT port (PP_DUT) and the
> VBUS of the CHG port (PP_CHG).
>
> BUG=b:132807223
> BRANCH=servo
> TEST=Typed the console command "ina 0" and returned:
> > ina 0
> Configuration: 4127
> Shunt voltage: 10d9 => 10782 uV
> Bus voltage : 3d3a => 19592 mV
> Power : 069b => 42275 mW
> Current : 086d => 2157 mA
> Calibration : 0400
> Mask/Enable : 0008
> Alert limit : 0000
>
> Used a multimeter to measure the VBUS on the DUT port. The measured
> voltage and current are close to the above values.
>
> Did the same thing on the CHG port.
>
> Change-Id: I1d49540b4685f299437821251cd6422b1c0ac0b8
> Signed-off-by: Wai-Hong Tam <waihong@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/1613805
> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
> Reviewed-by: Scott Collyer <scollyer@chromium.org>
Bug: b:132807223
Change-Id: If8517ceb5255e38bb2824e6cb9fe1848142950c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1638718
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable the INA functions on the VBUS of the DUT port (PP_DUT) and the
VBUS of the CHG port (PP_CHG).
BUG=b:132807223
BRANCH=servo
TEST=Typed the console command "ina 0" and returned:
> ina 0
Configuration: 4127
Shunt voltage: 10d9 => 10782 uV
Bus voltage : 3d3a => 19592 mV
Power : 069b => 42275 mW
Current : 086d => 2157 mA
Calibration : 0400
Mask/Enable : 0008
Alert limit : 0000
Used a multimeter to measure the VBUS on the DUT port. The measured
voltage and current are close to the above values.
Did the same thing on the CHG port.
Change-Id: I1d49540b4685f299437821251cd6422b1c0ac0b8
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1613805
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Servo_v4 is used as a testing equipment, not like a normal Chromebook.
So we don't syslock the system and WP the flash. Disable these
commands to save space.
Before:
1136 bytes in flash and 2336 bytes in RAM available on RO
After:
1712 bytes in flash and 2344 bytes in RAM available on RO
BUG=b:131840808
BRANCH=servo
TEST=Built and flashed the servo v4 firmware. Started servod and
verified some functions.
Change-Id: Ic84d48d984ae9abb1cbbb7b90aaece1f99d9d729
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1613804
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The servo_v4 is almost out-of-space. Disable some unused features
and console commands to reclaim some space.
Before:
176 bytes in flash and 4392 bytes in RAM available on RO
After:
1264 bytes in flash and 4400 bytes in RAM available on RO
BUG=b:131840808
BRANCH=servo
TEST=Built and flashed the servo v4 firmware. Started servod and
verified some functions.
Change-Id: Ic0e76794d0603fccc2f733cad388f54650d2cd45
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1597959
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From crrev.com/c/1529724, servo-v4 console displays the ccd polarity
in opposite manner.
2019-05-15 11:53:59 [583.849805 CCD: connected noflip]
2019-05-15 11:54:01 adC
2019-05-15 11:54:01 CHG_CC1_PD = 1708
2019-05-15 11:54:01 CHG_CC2_PD = 33
2019-05-15 11:54:01 DUT_CC1_PD = 1637
2019-05-15 11:54:01 DUT_CC2_PD = 1625
2019-05-15 11:54:01 SBU1_DET = 3092
2019-05-15 11:54:01 SBU2_DET = 24
2019-05-15 11:54:01 SUB_C_REF = 569
2019-05-15 11:54:20 C1 st3
2019-05-15 11:54:20 C1 st5
2019-05-15 11:54:20 [604.585404 CCD: connected flip]
2019-05-15 11:54:23 adc
2019-05-15 11:54:24 CHG_CC1_PD = 1712
2019-05-15 11:54:24 CHG_CC2_PD = 32
2019-05-15 11:54:24 DUT_CC1_PD = 1616
2019-05-15 11:54:24 DUT_CC2_PD = 1644
2019-05-15 11:54:24 SBU1_DET = 20
2019-05-15 11:54:24 SBU2_DET = 2955
2019-05-15 11:54:24 SUB_C_REF = 611
BUG=None
BRANCH=None
TEST=manually build fw and checked.
2019-05-15 12:07:46 [27.057955 CCD: connected noflip]
2019-05-15 12:07:47 adc
2019-05-15 12:07:48 CHG_CC1_PD = 1705
2019-05-15 12:07:48 CHG_CC2_PD = 4
2019-05-15 12:07:48 DUT_CC1_PD = 1617
2019-05-15 12:07:48 DUT_CC2_PD = 1645
2019-05-15 12:07:48 SBU1_DET = 20
2019-05-15 12:07:48 SBU2_DET = 3102
2019-05-15 12:07:48 SUB_C_REF = 592
2019-05-15 12:08:05 [45.191161 CCD: connected flip]
2019-05-15 12:08:06 adc
2019-05-15 12:08:08 CHG_CC1_PD = 1704
2019-05-15 12:08:08 CHG_CC2_PD = 4
2019-05-15 12:08:08 DUT_CC1_PD = 1638
2019-05-15 12:08:08 DUT_CC2_PD = 1625
2019-05-15 12:08:08 SBU1_DET = 2970
2019-05-15 12:08:08 SBU2_DET = 23
2019-05-15 12:08:08 SUB_C_REF = 563
Change-Id: I0e8540fb30460827772fefd63a3426d67fa85092
Signed-off-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1613650
Reviewed-by: Nick Sanders <nsanders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
servo_v4 is tight on space, so remove the history console command to
gain some space.
BUG=None
BRANCH=None
TEST=make -j BOARD=servo_v4
Change-Id: Idba1b05335e31f655e98883abdd15000e6310c41
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1613799
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents the system from negotiating power or reenabling
dualrole after it's turned off in board.c.
BUG=b:129882930
BRANCH=servo
TEST=cc snkdts stays snk.
Change-Id: I0a05eb9e8073cec7da884e071e023bcddadb130f
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1553308
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's simply a bad idea to describe a macro in multiple locations.
It'll make it hard to change. It'll be difficult to keep all
locations in sync.
This patch replaces the comment duplicated in all ec.tasklist with
a pointer to the CONFIG_TASK_LIST definition. The macro will be
described in a single place (just like all/most other macros).
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=none
BRANCH=none
TEST=buildall
Change-Id: Id658b9d68e742e4334c692b804d9c98c8de21313
Reviewed-on: https://chromium-review.googlesource.com/1551579
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SBU orientation was detected in a one-shot check, that didn't
ensure that the line was idle.
Change to detect SBU orientation independently of PD state, and only while
it's disconnected from the host.
Delete keepalive and ccd_enable as they aren't meaningful for the new
mechanism.
BUG=b:128646723, chromium:942130
BRANCH=servo
TEST=unplug a lot of times, orientation always correct.
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Change-Id: I16c770b9d8d7a0c2d90aa214cb8cdec4c36a7303
Reviewed-on: https://chromium-review.googlesource.com/1529724
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Todd Broch <tbroch@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mechanical replacement of bit operation where operand is a constant.
More bit operation exist, but prone to errors.
Reveal a bug in npcx:
chip/npcx/system-npcx7.c:114:54: error: conversion from 'long unsigned int' to 'uint8_t' {aka 'volatile unsigned char'} changes value from '16777215' to '255' [-Werror=overflow]
BUG=None
BRANCH=None
TEST=None
Change-Id: I006614026143fa180702ac0d1cc2ceb1b3c6eeb0
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1518660
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Requested for linux integration, use BIT instead of 1 <<
First step replace bit operation with operand containing only digits.
Fix an error in motion_lid try to set bit 31 of a signed integer.
BUG=None
BRANCH=None
TEST=compile
Change-Id: Ie843611f2f68e241f0f40d4067f7ade726951d29
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1518659
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 590a45db85507787af77cf6bfc8ae63499cbf1cc.
BRANCH=none
BUG=b:124465253
TEST=manual,
Running
sudo servo_updater -b servo_v4 --force -f build/servo_v4/ec.bin
sudo servo_updater -b servo_v4 --force -f build/servo_v4/ec.bin
passes without failure,
servo_updater.ServoUpdaterException: usb_updater2 exit with res = 3
Change-Id: Ied9939192c30342bb6314e6dccfcd56d950659ab
Signed-off-by: Todd Broch <tbroch@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1497438
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It creates smaller code.
BUG=chromium:851727,b:65441143
BRANCH=none
TEST=builds with the new compiler
Change-Id: I569c6f75a595331fb489323d8b3f02d5dd2d5050
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1450713
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes the following commands:
CONFIG_CMD_ACCELSPOOF
CONFIG_CMD_FASTCHARGE
CONFIG_CMD_GETTIME
CONFIG_CMD_MEM
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=none
BRANCH=none
TEST=buildall
Change-Id: Ic6e0bd4441f17636d77468874646e3aabe0d250b
Reviewed-on: https://chromium-review.googlesource.com/1475770
Commit-Ready: Tony Zou <zoutao@huaqin.corp-partner.google.com>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the servo_v4 build is within 48 bytes of exceeding its RO
flash size. With this change to remove the USART3 code from the RO
image, there should be just about 350 free bytes of space.
BRANCH=None
BUG=None
TEST=builds, hey_flash_used in RO elf file shows 0x170 free bytes
Change-Id: I7ee8f6c964eb3e0fb009fba61430bab656c03c2e
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1340545
Reviewed-by: Nick Sanders <nsanders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function sets the default Rp value, but should
not enable Rp if it's not already enabled.
BRANCH=servo
BUG=b:116630203
TEST=check CC lines after booting with/without charge through.
Change-Id: Ie9709796940cf908b9af3701d2123f16596f04e0
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1244381
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Preserved bbram state causes failure to reinit on reboot.
Clear on board init.
BRANCH=None
BUG=b:111573811
TEST=PD reinits on reboot.
Change-Id: Ifdf98b5793cb99e2900ac5dc53263a86317b6b07
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1187883
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CQ-DEPEND=CL:1180950
BUG=chromium:851727,b:65441143
BRANCH=none
TEST=cros_run_unit_tests --packages chromeos-ec
TEST=make buildall -j
Signed-off-by: Wei-Han Chen <stimim@chromium.org>
Change-Id: I12ee0c9e0090212d1b4ca2ddb240439dea1c7f4b
Reviewed-on: https://chromium-review.googlesource.com/1180951
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Wei-Han Chen <stimim@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit bcd6842fb861b99588039b0bb72fafd92853525e.
Reason for revert: This breaks whiskers.
Original change's description:
> **/build.mk: Set CROSS_COMPILE* to point to coreboot-sdk
>
> board/servo_v4 used it already but doesn't need the override anymore,
> nds32 also used it, therefore no change.
>
> BUG=chromium:851727,b:65441143
> BRANCH=none
> TEST=builds with the new compiler
>
> Change-Id: I59a7181b87293da2a8515b158c17417b5ba05404
> Signed-off-by: Patrick Georgi <pgeorgi@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/1172974
> Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
> Tested-by: Patrick Georgi <pgeorgi@chromium.org>
> Reviewed-by: Stefan Reinauer <reinauer@google.com>
Bug: chromium:851727, b:65441143
Change-Id: If09eca04efc6461b951879ad528832bc50ca50d2
Reviewed-on: https://chromium-review.googlesource.com/1177221
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support to configure dualrole setting
per port, so that servo v4 can adjust charge and
dut port separately.
servo will detect charge capability on CHG port
and choose source or sink as appropriate.
Fix null dereference bug in genvif duel to dynamic src_pdo.
"cc" command allows src, snk, srcdts, snkdts configurations.
BRANCH=None
BUG=b:72557427
TEST=charge through and also passive hub. Note Dru doesn't accept DTS hub.
TEST=make buildall -j
Change-Id: I19f1d1a5c37647fec72202191faa4821c06fb460
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1096654
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
board/servo_v4 used it already but doesn't need the override anymore,
nds32 also used it, therefore no change.
BUG=chromium:851727,b:65441143
BRANCH=none
TEST=builds with the new compiler
Change-Id: I59a7181b87293da2a8515b158c17417b5ba05404
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1172974
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This defaults servo_v4 to use the more compact coreboot
toolchain, as the flash is full.
BUG=b:80261180
BRANCH=None
TEST=still works
Change-Id: Ifb970c4a22439e0c53420cfff2464a658331c799
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1072745
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some tests cannot be built on some boards (not enough SRAM,
unusual configuration, etc.). Instead of the long list of
exceptions in test/build.mk that we currently use, allow
each board (or chip) build.mk to set test-list-y, and
only use the default list if it is unset.
BRANCH=poppy
BUG=b:80167548
TEST=make buildalltests -j
Change-Id: I803c691f419451aad4396529302a4805cbe3f9b5
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1074572
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C0 PD would occasionally get stack overflow.
Add venti stack.
BRANCH=servo
BUG=b:79266510
TEST=no more crash
Change-Id: Id1d7174af954b5e5716ba402ae5b993e2971464d
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1056488
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Servo V4 is out of space, so remove the crash command to gain some back.
BUG=None
BRANCH=None
TEST=make -j buildall
Change-Id: I9e5617de2a41f12f60d1fab246acddbbcfa3bea2
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1022964
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that board version can come from CBI, we can have a real error
reading it. We should pass that error to the console or to the
AP on the host command and let the AP firmware (or user) decided how to
handle that error case
Also update the CONFIG_BOARD_VERSION to be derived instead of needed
in most cases.
BRANCH=none
BUG=b:77972120
TEST=Error reported on EC console and AP console when CBI is
invalid on yorp
Change-Id: Ib8d80f610ea226265a61e68b61965150cdc9bb04
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1015776
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This works around the occasional garbage packet storm
found in coral, which causes a stack overflow.
BUG=b:77336824
TEST=loop power_state:rec on coral 200x
BRANCH=servo
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Change-Id: I08faf333cb0e7b7bb7016956de44f43621b950ea
Reviewed-on: https://chromium-review.googlesource.com/989215
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
yorp measures each port's vbus separately on a deticated ADC.
Also, add config to take care of ADV_VBUS -1 case too.
BRANCH=none
BUG=b:74127309
TEST=none
Change-Id: I6f4df96caffc3b527b69e67358631dd448172cde
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/956555
Reviewed-by: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions are not used by usb_i2c.c on chip/stm32, let's
move them to board/cr50 which is the only place where they are
used.
BRANCH=none
BUG=None
TEST=make buildall -j
Change-Id: I8c1b292838b8dbee9a9001add9332e0add80c342
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/778749
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change switches the SS lines off in the main USB mux.
There has been some general flakyness regarding USB3 peripherals
and this change might address it.
BUG=chromium:718075
BRANCH=None
TEST=lsusb -t indicates 5000M before, 480M after.
Change-Id: Id201fb20dc6489c4a071cb1c9c0624d7aa54652d
Reviewed-on: https://chromium-review.googlesource.com/509130
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have an ec3po gpio driver that also works. Let's
save some flash space by using that instead, and deleting the
gpio usb endpoint. Saves 448 bytes.
BUG=None
BRANCH=servo
TEST=servod still runs.
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Change-Id: If1c764c97fba4798f8501a0c0364d2690d2fd2f0
Reviewed-on: https://chromium-review.googlesource.com/750593
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Charge port / current selection often needs to be significantly altered
when a battery cannot provide sufficient charge, so have charge_manager
initially enter safe mode. After a battery with sufficient capacity has
been identified, charge manager will leave safe mode, and port / current
selection will return to standard rules.
BUG=chromium:777596
BRANCH=None
TEST=Pass charge_manager unit tests. On kevin, remove battery, attach
Apple PD charger, verify safe mode is not exited and device does not
brown out. Hot-plug battery and verify safe mode is exited. Next,
remove battery, attach to Samus, verify safe mode is not exited and
device doesn't brown out. Hot-plug battery, verify that safe mode is
exited and no active charge port, due to dual-role exclusion.
Change-Id: I7784865750087a037aad8dbbac058b22c77ba6d4
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/733954
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
src_pdo_charge[] size may exceed 2, but remove it instead.
BUG=None
TEST=On servo_v4, verify DTS always works.
BRANCH=servo
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I2a4e75a5939cab82d508408b961361bde9f207ea
Reviewed-on: https://chromium-review.googlesource.com/748272
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure GPIOs are inputs when read: Initialize GPIO direction on startup,
and clean up register accesses using reg names rather than magic numbers.
Add board version reporting with CONFIG_BOARD_SPECIFIC_VERSION.
BUG=None
BRANCH=servo
TEST=version is correctly 3
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Change-Id: Ia04b01932fc36540af64b48b5e0bb6516f1529e2
Reviewed-on: https://chromium-review.googlesource.com/749693
Reviewed-by: Shawn N <shawnn@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Select optimal PDOs from the charger at various discrete voltage limits
and advertise them all to the DUT, in case the DUT does not support the
"best" > 5V PDO due to voltage limits.
BUG=chromium:776809
BRANCH=servo
TEST=On {samus, scarlet, kevin}, with zinger attached to DUT port,
verify DUT + CHG negotiate to max supported voltage. On 'black' servo_v4
board, verify scarlet negotiates to 12V.
Change-Id: Iea174e4f6bc303d561e28281b9ff20afb3073c25
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/730877
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous method of negotiating > 5V on CHG port followed by
asynchronously negotiating > 5V on DUT port (and then switching DUT VBUS
source from internal 5V to DUT) will often not function correctly due to
VBUS glitching on the switchover. Instead, immediately switch VBUS
source to CHG when detected, and negotiate > 5V on CHG only after DUT
has requested a transition.
BUG=chromium:775542
BRANCH=servo
TEST=Attach {kevin, scarlet} to servo_v4, attach Apple charger to
servo_v4, verify DUTs charge at 9V and consoles are reachable on
scarlet.
Change-Id: I1e53f1e74e5ab1cd32a252243c23faaa8fce107b
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/724683
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the USB-C spec, when a debug accessory is identified, we may
optionally establish USB PD communication over CC. Some DTS partners
(eg. servo_v4) expect us to speak PD, so let's make it so. There is no
need for special ACCESSORY states, these do not exist in the PD spec.
BRANCH=servo
BUG=chromium:737755,b:65837068
TEST=On scarlet, attach servo_v4 and verify scarlet charges. Also verify
EC and cr50 consoles are available through servo_v4.
Change-Id: I59d1ca50b4766509eccf38562cdf926578138585
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/693294
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new DRP policy to "freeze" the power role of each port, never
toggling automatically, though manual role swaps may still occur.
BUG=chromium:769895
BRANCH=servo
TEST=On servo_v4, verify DUT port stays in SRC role and POWER port
stays in SNK role while disconnected.
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ibff3cd1ffaf0e884b030c231003763a57acbe02e
Reviewed-on: https://chromium-review.googlesource.com/715276
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chromium:769895
BRANCH=servo
TEST=On servo_v4, attach OEM Apple charger to power port and verify
negotiation to 9V and port / ILIM selection from charge_manager. Attach
samus to DUT port and verify 9V charging.
Change-Id: Icf16f6e8c99af4fbb48a83b7a36f550c20f5fd69
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/713944
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows setting TXINV/RXINV bits.
BRANCH=none
BUG=b:65697962
TEST=make BOARD=wand -j
Change-Id: Ib1bb290cd9758c53b98c8fc1ca1a9369c8cff39e
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/694561
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add CONFIG_CMD_PD into servo v4, to enable more
console PD commands,
BRANCH=None
BUG=b:65497998
TEST=run the sommands.
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Change-Id: I85c3f585779ccd51cff48c564083fd42fe5c454b
Reviewed-on: https://chromium-review.googlesource.com/663840
Reviewed-by: Scott Collyer <scollyer@chromium.org>
|