summaryrefslogtreecommitdiff
path: root/board/servo_v4p1/ioexpanders.c
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-051-317/+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>
* 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_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: improve I/O expander implementationMichał Barnaś2021-02-231-142/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-52/+5
| | | | | | | | | | | | | | | | 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: 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>
* servo_v4p1: Allow host hub to manage USB PWREN signalsJan Dabros2021-02-091-8/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: clean-up and USB-C timingsVincent Palatin2021-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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-201-5/+10
| | | | | | | | | | | | | | | | | | - 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: Fix GPIO assignments in ioexpandersJan Dabros2020-12-171-13/+37
| | | | | | | | | | | | | | | | 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>
* Revert "ServoV4/V4p1: Change CCD detection flow"Brian Nemec2020-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-261-2/+2
| | | | | | | | | | | | | | | | | | | | | 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_v4p1: Handle ioexpanders irq in a deferred function callSam Hurst2020-07-221-0/+42
| | | | | | | | | | | | | | | Performing i2c transfers from interrupt context seems to reset the device. Handling the interrupt in a deferred function gets around the problem. BRANCH=none BUG=b:146793000 TEST=make -j buildall Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I7d4609670f5d9826de12f87f5543f231de875df5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2270695 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* servo_v4p1: Add IO Expander functionality and board setup codeSam Hurst2020-06-111-0/+270
The IO Expander and board setup functionality are available in RW and RO BRANCH=none BUG=b:146793000 TEST=make -j buildall Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ic740169607bd1f97be5145caef08715050ece1ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2219119 Reviewed-by: Wai-Hong Tam <waihong@google.com>