summaryrefslogtreecommitdiff
path: root/common/usbc/build.mk
Commit message (Collapse)AuthorAgeFilesLines
* TCPMv2: PD Timers - Base Timer frameworkDenis Brockus2021-03-011-0/+1
| | | | | | | | | | | | | | | | | Add in the basic framework. There are optimizations for using less timers but want to get the basics working before I invest more time in this. BUG=b:178029034 BRANCH=none TEST=make-runtests Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Icf93e3074b02cc3e0f7ee62e026b0d8ba10c7709 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2707804 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Fix build issue when usbc is in RW bu not RO imageScott Collyer2021-02-201-3/+3
| | | | | | | | | | | | | | | | | | This CL fixes build issues encountered when usbc is only required to be in RW, but not in the RO image. BUG=b:167462264 BRANCH=None TEST=verfied that can build on quiche when usbc support is only in RW and not in the RO image. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I0704f53a5e0d21a7aa0fcbe32a5ac3efc8eee060 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2293239 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org>
* TCPMv2: Add common hpd->dp_atten converterScott Collyer2021-02-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | This CL adds a new file for UFP_D ports. The inclusion of this file is controlled via a new config option CONFIG_USB_PD_ALT_MODE_UFP. Note that this is not intended to be used with TCPMv1 UFP_D legacy devices. The initial version of this file includes the hpd to usb pd DP_ATTENTION message converter. The implementation follows the spec in terms of both states and hpd event queueing rules. BUG=b:175660576 BRANCH=None TEST=Tested further down the CL stack. But verified that this CL fixes the issue where too many hpd_irq messages are sent with gingerbread which was causing a port part reset for chromebook ports. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I5c7f4a3d226eb7b33553c90f04c69c3d80bd8672 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2598028 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org>
* retimer: support retimer firmware updateli feng2021-02-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support AP to update firmware during boot up, one byte EC RAM is allocated for AP <-> EC communication. AP queries PD port/requests EC to perform operations via EC_CMD_ACPI_WRITE; and fetches result from EC via EC_CMD_ACPI_READ. The flow is: 1. AP queries EC PD ports which port supports retimer firmware update. 2. AP queries current MUX. 3. a) If no device attached, AP requests EC to suspend PD task of the port. Then AP requests EC to set MUX to USB mode, Safe mode, TBT mode. After entering TBT mode, the OS can either enumerate the retimers or do firmware update on the enumerated retimers. Once done, AP requests EC to disconnect MUX and resume PD task. 3. b) If device attached, AP moves on as usual. Retimer firmware update is not performed. BUG=b:162528867 BRANCH=none TEST=Tested NDA case on Voxel board, together with coreboot and kernel changes. Coreboot changes are merged. Kernel patches list is: https://chromium-review.googlesource.com/c/chromiumos/ third_party/kernel/+/2670719 After power up, host scans retimers, in sysfs localhost ~ # ls /sys/bus/thunderbolt/devices/ 0-0 0-0:1.1 0-0:3.1 domain0 On PD port 1, manually update retimer firmware. Copy firmware to nvm_non_active1/nvmem, then authenticate it. Host starts flow to update firmware. After it's done, PD port 1 resumes. Hotplug DP dongle/TBT device, devices should function fully. TEST=Tested DA cases on Voxel board, together with coreboot and kernel changes. USB4/TBT devices function as usual. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: Ie976e75f892d5caf48a948598a058a4f42e07eb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594492 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Add EC_CMD_TYPEC_DISCOVERYDiana Z2020-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This host command will return all discovery information for the given port and transmit type (SOP, SOP'). Each piece of information includes a count of the number of valid fields filled in to the arrays. To keep the command consolidated and easy to parse, this means there will be some number of bytes in each response which do not contain useful information. With this method, we may fit 7 SVID entries with mode information, which is less than the 16 which the EC can store, but more than most port partners present. BRANCH=None BUG=b:165264379 TEST=on waddledoo, confirm ectool shows: -no discovery information with nothing plugged in -no discovery information with a charger which doesn't reply to VDMs -SOP identity but no SVIDs with Moshi, which NAKs DiscoverSVIDs -SOP identity and all SVIDs with Apple 3-in-1 -SOP and SOP' identity and all SVIDs with TBT dock Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Idf21b23ebe4cda62781762188601b2cc35ede65d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2363417 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* TCPMv2: Add USB4 mode support for passive cableAyushee2020-07-171-0/+1
| | | | | | | | | | | | | | | | | | | To support USB4 mode on TCPMV2 this commit: 1. Checks if the port, port partner and cable is USB4 capable and if so enters into USB4 mode 2. Adds a new state PE_ENTER_USB to the PE state machine which sends the data message to enter into USB4 mode and on receiving an ACK from the port partner, sets the mux to USB4. BUG=b:156749387 BRANCH=None TEST=Tested on Volteer, able to enter into USB4 mode Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I3dac12a204a724037681037f98eaf797d4e02f20 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2277827 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Add Entry flow for Thunderbolt modeAyushee2020-06-301-0/+1
| | | | | | | | | | | | | | | | | | | | Create a separate module for representing Thunderbolt mode which decides whether and how we can enter into Thunderbolt alternate mode. Modify the Device Policy Manger (usb_pd_dpm.c) to first check if the port partner and cable is a Thunderbolt Compatible. If not, continue the rest of the PD flow undisturbed. BUG=b:148528713 BRANCH=none TEST=1. Attach Thunderbolt dock, DUT should enter Thunderbolt mode 2. Attach Type-C dock, DUT should enter DP mode 3. Attach DP dongle, DUT should enter DP mode Change-Id: I369eb6337144676996c9d94a412eec060eacd273 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2250488 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Separate DPM and DP from PEAbe Levkoy2020-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Create separate modules representing DisplayPort (which decides whether and how we can set up the DP alt mode) and the Device Policy Manager (which decides whether we should). The end goal is to have essentially all code with DP-specific decisions or information in the DP module and all code with DPM-specific decisions or information in the DPM module. This will allow the PE to map as directly as practical to its behaviors defined in the PD spec. Essentially detach PE_DO_PORT_DISCOVERY from the rest of the PE state machine in preparation for deleting it. This change paves the way for 1) Allowing the AP to drive mode entry and 2) Allowing new alt modes to be supported via largely self-contained modules. BUG=b:155890173 TEST=Attach DP dongle; observe discovery and DP setup via Twinkie BRANCH=none Change-Id: Ie63a2e62d1ac6178722477dc53244898a04ef92f Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2203842 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: Add pd console commandSam Hurst2020-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pd console commands that enables the device to work with PD FAFT. Other pd commands such as bist, vdm and ping will be added in another CL. BUG=b:151481791 BUG=chromium:1021235 BRANCH=none TEST=make -j buildall manual: Verified that system: pd tryscr 0 - did not trysrc pd tryscr 1 - did trysrc pd tryscr 2 - normal trysrc operation pd 0 tx - started as snk pd 0 charger - started as src pd 0 dev 5 - charged at 5V pd 0 dev 12 - charged at 12V pd 0 dev 15 - charged at 15V pd 0 dev 20 - charged at 20V pd 0 disable - pd was disabled pd 0 enable - pd was enabled pd 0 soft - sent soft reset pd 0 hard - sent hard reset pd 0 dualrole off - stayed in src and switched to snk on disconnect pd 0 dualrole on - toggled from snk to src and vice versa pd 0 dualrole sink - was a sink only pd 0 dualrole source - was a source only pd 0 dualrole freeze - stayed in current power role and switched to snk on disconnect pd 0 swap power - initiated a power role swap pd 0 swap vconn - initiated a vconn swap pd 0 swap data - initiated a data role swap Change-Id: Id1542001c0e52d1d5bfbc5b9cb826b9a204e5b2e Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1962506 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* config: update TCPMv2 config optionsJett Rink2020-03-271-9/+22
| | | | | | | | | | | | | | | | | | | Reorganize how the TCPMv2 options are used - Update documentation in config.h and bring TCPMv2 items close together - Make the layer defines consistent on how they include compilation units - Update tests to account for how files are included now - Remove unnecessary defines in board.h since they are default on BRANCH=none BUG=none TEST=builds Change-Id: I91fca51648912deef44db23492ecc7775b2e3062 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2120063 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* cleanup: drop the _TYPEC part of USB device configJett Rink2020-03-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The three USB device configurations describe more than just the Type-C layer, so remove the _TYPEC part within the define. This is also in preparation to change how the usbc build.mk includes files. This was performed with the following commands: $ git grep --name-only CONFIG_USB_TYPEC_DRP_ACC_TRYSRC | xargs perl -i -ple 's/CONFIG_USB_TYPEC_DRP_ACC_TRYSRC/CONFIG_USB_DRP_ACC_TRYSRC/g' $ git grep --name-only CONFIG_USB_TYPEC_CTVPD | xargs perl -i -ple 's/CONFIG_USB_TYPEC_CTVPD/CONFIG_USB_CTVPD/g' $ git grep --name-only CONFIG_USB_TYPEC_VPD | xargs perl -i -ple 's/CONFIG_USB_TYPEC_VPD/CONFIG_USB_VPD/g' BRANCH=none BUG=none TEST=builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I4deab784b7c3479cffd3dee7fb3ea3c8a9d6081c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2121193 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* TCPMV1/2: Make the PD Config Flags more consistentSam Hurst2020-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | The current use of the PD Config Flags are a bit confusing and has been changed to the following: The CONFIG_USB_POWER_DELIVERY flag is used to enable and disable the TCPMv1 and TCPMv2 stacks. And when CONFIG_USB_POWER_DELIVERY is enabled, one of the following must be enabled: CONFIG_USB_PD_TCPMV1 - legacy power delivery state machine CONFIG_USB_PD_TCPMV2 - current power delivery state machine BUG=b:149993808 BRANCH=none TEST=make -j buildall Change-Id: Ie3f8615a75b15b4f1c703f57f3db9e152a471238 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2068519 Reviewed-by: Diana Z <dzigterman@chromium.org>
* pd: Add PE FRS unit test for new stackDenis Brockus2019-10-161-0/+1
| | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall -j Change-Id: I55453ddf1d1da0fdee902a33e14357716fb12c4a Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859826 Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: USB Power Delivery State Machine based on Revision 3.0 of the spec.Sam Hurst2019-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds Power Delivery to the TypeC state machine as detailed in Revision 3.0, Version 1.2 of the specification. This CL passes the PD2.0 compliance tests and has been tested on several devices. Some areas such as handling Electronically Marked Cable information, creation of PIDs, and Host commands will be addressed in later CLs. BUG=b:130895206 BRANCH=none TEST=manual Port 0 on Hatch was used to run this CL, merged with PD functionality, on the PD2.0 Compliance tester. All tests pass except for a few physical layer tests. The test report has been added to the bug. Atlas was verified to work with Apple, Amazon, StarTech, MKDGO and several other generic docks. Atlas was verified to work with Google's and Apple's CTVPD. Signed-off-by: Sam Hurst <shurst@chromium.org> Change-Id: Ia5e1988b0d81ec4cf9a7175e273197bd5a0865e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1737899 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* type-c: USB Type-C State Machine based on Release 1.4 of the spec.Sam Hurst2019-07-301-0/+22
Implements DRP with Accessory, and Try.SRC as detailed in Release 1.4 of the USB Type-C specification. BUG=b:130895206 BRANCH=none TEST=manual Used Atlas device to verify that it could be charged from PD and none PD charges at 5V/3A. Attached USB dock and verifed access to USB Thumb drive. Performed same tests on Hatch Port 0 on Hatch was used to run this CL, merged with PD functionality, on the PD2.0 Compliance tester. All tests pass except for a few physical layer tests. The test report has been added to the bug. Change-Id: Ic4869e20e5b4c2ba6c827d92e40c70f3140f2518 Signed-off-by: Sam Hurst <shurst@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1574667 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Sam Hurst <shurst@google.com> Commit-Queue: Sam Hurst <shurst@google.com>