Skip to content

Commit cf590f8

Browse files
kiram9JohnAZoidberg
authored andcommitted
fwk/lilac: PD - support crossbar ready on port evt
On CCG8 3.7.0 SDK, you can only send HPI events to a port, so handle the CCG_RESPONSE_AMD_CROSSBAR_READY event on the port interrupt as well as the device interrupt. BRANCH=fwk-lilac-27116 BUG=https://app.clickup.com/t/86eqarxyq https://app.clickup.com/t/86eqtwjgj TEST=Boot system with devices attached to either side. Check in the log that the PD event 0x38 is recieved and the EC triggers error recovery on ports: [9.571500 AMD Crossbar is ready C:0 ,P:1] [11.764500 AMD Crossbar is ready C:1 ,P:2] [11.776500 TYPE_C_ERROR_RECOVERY] [11.791500 TYPE_C_ERROR_RECOVERY] Signed-off-by: Kieran Levin <ktl@frame.work>
1 parent 0f3ad0a commit cf590f8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

zephyr/program/framework/src/cypress_pd_common.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,19 @@ void cypd_port_int(int controller, int port)
21162116
cypd_handle_alert_msg(controller, port, response_len);
21172117
CPRINTS("CCG_RESPONSE_ALERT_RX");
21182118
break;
2119+
#ifdef CONFIG_CHIPSET_AMD
2120+
case CCG_RESPONSE_AMD_CROSSBAR_READY:
2121+
/**
2122+
* Vendor requests EC to do the error recovery after
2123+
* AMD Crossbar is ready.
2124+
*
2125+
* They add the specific response code 0x38 to notify EC
2126+
* and then EC performs the typec error recovery
2127+
*/
2128+
CPRINTS("AMD Crossbar is ready");
2129+
perform_error_recovery(controller);
2130+
break;
2131+
#endif
21192132
case CCG_RESPONSE_VDM_RX:
21202133
i2c_read_offset16_block(i2c_port, addr_flags,
21212134
CCG_READ_DATA_MEMORY_REG(port, 0), data2, MIN(response_len, 32));

0 commit comments

Comments
 (0)