summaryrefslogtreecommitdiff
path: root/board/servo_v4p1
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-0525-5249/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* TCPM: Rename enum tcpm_sop_type and its constantsAbe Levkoy2021-08-312-4/+4
| | | | | | | | | | | | | | | As a followup to CL:3104290, give the TCPCI TRANSMIT and RX_BUF_FRAME_TYPE types more consistent names. Most of them can be used for receiving, not just transmitting. Fix lint errors thus revealed. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I399ec479eacc18622fc4d3f55f8bdabf4560fcff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3125995 Reviewed-by: Keith Short <keithshort@chromium.org>
* adc: Remove adc_chip.h where adc.h is usedCaveh Jalali2021-08-271-1/+0
| | | | | | | | | | | | | | This removes the use of adc_chip.h where adc.h is also used. In this case, adc_chip.h is redundant. BRANCH=none BUG=b:181271666 TEST=buildall passes Change-Id: Id7baf9aef949447a4d47934242f9bae97c971262 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120317 Reviewed-by: Keith Short <keithshort@chromium.org>
* servo_v4p1: Manage USB2/USB3 terminations based on data roleJan Dabros2021-08-252-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously servo_v4p1 was running with USB2 and USB3 paths always on. This was completely ignoring data role of servo. Especially, we shouldn't apply device terminations on USB2/USB3 lines once servo is acting as DFP. While in this mode the only allowed configuration is to establish FASTBOOT, that is direct connection between DUT and HOST. Make use of the CONFIG_USBC_SS_MUX_UFP_ONLY, since USB3 muxer on servo should be enabled only when servo is UFP. BUG=b:137887386,b:182419010 BRANCH=main TEST=Perform "cc snkdts" and "cc srcdts" sequence couple of time and verify presence of all expected USB2 & USB3 devices on the DUT side. TEST=Another test may be to unplug and re-plug CHG connector to servo and verify presence of all expected USB2 & USB3 devices on the DUT. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I54a637b67cf62f20658c8c4522a8d8ccc011d863 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094249 Tested-by: Lukasz Hajec <lha@semihalf.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* servo_v4p1: Initial support for FASTBOOT handlingJan Dabros2021-08-252-0/+15
| | | | | | | | | | | | | | | | | | | | | Hardware support for FASTBOOT is in place, however servo_v4p1 is currently not exposing an API for servod. Along with improvement for correct DATA_ROLE handling on servo_v4p1 (in consecutive patch), add a knob for enabling FASTBOOT. It is necessary to add complete sequence when enabling FASTBOOT - that is changing servo DATA_ROLE to DFP. This work will be done in the future. BUG=b:137887386 BRANCH=main TEST=Conduct test from consecutive patch Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I6cb53ebc9b412002db750b58d04170060478ebd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094248 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* servo_v4p1: Fix routines for uservo & fastboot muxersJan Dabros2021-08-251-1/+1
| | | | | | | | | | | | | | | | | | | * uservo_to_host() function shouldn't touch FASTBOOT_DUTHUB muxer * dut_to_host() should fully configure fastboot path These functions were previously unused, however in consecutive patch new management for uservo and fastboot functionalities is added. BUG=b:137887386 BRANCH=main TEST=Conduct test from consecutive patch Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ic915caee53c9397b8b0716fbf72d86320aae5e49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094247 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* TCPM: Rename enum tcpm_transmit_typeAbe Levkoy2021-08-181-1/+1
| | | | | | | | | | | | | | | Rename tcpm_transmit_type to tcpm_sop_type to reflect that it can be used for Rx as well. Describe it in comments. This prepares to consolidate enum pd_msg_type into this enum. BUG=b:155476419 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ife97d4ad51c48f2e832b94e007954919e236a309 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3104290 Reviewed-by: Keith Short <keithshort@chromium.org>
* system: Clean up system_get_board_version()Philip Chen2021-07-091-2/+0
| | | | | | | | | | | | | | | | | | | Refactor system_get_board_version() a bit so that we can remove CONFIG_BOARD_VERSION_CUSTOM and CONFIG_BOARD_VERSION from config.h. BRANCH=None BUG=b:186264627 TEST=make buildall -j TEST=zmake testall Cq-Depend: chromium:3015243 Change-Id: Id5ab809493c297b7d330ea13dcd6934ec00042a6 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3004112 Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* servo_v4(p1): Implement empty usb interface descriptorJan Dabros2021-04-231-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | After removal of gpio_over_usb, firmware for servo_v4 was implementing only 5 interfaces, even tough configuration descriptor claimed 6. This leads to kernel warning during enumeration and more importantly some UEFI implementations on high-end devices refused to boot. Eventually we would like to remove EMPTY identifier and re-define all consecutive interface numbers, however this bring implications to the hdctools, which are using hardcoded values during normal operation. BUG=b:183857501 BRANCH=main TEST=Connect servo_v4 & servo_v4p1 to server machines (e.g HP,DELL) in the lab and reboot the server. It should boot without issues TEST=Plug servo_v4/v4p1 into host computer and verify dmesg. No warnings should be visible in the output. For error case one may have seen: `config 1 has 5 interfaces, different from the descriptor's value: 6 config 1 has no interface number 1` Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ibc114aaeae7572845d3c6160cb897a9856e2f276 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2846330 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* ec: Filter non-FIXED PDOs in servo_v4{p1}Jeremy Bettis2021-04-132-2/+3
| | | | | | | | | | | | | | | | | | | | | | Add a new config CONFIG_USB_PD_ONLY_FIXED_PDOS. If that config is enabled, ignore non-FIXED PDOs in both the console command `ada_srccaps` and also when selecting the preferred PDO for a voltage. Enable CONFIG_USB_PD_ONLY_FIXED_PDOS for servo_v4 and servo_v4p1, since they don't expose non-fixed PDO in their srccaps. Without this change, there is a risk that the "best" PDO for a given voltage will be non-FIXED and then that voltage just won't be supported at all. BRANCH=none BUG=b:178484932 TEST=added Change-Id: I0d1187ca372120c7fe21d627e1b82b59f6334add Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809353 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* usb_common: support parse Augmented PDOEric Yilun Lin2021-04-081-6/+7
| | | | | | | | | | | | | | | | | | Change the function signature to void pd_extract_pdo_power(uint32_t pdo, uint32_t *ma, uint32_t *max_mv, uint32_t *min_mv); Replace the original caller with an extra unused parameter, no functional changes. BUG=none TEST=`pd 0 srccaps` prints the correct PDO info BRANCH=asurada Change-Id: I9b508e1a13737fe3ed61e6086416cff0c8ffb9a9 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810660 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* TCPMv1: clear SourceCap in disconnected stateEric Yilun Lin2021-04-081-8/+0
| | | | | | | | | | | | | Clear the SourceCaps to prevent misleading info. BUG=none TEST=`pd 0 srccaps` no output if adapter unplugged BRANCH=asurada Change-Id: Ibfefb3cc2e91c548fdf6579603dd5be20d68c08e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810659 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* tusb1064: Add full list of possible I2C device addressesScott Collyer2021-03-241-1/+1
| | | | | | | | | | | | | | | | | | The TUSB1064 has 16 possible I2C device addresses. This CL adds this full list to the tusb1064.h file. In addition, the TUSB1064 device address was updated to match the new macro. BUG=b:168621142 BRANCH=servo TEST=make -j buildall Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I1ee836ef0a88adab1af63901c2ec0be7cef7b232 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2267630 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Sam Hurst <shurst@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4p1: Improve handling of DACs' faultsMichał Barnaś2021-03-111-18/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix handling CC2 line fault. CC2 line was not checked, instead, CC1 was used in both checks. Change message that appear on servo's console after detecting DACs' faults. Now, after detecting fault on CC lines, corresponding DAC will be disabled and fault will be cleared. BUG=b:168730704 BRANCH=main TEST=On servo's console execute commands as follows. For CC1: > i2cxfer w16 1 0x48 0x8 0x0080 > i2cxfer w 1 0x23 4 0x12 Short DUT_CC1 pin to ground. Message about CC1 DAC fault should appear on console. For CC2: > i2cxfer w16 1 0x49 0x8 0x0080 > i2cxfer w 1 0x23 4 0x22 Short DUT_CC2 pin to ground. Message about CC2 DAC fault should appear on console. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: I32b727790dcc54355a5211a667c091287aa04b3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2732017 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4,servo_v4p1: filter Augmented PDO for pass-throughEric Yilun Lin2021-03-111-0/+5
| | | | | | | | | | | | | This is currently unsupported since servo-v4 uses PD2.0 (TCPMv1) stack. BUG=b:182219864 TEST=Ensure APDOs don't show in ada_srccaps cmd BRANCH=servo Change-Id: I4d10ac6a44d649281c5ae2fff665cc1fd0c590c9 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748194 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Servo_v4/v4p1: Only read CC if a pull is appliedEric Herrmann2021-03-101-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | CC readings aren't valid if we aren't applying a pull to CC. This causes some issues on platforms which use voltage clamp Rd implementations. There is currently the intention to fake CC readings if we aren't applying a pull, but it uses the CC_DETACH flag which doesn't directly mirror the CC status, and we could be applying no CC pull even if CC_DETACH isn't set. Check more directly if we're applying CC pulls when getting the CC status. BUG=b:182173370 TEST=firmware_PDTrySrc on Voxel with servoV4 TEST=check that fakedisconnect as src and snk works on servoV4p1 BRANCH=None Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: Ie67c5c7a05add81aca1336caa7951d31f88c35fc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2745222 Reviewed-by: Nathan Kolluru <nkolluru@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* servo_v4p1: Disable USB power in case of faultJan Dabros2021-02-261-3/+9
| | | | | | | | | | | | | | | | | | | | | Previously, the only action in case of overcurrent event on USB ports was to log the information to the user. Actually more important thing is to disable USB power signal, even though load switch should disable VBUS. Additional positive side-effect is that servod controls like 'image_usbkey_pwr' will be in sync with actual state of VBUS signal. BUG=none BRANCH=main TEST=Generate overcurrent event on A0 USB3 port. Verify that A0 pwr signal is off by issuing: `dut-control image_usbkey_pwr` Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I083f68e0a6f02d7de087b125790225fbffc941e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2718869 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* servo_v4p1: Fix wrong ifdef in cc_dac commandMichał Barnaś2021-02-261-1/+1
| | | | | | | | | | | | | | | | | | Adding io_expander support for servo_v4p1 required moving cc_dac command to RO section only. There was a typo in ifdef which resulted in cc_dac command being unavailable. BUG=b:168385201 BRANCH=main TEST=Build firmware and flash it to servo_v4p1. On servo's console, execute command: help There should be cc_dac command listed Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: Icf211950bd18e4d33173b4cd679df58217069f39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2721722 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* servo_v4p1: Enable 5A and 20V chargingBrian J. Nemec2021-02-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables 5A and 20V charging on all Servo_v4p1's. There is a small population of servo_v4p1 devices with 3A cables but these represent about 100 total units between the early builds. The setting was not set as a board id configuration as stress tests show this process will still be safe and the Servo_v4p1's that are current limited are easy to keep within the 3A current limits. The 5A cables are visually distinctive and most chargers and DUTs are limited to 3A. BUG=b:176110980 BRANCH=servo TEST=Validated the Servo_v4p1 can deliver power at 4.5A and 20V using a 90W charger and a resistive load. Verified current using meters and verified Servo_v4p1 does not heat excessively significantly after over 2 hours at the cable or PCB. TEST=Repeated the same test on older Servo_v4p1 devices with the smaller shunt resistors and 3A compliant cable and verified components remain at reasonable temperatures. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: If9e67081fe4441ca0fe1039c3189e0673eb8f13a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2714031 Reviewed-by: Jan Dąbroś <jsd@semihalf.com> Reviewed-by: Matthew Blecker <matthewb@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* COIL: Rename ioexpander i2c address variableDiana Z2021-02-241-2/+2
| | | | | | | | | | | | | | Rename ioexpander i2c address to match current conventions and update any calling locations. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iddad457f73d0dd0167496b794c00e274f8985615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697855 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* servo_v4p1: improve I/O expander implementationMichał Barnaś2021-02-2311-413/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove servo_v4p1 custom ioex implementations for TCA64xxA modules. Enable I/O expander module and move from custom interface to generic one. Due to the lack of flash in RW section, IOEX is not available there and required 'board_id_det' function is stubbed using raw i2c functions. This results in IOEX and DAC functions available only in RO section, so their initialization functions are moved to RO-only init. BUG=b:168385201 BRANCH=main TEST=Connect to servo's console and execute 'ioexget' command. All IOEX pins' states should be printed in terminal. Pin TCA_GPIO_DBG_LED_K_ODL should change as LED is blinking. TEST=Connect to servo's console. Plug USB-C charger to servo power port. 'ioexget' command should display EN_PP5000_ALT_3P3 value as 1. Execute 'ioexset EN_PP5000_ALT_3P3 0' command. Unplug fast the servo charger. Servo should be fully operational without any sign of reboot. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: Iff98b37746a95d6a59954507ab18defac65d6329 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2700297 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4p1: Manage USB PWR and FAULT from ECJan Dabros2021-02-194-73/+8
| | | | | | | | | | | | | | | | Due to issues with GL3590 firmware it was decided to get back to EC managing USB POWER and FAULT signals via ioexpanders. BUG:b:169929627 BRANCH:main TEST:build firmware and flash servo_v4p1. Verify operation of all USB ports. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ia39462aa99502b8869735798c64164ac05403098 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2704546 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4p1: Remove unnecessary tasks in RW sectionMichał Barnaś2021-02-182-27/+5
| | | | | | | | | | | | | | | | | | | USB PD tasks had empty stubs in RW section. Instead of creating empty tasks in RW section, they are enabled only in RO section using ALWAYS_RO macro in ec.tasklist. BRANCH=main BUG=b:177412115 TEST=Execute 'make BOARD=servo_v4p1' It should create firmware without errors. Try flashing built firmware twice (with --force flag) to see that servo communication is working fine with updated RW section. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: Ib511690d609c84960720aa40b5d08b1f7f1360c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2700294 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4p1: Fix BC1.2 detection pin assignment for REV2Jan Dabros2021-02-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | REV1 of servo_v4p1 uses HOST_CHRG_DET as a GPIO which informs about detecting extended-charge connection available (CDP or DCP). On REV2 BC1.2 detection chip was replaced with another part (PI3USB9201) and this pin is asserted when detection is completed. STM needs to query I2C interface of BC1.2 chip in order to get detailed info about available power. HOST_CHRG_DET on REV2 should be used as a trigger for reading PI3USB9201 detection results. This will be implemented in future. BUG=b:144776402 BRANCH=main TEST=build and flash servo_v4p1. After reboot, connect to console and verify that there is no "BC1.2 charger unplugged" message visible in the log. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I421a82d5496b6e5280f5023878c610d04fae9283 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697071 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Revert "servo_v4p1: Add driver for power management"Jan Dabros2021-02-178-154/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4f8c2db072fb4a8a99ccdc9fa557f122582f8173. servo_v4p1 uses charge_manager, however currently this is done improperly. Instead of HOST and ALT ports, CHG and DUT ports are registered withing framework, even though they are not used for charging servo platform itself. In order to implement power management, the most convenient (and clean) solution is to use charge_manager API. The plan is to make use of it, however first we need to address charge_manager problem mentioned above. This way we will avoid code duplication and custom drivers which duplicate existing generic implementation. For the time being, revert custom power management. After fix for charge_manager on servo_v4p1 is applied, will get back to this issue and re-apply power management features in new form. BUG=b:144776402 BRANCH=main TEST=build and flash servo_v4p1. After it boots, issue `ina 2` command. By default the Alert limit should be equal to 0, which means that now power restrictions are applied. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I8aea351331dd380fc13c5c6c43ea7dc3a29bd918 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697070 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* board/servo_v4: Allow changing Atmega baud rateJes Klinke2021-02-101-2/+3
| | | | | | | | | | | | | | Instantiate code for handling USB control requests to set baudrate on UART4 used for communication with the Atmega MCU. BRANCH=none BUG=b:178487213 TEST=Flashed onto servo, and verified ability to receive at 333.3 kBaud. Signed-off-by: Jes Bodi Klinke <jbk@chromium.org> Change-Id: Iee7a8bb4bbb194af301f28841050b2551d7e0621 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2649159 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* servo_v4p1: fix DisplayPort muxingVincent Palatin2021-02-091-12/+11
| | | | | | | | | | | | | | | | | | | | | | Now we are using a 'standard' usb_mux driver for the TUSB1064 superspeed mux, ensure the mux configuration we are sending is matching our convention. The previous custom driver had different parameters. Also remove the direct calls to the driver. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=b:150614702 BRANCH=servo TEST=put the servo in SRC mode with the DP enabled on 4 lanes by using the commands: 'cc src' then 'usbc dp enabled', 'usbc dp mf 0' then plug a screen on the servo v4.1 HDMI receptable and get a proper image when connecting the USB-C plug to a Chromebook with both polarities Change-Id: I433c0055ce9b77d82075c09eec5a7eecd36006b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2684413 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* servo_v4p1: Allow host hub to manage USB PWREN signalsJan Dabros2021-02-095-17/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | Starting from REV2 of servo_v4p1, host hub is capable of managing power enable signals for USB ports. This hub with its I2C interface is used as a kind of ioexpander. Configure routing of signals so that hub is now managing ports power instead of the EC. By allowing the hub to steer PWREN signals, it is now possible to handle FAULT signals directly there without extra EC interactions. During init move the code for enabling power to ports at the time when we are sure GL3590 I2C interface is up and running. BUG=b:169929627 BRANCH=main TEST=Verify that servo_v4p1 has all USB ports working after reset. In general behavior of hub ports in normal conditions should be the same as previously. With usage of gl3590 tool, verify that one can enable/disable power to all 3 available USB ports (two stacked and uServo). Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I1fc1c6f8718a46984eb486919dfbe463363a2587 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2624472 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4p1: Defer all transactions to host hub i2cJan Dabros2021-02-091-9/+27
| | | | | | | | | | | | | | | We shouldn't issue any I2C transactions to the gl3590 host hub until INTR# signal is deasserted. BUG=b:178125550 BRANCH=main TEST=Verify host hub functionality on servo_v4p1 board. All USB ports should be usable. Check console logs for any possible error messages. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ia49510ca080f38931fd6c809103997e3748e9988 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674003 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* COIL: Rename fusb302 driver variablesDiana Z2021-01-272-7/+7
| | | | | | | | | | | | | Rename i2c variables in the fusb302 driver and c-file references. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ifaf7984c52fc197403d447e00c02af036e54987e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2649354 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* servo_v4p1: clean-up and USB-C timingsVincent Palatin2021-01-207-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | Small clean-ups inherited from Nathan, the sooner they are pushed the better. - Fix typos/terminology. - Use symbolic port names. - update timings from power supplies to be more tolerant when using an upstream host charger. - disable the discharge on the power path at startup as a safety measure. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=none BRANCH=servo TEST=none Change-Id: If3ca4498b23763ce43371ce9cfe80391b0c1a4b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2640656 Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4p1: improve board ID supportVincent Palatin2021-01-202-5/+18
| | | | | | | | | | | | | | | | | | - cache the value - declare constants for the known values Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=b:168621142 BRANCH=servo TEST=none Change-Id: I03c02ef04a1d6c2344bda08ec4e225ec159473ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2621305 Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jan Dąbroś <jsd@semihalf.com>
* servo_v4p1: use usb_mux implementation for the TUSB1064 driverNathan K2021-01-206-118/+23
| | | | | | | | | | | | | | | | | | | Re-configure the board code to use the full usb_mux implementation for the TUSB1064 driver. And delete the corresponding board code. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=b:168621142 BRANCH=servo TEST=use the sink mode enabled by 'cc pdsnk', connect to a USB-C Chromebook try both video output on USB-C->mini-DP and USB 3.0. Change-Id: Ic331a82f1606ef58fe06607475b4554bf256aa6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2633985 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
* Refactor CONFIG_FLASH_SIZE to CONFIG_FLASH_SIZE_BYTESYuval Peress2021-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | In Zephyr CONFIG_FLASH_SIZE is a Kconfig value that is used throughout. The issue is that the units don't match. In Zephyr the value is in KiB instead of bytes. This refactor simply renames CONFIG_FLASH_SIZE in platform/ec to include the unit (via _BYTES). BRANCH=none BUG=b:174873770 TEST=make buildall be generated by the build instead of per board Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I44bf3c7a20fcf62aaa9ae15715be78db4210f384 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627638 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* servo_v4p1: Add driver for power managementJan Dabros2021-01-148-0/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the power source and loads, the servo_v4p1 may have insufficient wattage available. New driver gathers information about available inputs, monitors power consumed and sets alert when a threshold is crossed. For servo_v4p1 there are two main power sources - host USBC port and servo charger port. Host connection operates on 5V and may allow up to 500mA(USB2.0), 900mA(USB3.0), 1500mA(BC1.2 or USB-C) or 3000mA(USB-C). Servo charger port currently offers only standard USB-C wattage - 1500mA/5V or 3000mA/5V. There is a possibility that in future PD will be enabled on this port, thus enabling higher wattages. Algorithm queries host connection capabilities (including BC1.2) and servo charger port connection settings, with charger port being always a primary selection. INAXX chip is used to monitor level of consumed power and notification is send to the user, when threshold is reached. In future servod should be used as a channel for alerts notification. BUG=b:144776402 BRANCH=master TEST=Test various connections for input power to servo_v4p1 - USB2.0 host/cable, USB3.0, BC1.2 enabled/disabled, servo charger with different Rp/Rd settings, also hot plugging servo charger. Provide different loads to servo - pendrives, DUT connection and DisplayPort. Monitor power used by servo and loads (either by external power meter or compile-in INA_CMD). When threshold is reached, one should see "System full power threshold exceeded" on the servo console. Default threshold is set to 90% of power. For example on USB2.0 connection (500mA at max) and assuming 5V is provided to VCC rail, warning should appear when drawing 500mA * 9/10 = 450m. Keep in mind though that actual alert is configured on power over limit mode (not current), thus there may be some differences when there is no ideal 5V on a tested connection. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I1099192fa7475b51922e9dcb272f812d1547f311 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592495 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* tcpm: Move tcpm.h into an include directorySimon Glass2020-12-221-1/+1
| | | | | | | | | | | | | | | | | | This header file is used from quite a few files, relying on the EC build system to find includes in the driver/tcpm directory. For Zephyr we don't want to add that as an include. It makes more sense for header files to be in an include directory, so move it and fix up the users. BUG=b:175434113 BRANCH=none TEST=build Zephyr and ECOS on volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I5851914b1a7d3fdc1ba911c0fbe9046afbaf6f5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597985 Reviewed-by: Keith Short <keithshort@chromium.org>
* servo_v4p1: Fix GPIO assignments in ioexpandersJan Dabros2020-12-175-29/+66
| | | | | | | | | | | | | | | | Fix improper GPIO connections and add new ones in ioexpanders to match EVT hardware layout. Old assignments were implemented for PVT design. BUG:b:144776402,b:168385201 BRANCH:master TEST:make -b servo_v4p1. Verify that usb redriver TUSB1064 is working (DP connection). Verify that DUT charger is working correctly. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I8229690440a70fd78c5b5671368212d4eb325d51 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2582666 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_v4p1: Add support for host hub I2C interfaceJan Dabros2020-12-072-1/+14
| | | | | | | | | | | | | | | BUG:b:150323106,b:169929627 BRANCH:master TEST:make -b servo_v4p1. Verify that we are receiving descriptive message for all GL3590 events. E.g. try to access invalid port: i2cxfer raw 1 0x50 0 0xd0 For the full list of events refer to GL3590 I2C Application Note. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ia34f1deb508bbbaad94d2eb1a279d200958db92e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2563687 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_v4p1/usb_pd_policy: Reject SNK->SRC power swap if CC_ALLOW_SRC not setPatryk Duda2020-12-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply changes in CL:2566813 to ServoV4P1 too. Original message below. When ServoV4 acts as sink ('cc snk' issued), and we issue 'cc pdsnk' there are following state transitions (starting from C1 SNK_READY): C1 st8 SNK_READY <--- From this point DUT acts as source DUT's PE is in PE_SRC_Ready state C1 RECV 196f/1 [0]ff008001 C1 RECV 0b67/0 <--- DUT asks for source capabilities C1 srcCAP>1 <--- ServoV4 sends its capabilities C1 RECV 0d6a/0 <--- DUT requests power swap C1 CTRL[3]>1 <--- ServoV4 accepts C1 st10 SNK_SWAP_SNK_DISABLE C1 st11 SNK_SWAP_SRC_DISABLE C1 RECV 0e66/0 <--- DUT sends PS_RDY to inform that it disabled power C1 st12 SNK_SWAP_STANDBY <--- ServoV4 enables power supply and waits PD_POWER_SUPPLY_TURN_ON_DELAY to ensure that it is turned on, before switching to SNK_SWAP_COMPLETE C1 st13 SNK_SWAP_COMPLETE <--- Power swap completed successfully C1 CTRL[6]>1 <--- ServoV4 sends PS_RDY to inform that power was enabled. C1 st18 SRC_DISCOVERY C1 srcCAP>1 <--- ServoV4 sends its capabilities C1 st19 SRC_NEGOCIATE C1 RECV 1062/1 [0]4304b12c Requested 15000 mV 3000 mA (for 3000/3000 mA) C1 CTRL[3]>1 <--- ServoV4 accepts C1 st20 SRC_ACCEPTED C1 st21 SRC_POWERED <--- Switching to requested voltage. This calls pd_transition_voltage() from servo_v4/usb_pd_policy which requests charger to change its voltage. [570.815776 Waiting for CHG port transition] <--- Here we are changing active task to PD_C0. This task changes dual role for C1 (DUT port), because CC_ALLOW_SRC is not set. Appropriate event is set too C0 Req [4] 15000mV 3000mA C0 REQ>1 C0 st6 SNK_REQUESTED [570.822679 CL: p0 s0 i500 v5000] C0 RECV 0763/0 C0 st7 SNK_TRANSITION C0 RECV 0966/0 C0 st8 SNK_READY <--- Charger voltage changed successfully [570.991969 CL: p0 s0 i3000 v15000] <--- Context switch to PD_C1 task [571.001981 CHG transitioned] <--- Check event and call update_dual_role_config() which changes state to SNK_DISCONNECTED C1 st2 SNK_DISCONNECTED Port 1 switches to SNK_DISCONNECTED state because PD_C0 task calls pd_send_request_msg() (reaction for voltage change request), which limits maximum current by calling charge_manager_force_ceil(). Charge manager calls board_set_charge_limit() to limit current, which calls update_ports() which calls board_manage_dut_port() unconditionally. This function checks if charge through is allowed. It turns out that it is not allowed, because CC_ALLOW_SRC bit is not set in cc_config (see is_charge_through_allowed()), then board_manage_dut_port() changes dual role of port 1 to force sink. Fix for this issue is simple. Function is_charge_through_allowed() actually tells us that we are not able to source power when 'cc snk' or 'cc pdsnk' was issued. So fix is just to reject power swap when our power role is sink, and CC_ALLOW_SRC is not set. BUG=b:162254118 BRANCH=none TEST=Issue 'cc snk' from ServoV4 console and wait until state gets stable. Issue 'cc pdsnk' from ServoV4 console and check if port 1 reaches SNK_READY state. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Iadf41bbb82d300bc05c1528a403267225a6907d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2566991 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* i2c_master: Add i2cxfer raw commandJan Dabros2020-11-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GL3590 USB3.1 hub has i2c interface, which behaves different from majority of i2c slaves. While write operation is the same, this chip doesn't support repeated-start sequence for reads. New command allows to create i2c frames in a more flexible way. User may specify how many (if any) bytes to write and then how many bytes to read. Since the raw option is for debugging and won't be commonly used, do not include it by default to save space on flash - use #define CONFIG_CMD_I2C_XFER_RAW built with the raw option. For now, it will be defined only for servo_v4p1. BUG=b:150323106 BRANCH=master TEST=buildall. Verify that reading i2c data from non-gl3590 devices is not affected by this change. For usual write16 (0x0201) at offset 0x4 from device 0x24: i2cxfer raw 1 0x24 0 0x4 0x1 0x2. When reading from GL3590 device, two operations will be required: i2cxfer raw 1 0x50 0 0x10 i2cxfer raw 1 0x50 8 Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ifd9ee5184490eb8de383c9468b0152e6f993d7c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2505780 Reviewed-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org>
* servo_v4p1: Exclude i2cxfer command from RWJan Dabros2020-11-121-0/+1
| | | | | | | | | | | | In order to save space on RW section, I2C transactions, which are unnecessary for firmware update process, are removed from build of RW. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ia80d5f3799743aaa65a01223f1864706a10d3c68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2528649 Reviewed-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* COIL: Rename CONFIG_I2C_CONTROLLERDiana Z2020-11-051-1/+1
| | | | | | | | | | | | | Rename CONFIG_I2C_CONTROLLER and related comments. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ied6a1829bf54a5c9a32e6772982a4b8aa31aaf23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518659 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* servo_v4p1: Disable UART DMA to save flash space.Matthew Blecker2020-10-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | This also explicitly enables console on USART1 (PA9 + PA10), instead of relying on chip/stm32/config_chip.h default. Disabling DMA saves flash space. Before: *** 28588 bytes in flash and 1036 bytes in RAM still available on servo_v4p1 RO **** *** 256 bytes in flash and 4200 bytes in RAM still available on servo_v4p1 RW **** After: *** 28652 bytes in flash and 1036 bytes in RAM still available on servo_v4p1 RO **** *** 280 bytes in flash and 4200 bytes in RAM still available on servo_v4p1 RW **** BRANCH=none BUG=b:144116746 TEST=servo_v4p1 RS232 console port continues to work (using 115200 baud 8N1) Change-Id: I66b3dd6a9137fc2b179e1e87d3315d4acd7e9ea6 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2488935 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_v4,servo_v4p1: control acceptance of power and data swapEric Yilun Lin2020-10-141-3/+28
| | | | | | | | | | | | | | enable this command for more FAFT test coverage BUG=b:139065787 TEST=on servo_v4, test that usbc_action prswap|drswap works as expected BRANCH=servo Change-Id: I1b88d5c0ed00997e78d129633faf435e3cee61ac Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2467599 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Revert "ServoV4/V4p1: Change CCD detection flow"Brian Nemec2020-09-282-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1a09ade7b846cc048fb2f177adcacd5f836b8887. Reason for revert: b:167734179 CCD detection is failing on many devices. Tests on reverted devices show this is primary cause. Original change's description: > ServoV4/V4p1: Change CCD detection flow > > Currently, servoV4 and servoV4p1 don't apply terminations to SBU when > searching for a DUT. This means SBU can float which can break the SBU > voltage detection. Technically, the DUT should only need to pull up D+ > and can float D- since it is a FS USB2 device when in CCD mode. > > Change the detection to connect SBU to the USB2 hub on servoV4/4p1. The > USB2 hub will apply 15k pulldowns to the USB lines, which will pull SBU > down and fix detection in the case where the DUT floats SBU. > > BUG=b:161762948, b:150886157, b:151487379 > TEST=make BOARD=servo_v4; make BOARD=servo_v4p1 > TEST=check that CCD works on DUT without pulldown resistors on SBU > BRANCH=none > > Change-Id: I9b6f620617fb0e270e35804704111afd3c606a3b > Signed-off-by: Eric Herrmann <eherrmann@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2352439 > Reviewed-by: Wai-Hong Tam <waihong@google.com> BUG=b:167734179, b:168546666, b:168548776 TEST=Measured SBU voltages with the prior CL included, observed low voltages and no-voltage on some platforms including variations of dedede under the flipped orientation. TEST=Reverted the CL and CCD detection worked reliably, devices with CCD not driving SBU rails started working, and labstation release was more reliable on prior versions. Change-Id: Iaecd7371164804ce09a7fd19ac8fd1f44d93aef2 Signed-off-by: Brian Nemec <bnemec@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2429496 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Eric Herrmann <eherrmann@chromium.org>
* ServoV4/V4p1: Change CCD detection flowEric Herrmann2020-08-262-27/+27
| | | | | | | | | | | | | | | | | | | | | Currently, servoV4 and servoV4p1 don't apply terminations to SBU when searching for a DUT. This means SBU can float which can break the SBU voltage detection. Technically, the DUT should only need to pull up D+ and can float D- since it is a FS USB2 device when in CCD mode. Change the detection to connect SBU to the USB2 hub on servoV4/4p1. The USB2 hub will apply 15k pulldowns to the USB lines, which will pull SBU down and fix detection in the case where the DUT floats SBU. BUG=b:161762948, b:150886157, b:151487379 TEST=make BOARD=servo_v4; make BOARD=servo_v4p1 TEST=check that CCD works on DUT without pulldown resistors on SBU BRANCH=none Change-Id: I9b6f620617fb0e270e35804704111afd3c606a3b Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2352439 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* servo: Increased stack sizes for servo_v4p1Brian J. Nemec2020-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Increased the stack sizes in servo_V4p1's power delivery tasks. The report from stack analysis: make BOARD=servo_v4p1 SECTION=RO analyzestack | grep Max Task: HOOKS, Max size: 336 (112 + 224), Allocated size: 768 Task: CONSOLE, Max size: 512 (288 + 224), Allocated size: 768 Task: PD_C0, Max size: 976 (752 + 224), Allocated size: 1056 Task: PD_C1, Max size: 976 (752 + 224), Allocated size: 1056 Task: PD_C2, Max size: 696 (472 + 224), Allocated size: 768 BUG=b:163546782 BRANCH=servo TEST=make -j BOARD=servo_v4p1 TESt=make BOARD=servo_v4p1 SECTION=RO analyzestack Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: Iccf7ebdf2a19afce9c02c43df6f72940c950d35e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2350300 Reviewed-by: Sam Hurst <shurst@google.com>
* servo_v4: optimize USB PD TX switchingVincent Palatin2020-08-111-55/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize the duration when switching the USB PD path to TX, in order to meet the PD spec tStartDive timing between when we start driving the line and the start of the preamble waveform. Try to decrease the number of operations on the GPIO registers which might be clocked slowly in order to achieve this, this includes abandoning the high level GPIO functions and writing directly the useful GPIO registers and knowing in advance between which modes we are switching. A few constant values in the GPIO registers for the TX path are now written in the pd_tx_init function. The current version uses the regular GPIO functions *but* it will glitch these GPIOs, we might want to switch to a lower level implementation and avoid the glitch. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=b:155202697 BRANCH=none TEST=make BOARD=servo_v4p1 TEST=probe TX_DATA on the scope and measure the duration before the preamble Change-Id: I84c8321ed9be045087e228a74f6e0ddb3f677d76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2346804 Reviewed-by: Nitin Kolluru <nkolluru@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Tested-by: Nitin Kolluru <nkolluru@google.com>
* tcpmc2: fix TD.PD.LL3.E2 Retransmission testJett Rink2020-08-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | We are retrying in both the TCPC hardware (4 total) and in the Protocol layer (3 total) when we do not get a GoodCRC back from the port partner. We are only suppose to retry up to nRetryCount times which is 2. This means we should be sending 3 total replies. Also correct a misinterpretation of the spec around SOP' and SOP" retries. We were not retrying those packets, but we should be retry them as the SOP. The SOP' device will not retry, but we (as the SOP) should retry packet that we are sending to them. The TCPM is not fast enough to meet the timing for tRetry (195 usec), so we need to perform the retries in the TCPC hardware layer. BRANCH=none BUG=b:150617035 TEST=Verify passing compliance test with GRL-C2 on Trembyle Change-Id: I55c4ab2f5ce8f64acf21af943862d96d9088622d Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2248960
* servo_v4p1: Add BC1.2 functionalitySam Hurst2020-07-304-0/+96
| | | | | | | | | | | | | This functionality is available in both RO and RW. BRANCH=none BUG=b:146793000 TEST=make -j buildall Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ia442010e7721553a7e155442e32f24ffbf5c4d70 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2216405 Reviewed-by: Brian Nemec <bnemec@chromium.org>