| 1 |
|
| 2 |
|
| 3 |
#ifndef PHOENIX_CHIP_OPENSIL_H |
| 4 |
#define PHOENIX_CHIP_OPENSIL_H |
| 5 |
|
| 6 |
#include <types.h> |
| 7 |
|
| 8 |
#define DDI_DESCRIPTOR_COUNT 5 |
| 9 |
|
| 10 |
|
| 11 |
enum ddi_connector_type { |
| 12 |
DDI_DP = 0, |
| 13 |
DDI_EDP, |
| 14 |
DDI_SINGLE_LINK_DVI, |
| 15 |
DDI_DUAL_LINK_DVI, |
| 16 |
DDI_HDMI, |
| 17 |
DDI_DP_TO_VGA, |
| 18 |
DDI_DP_TO_LVDS, |
| 19 |
DDI_NUTMEG_DP_TO_VGA, |
| 20 |
DDI_SINGLE_LINK_DVI_I, |
| 21 |
DDI_DP_W_TYPEC, |
| 22 |
DDI_DP_WO_TYPEC, |
| 23 |
DDI_EDP_TO_LVDS, |
| 24 |
DDI_EDP_TO_LVDS_SW, |
| 25 |
DDI_AUTO_DETECT, |
| 26 |
DDI_UNUSED_TYPE, |
| 27 |
DDI_MAX_CONNECTOR_TYPE |
| 28 |
}; |
| 29 |
|
| 30 |
|
| 31 |
struct ddi_descriptor { |
| 32 |
uint8_t connector_type; |
| 33 |
uint8_t aux_index; |
| 34 |
uint8_t hdp_index; |
| 35 |
}; |
| 36 |
|
| 37 |
#define USB2_PORT_COUNT 8 |
| 38 |
#define USB3_PORT_COUNT 3 |
| 39 |
#define USBC_COMBO_PHY_COUNT 3 |
| 40 |
|
| 41 |
struct fch_usb2_phy { |
| 42 |
uint8_t compdistune; |
| 43 |
uint8_t pllbtune; |
| 44 |
uint8_t pllitune; |
| 45 |
uint8_t pllptune; |
| 46 |
uint8_t sqrxtune; |
| 47 |
uint8_t txfslstune; |
| 48 |
uint8_t txpreempamptune; |
| 49 |
uint8_t txpreemppulsetune; |
| 50 |
uint8_t txrisetune; |
| 51 |
uint8_t txvreftune; |
| 52 |
uint8_t txhsxvtune; |
| 53 |
uint8_t txrestune; |
| 54 |
}; |
| 55 |
|
| 56 |
struct fch_usb3_phy { |
| 57 |
uint8_t tx_term_ctrl; |
| 58 |
uint8_t rx_term_ctrl; |
| 59 |
uint8_t tx_vboost_lvl_en; |
| 60 |
uint8_t tx_vboost_lvl; |
| 61 |
}; |
| 62 |
|
| 63 |
#define USB0_PORT0 0 |
| 64 |
#define USB0_PORT1 1 |
| 65 |
#define USB0_PORT2 1 |
| 66 |
#define USB0_PORT3 3 |
| 67 |
#define USB1_PORT0 (0<<2) |
| 68 |
#define USB1_PORT1 (1<<2) |
| 69 |
#define USB1_PORT2 (1<<2) |
| 70 |
#define USB1_PORT3 (3<<2) |
| 71 |
|
| 72 |
#define USB_COMBO_PHY_MODE_USB_C 0 |
| 73 |
#define USB_COMBO_PHY_MODE_USB_ONLY 1 |
| 74 |
#define USB_COMBO_PHY_MODE_USB_DPM 2 |
| 75 |
#define USB_COMBO_PHY_MODE_USB_DPP 3 |
| 76 |
|
| 77 |
struct usb_phy_config { |
| 78 |
struct fch_usb2_phy Usb2PhyPort[USB2_PORT_COUNT]; |
| 79 |
struct fch_usb3_phy Usb3PhyPort[USB3_PORT_COUNT]; |
| 80 |
uint8_t BatteryChargerEnable; |
| 81 |
uint8_t PhyP3CpmP4Support; |
| 82 |
uint8_t ComboPhyStaticConfig[USBC_COMBO_PHY_COUNT]; |
| 83 |
}; |
| 84 |
|
| 85 |
#endif |