| 1 |
|
| 2 |
|
| 3 |
#ifndef __PICASSO_CHIP_H__ |
| 4 |
#define __PICASSO_CHIP_H__ |
| 5 |
|
| 6 |
#include <amdblocks/chip.h> |
| 7 |
#include <amdblocks/pci_clk_req.h> |
| 8 |
#include <commonlib/helpers.h> |
| 9 |
#include <drivers/i2c/designware/dw_i2c.h> |
| 10 |
#include <gpio.h> |
| 11 |
#include <soc/i2c.h> |
| 12 |
#include <soc/iomap.h> |
| 13 |
#include <soc/southbridge.h> |
| 14 |
#include <arch/x86/include/arch/smp/mpspec.h> |
| 15 |
#include <types.h> |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
struct __packed usb2_phy_tune { |
| 21 |
|
| 22 |
uint8_t com_pds_tune; |
| 23 |
|
| 24 |
uint8_t sq_rx_tune; |
| 25 |
|
| 26 |
uint8_t tx_fsls_tune; |
| 27 |
|
| 28 |
uint8_t tx_pre_emp_amp_tune; |
| 29 |
|
| 30 |
uint8_t tx_pre_emp_pulse_tune; |
| 31 |
|
| 32 |
uint8_t tx_rise_tune; |
| 33 |
|
| 34 |
uint8_t tx_vref_tune; |
| 35 |
|
| 36 |
uint8_t tx_hsxv_tune; |
| 37 |
|
| 38 |
uint8_t tx_res_tune; |
| 39 |
}; |
| 40 |
|
| 41 |
|
| 42 |
union __packed usb3_force_gen1 { |
| 43 |
struct { |
| 44 |
uint8_t xhci0_port0:1; |
| 45 |
uint8_t xhci0_port1:1; |
| 46 |
uint8_t xhci0_port2:1; |
| 47 |
uint8_t xhci0_port3:1; |
| 48 |
} ports; |
| 49 |
uint8_t usb3_port_force_gen1_en; |
| 50 |
}; |
| 51 |
|
| 52 |
enum rfmux_configuration_setting { |
| 53 |
USB_PD_RFMUX_SAFE_STATE = 0x0, |
| 54 |
USB_PD_RFMUX_USB31_MODE = 0x1, |
| 55 |
USB_PD_RFMUX_USB31_MODE_FLIP = 0x2, |
| 56 |
USB_PD_RFMUX_ATE_MODE = 0x3, |
| 57 |
USB_PD_RFMUX_DP_X2_MODE = 0x4, |
| 58 |
USB_PD_RFMUX_MF_MODE_ALT_D_F = 0x6, |
| 59 |
USB_PD_RFMUX_DP_X2_MODE_FLIP = 0x8, |
| 60 |
USB_PD_RFMUX_MF_MODE_ALT_D_F_FLIP = 0x9, |
| 61 |
USB_PD_RFMUX_DP_X4_MODE = 0xc, |
| 62 |
}; |
| 63 |
|
| 64 |
struct usb_pd_control { |
| 65 |
uint8_t rfmux_override_en; |
| 66 |
uint32_t rfmux_config; |
| 67 |
}; |
| 68 |
|
| 69 |
#define USB_PORT_COUNT 6 |
| 70 |
|
| 71 |
struct __packed usb3_phy_tune { |
| 72 |
uint8_t rx_eq_delta_iq_ovrd_val; |
| 73 |
uint8_t rx_eq_delta_iq_ovrd_en; |
| 74 |
}; |
| 75 |
|
| 76 |
#define RV2_USB3_PORT_COUNT 4 |
| 77 |
#define USB_PD_PORT_COUNT 2 |
| 78 |
|
| 79 |
enum sd_emmc_driver_strength { |
| 80 |
SD_EMMC_DRIVE_STRENGTH_B, |
| 81 |
SD_EMMC_DRIVE_STRENGTH_A, |
| 82 |
SD_EMMC_DRIVE_STRENGTH_C, |
| 83 |
SD_EMMC_DRIVE_STRENGTH_D, |
| 84 |
}; |
| 85 |
|
| 86 |
|
| 87 |
enum sysinfo_dpphy_override { |
| 88 |
ENABLE_DVI_TUNINGSET = 0x01, |
| 89 |
ENABLE_HDMI_TUNINGSET = 0x02, |
| 90 |
ENABLE_HDMI6G_TUNINGSET = 0x04, |
| 91 |
ENABLE_DP_TUNINGSET = 0x08, |
| 92 |
ENABLE_DP_HBR3_TUNINGSET = 0x10, |
| 93 |
ENABLE_DP_HBR_TUNINGSET = 0x20, |
| 94 |
ENABLE_DP_HBR2_TUNINGSET = 0x40, |
| 95 |
ENABLE_EDP_TUNINGSET = 0x80, |
| 96 |
}; |
| 97 |
|
| 98 |
struct soc_amd_picasso_config { |
| 99 |
struct soc_amd_common_config common_config; |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
u8 i2c_scl_reset; |
| 109 |
struct dw_i2c_bus_config i2c[I2C_CTRLR_COUNT]; |
| 110 |
|
| 111 |
|
| 112 |
uint8_t system_config; |
| 113 |
|
| 114 |
|
| 115 |
uint32_t fast_ppt_limit_mW; |
| 116 |
uint32_t slow_ppt_limit_mW; |
| 117 |
uint32_t slow_ppt_time_constant_s; |
| 118 |
uint32_t stapm_time_constant_s; |
| 119 |
uint32_t sustained_power_limit_mW; |
| 120 |
|
| 121 |
|
| 122 |
uint32_t fast_ppt_limit_tablet_mode_mW; |
| 123 |
uint32_t slow_ppt_limit_tablet_mode_mW; |
| 124 |
uint32_t sustained_power_limit_tablet_mode_mW; |
| 125 |
|
| 126 |
|
| 127 |
uint32_t prochot_l_deassertion_ramp_time_ms; |
| 128 |
|
| 129 |
enum { |
| 130 |
DOWNCORE_AUTO = 0, |
| 131 |
DOWNCORE_1 = 1, |
| 132 |
DOWNCORE_2 = 3, |
| 133 |
DOWNCORE_3 = 4, |
| 134 |
} downcore_mode; |
| 135 |
bool smt_disable; |
| 136 |
|
| 137 |
|
| 138 |
uint32_t thermctl_limit_degreeC; |
| 139 |
uint32_t thermctl_limit_tablet_mode_degreeC; |
| 140 |
|
| 141 |
|
| 142 |
uint32_t psi0_current_limit_mA; |
| 143 |
uint32_t psi0_soc_current_limit_mA; |
| 144 |
uint32_t vddcr_soc_voltage_margin_mV; |
| 145 |
uint32_t vddcr_vdd_voltage_margin_mV; |
| 146 |
|
| 147 |
|
| 148 |
uint32_t vrm_maximum_current_limit_mA; |
| 149 |
uint32_t vrm_soc_maximum_current_limit_mA; |
| 150 |
uint32_t vrm_current_limit_mA; |
| 151 |
uint32_t vrm_soc_current_limit_mA; |
| 152 |
|
| 153 |
|
| 154 |
uint8_t sb_tsi_alert_comparator_mode_en; |
| 155 |
uint8_t core_dldo_bypass; |
| 156 |
uint8_t min_soc_vid_offset; |
| 157 |
uint8_t aclk_dpm0_freq_400MHz; |
| 158 |
uint32_t telemetry_vddcr_vdd_slope_mA; |
| 159 |
uint32_t telemetry_vddcr_vdd_offset; |
| 160 |
uint32_t telemetry_vddcr_soc_slope_mA; |
| 161 |
uint32_t telemetry_vddcr_soc_offset; |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
uint8_t hdmi2_disable; |
| 168 |
|
| 169 |
struct { |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
enum { |
| 186 |
SD_EMMC_DISABLE, |
| 187 |
SD_EMMC_SD_LOW_SPEED, |
| 188 |
SD_EMMC_SD_HIGH_SPEED, |
| 189 |
SD_EMMC_SD_UHS_I_SDR_50, |
| 190 |
SD_EMMC_SD_UHS_I_DDR_50, |
| 191 |
SD_EMMC_SD_UHS_I_SDR_104, |
| 192 |
SD_EMMC_EMMC_SDR_26, |
| 193 |
SD_EMMC_EMMC_SDR_52, |
| 194 |
SD_EMMC_EMMC_DDR_104, |
| 195 |
SD_EMMC_EMMC_HS200, |
| 196 |
SD_EMMC_EMMC_HS400, |
| 197 |
SD_EMMC_EMMC_HS300, |
| 198 |
} timing; |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
enum sd_emmc_driver_strength sdr104_hs400_driver_strength; |
| 208 |
enum sd_emmc_driver_strength ddr50_driver_strength; |
| 209 |
enum sd_emmc_driver_strength sdr50_driver_strength; |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
uint16_t init_khz_preset; |
| 219 |
} emmc_config; |
| 220 |
|
| 221 |
|
| 222 |
union usb3_force_gen1 usb3_port_force_gen1; |
| 223 |
|
| 224 |
uint8_t has_usb2_phy_tune_params; |
| 225 |
struct usb2_phy_tune usb_2_port_tune_params[USB_PORT_COUNT]; |
| 226 |
enum { |
| 227 |
USB_OC_PIN_0 = 0x0, |
| 228 |
USB_OC_PIN_1 = 0x1, |
| 229 |
USB_OC_PIN_2 = 0x2, |
| 230 |
USB_OC_PIN_3 = 0x3, |
| 231 |
USB_OC_PIN_4 = 0x4, |
| 232 |
USB_OC_PIN_5 = 0x5, |
| 233 |
USB_OC_NONE = 0xf, |
| 234 |
} usb_port_overcurrent_pin[USB_PORT_COUNT]; |
| 235 |
|
| 236 |
|
| 237 |
uint8_t usb3_phy_override; |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
struct usb3_phy_tune usb3_phy_tune_params[RV2_USB3_PORT_COUNT]; |
| 243 |
|
| 244 |
uint8_t usb3_rx_vref_ctrl; |
| 245 |
|
| 246 |
uint8_t usb3_rx_vref_ctrl_en; |
| 247 |
|
| 248 |
uint8_t usb_3_tx_vboost_lvl; |
| 249 |
|
| 250 |
uint8_t usb_3_tx_vboost_lvl_en; |
| 251 |
|
| 252 |
uint8_t usb_3_rx_vref_ctrl_x; |
| 253 |
|
| 254 |
uint8_t usb_3_rx_vref_ctrl_en_x; |
| 255 |
|
| 256 |
uint8_t usb_3_tx_vboost_lvl_x; |
| 257 |
|
| 258 |
uint8_t usb_3_tx_vboost_lvl_en_x; |
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
enum gpp_clk_req gpp_clk_config[GPP_CLK_OUTPUT_COUNT]; |
| 263 |
|
| 264 |
|
| 265 |
enum { |
| 266 |
DXIO_PSPP_DISABLED = 0, |
| 267 |
DXIO_PSPP_PERFORMANCE, |
| 268 |
DXIO_PSPP_BALANCED, |
| 269 |
DXIO_PSPP_POWERSAVE, |
| 270 |
} pspp_policy; |
| 271 |
|
| 272 |
|
| 273 |
bool acp_i2s_use_external_48mhz_osc; |
| 274 |
|
| 275 |
|
| 276 |
uint16_t edp_phy_override; |
| 277 |
|
| 278 |
uint8_t edp_physel; |
| 279 |
|
| 280 |
struct { |
| 281 |
uint8_t dp_vs_pemph_level; |
| 282 |
uint8_t deemph_6db4; |
| 283 |
uint8_t boostadj; |
| 284 |
uint16_t margin_deemph; |
| 285 |
} edp_tuningset; |
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
uint8_t edp_pwr_adjust_enable; |
| 292 |
uint8_t pwron_digon_to_de; |
| 293 |
uint8_t pwron_de_to_varybl; |
| 294 |
uint8_t pwrdown_varybloff_to_de; |
| 295 |
uint8_t pwrdown_de_to_digoff; |
| 296 |
uint8_t pwroff_delay; |
| 297 |
uint8_t pwron_varybl_to_blon; |
| 298 |
uint8_t pwrdown_bloff_to_varybloff; |
| 299 |
uint8_t min_allowed_bl_level; |
| 300 |
|
| 301 |
|
| 302 |
struct usb_pd_control usb_pd_config_override[USB_PD_PORT_COUNT]; |
| 303 |
}; |
| 304 |
|
| 305 |
#endif |