coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
retimer.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef _DRIVERS_INTEL_USB4_RETIMER_H_
4 #define _DRIVERS_INTEL_USB4_RETIMER_H_
5 
6 /* Flags representing mux state */
7 #define USB_PD_MUX_NONE 0 /* Open switch */
8 #define USB_PD_MUX_USB_ENABLED BIT(0) /* USB connected */
9 #define USB_PD_MUX_SAFE_MODE BIT(5) /* DP is in safe mode */
10 #define USB_PD_MUX_TBT_COMPAT_ENABLED BIT(6) /* TBT compat enabled */
11 #define USB_PD_MUX_USB4_ENABLED BIT(7) /* USB4 enabled */
12 
13 #define USB_RETIMER_FW_UPDATE_OP_SHIFT 4
14 #define USB_RETIMER_FW_UPDATE_ERROR 0xfe
15 /* Retimer firmware update operations */
16 #define USB_RETIMER_FW_UPDATE_SUSPEND_PD 1 /* Suspend PD port */
17 #define USB_RETIMER_FW_UPDATE_RESUME_PD 2 /* Resume PD port */
18 #define USB_RETIMER_FW_UPDATE_GET_MUX 3 /* Read current USB MUX */
19 #define USB_RETIMER_FW_UPDATE_SET_USB 4 /* Set MUX to USB mode */
20 #define USB_RETIMER_FW_UPDATE_SET_SAFE 5 /* Set MUX to Safe mode */
21 #define USB_RETIMER_FW_UPDATE_SET_TBT 6 /* Set MUX to TBT mode */
22 #define USB_RETIMER_FW_UPDATE_DISCONNECT 7 /* Set MUX to disconnect */
23 
25  const char *uuid;
26  void (**callbacks)(uint8_t port, void *);
27  size_t count;
28  void *arg;
29 };
30 
31 const char *ec_retimer_fw_update_path(void);
32 void ec_retimer_fw_update(uint8_t data);
33 /*
34  * This function will convert CPU physical port mapping to abstract
35  * EC port mapping. For example, board might have enabled TCSS port 1
36  * and 3 as per physical port mapping. Since only 2 TCSS ports are enabled
37  * EC will name it as port 0 and port 1. So there will be mismatch when
38  * coreboot sends index for port 3.
39  * Each SoC code using retimer driver needs to implement this function
40  * since SoC will have physical port details.
41  */
42 int retimer_get_index_for_typec(uint8_t typec_port);
43 
44 #endif /* _DRIVERS_INTEL_USB4_RETIMER_H_ */
port
Definition: i915.h:29
void ec_retimer_fw_update(uint8_t data)
Definition: retimer.c:443
int retimer_get_index_for_typec(uint8_t typec_port)
Definition: retimer.c:458
const char * ec_retimer_fw_update_path(void)
Definition: retimer.c:438
unsigned char uint8_t
Definition: stdint.h:8
const char * uuid
Definition: retimer.h:25
void(** callbacks)(uint8_t port, void *)
Definition: retimer.h:26
typedef void(X86APIP X86EMU_intrFuncs)(int num)