summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/picasso/chip.h9
-rw-r--r--src/soc/amd/picasso/fsp_params.c13
2 files changed, 9 insertions, 13 deletions
diff --git a/src/soc/amd/picasso/chip.h b/src/soc/amd/picasso/chip.h
index d3c9a0721b..64258b24ca 100644
--- a/src/soc/amd/picasso/chip.h
+++ b/src/soc/amd/picasso/chip.h
@@ -37,6 +37,8 @@ struct __packed usb2_phy_tune {
uint8_t tx_res_tune;
};
+#define USB_PORT_COUNT 6
+
struct soc_amd_picasso_config {
struct soc_amd_common_config common_config;
/*
@@ -134,12 +136,7 @@ struct soc_amd_picasso_config {
uint8_t xhci0_force_gen1;
uint8_t has_usb2_phy_tune_params;
- struct usb2_phy_tune usb_2_port_0_tune_params;
- struct usb2_phy_tune usb_2_port_1_tune_params;
- struct usb2_phy_tune usb_2_port_2_tune_params;
- struct usb2_phy_tune usb_2_port_3_tune_params;
- struct usb2_phy_tune usb_2_port_4_tune_params;
- struct usb2_phy_tune usb_2_port_5_tune_params;
+ struct usb2_phy_tune usb_2_port_tune_params[USB_PORT_COUNT];
};
typedef struct soc_amd_picasso_config config_t;
diff --git a/src/soc/amd/picasso/fsp_params.c b/src/soc/amd/picasso/fsp_params.c
index d280bffc47..8e6703e436 100644
--- a/src/soc/amd/picasso/fsp_params.c
+++ b/src/soc/amd/picasso/fsp_params.c
@@ -98,17 +98,16 @@ static void fsp_fill_pcie_ddi_descriptors(FSP_S_CONFIG *scfg)
static void fsp_usb_oem_customization(FSP_S_CONFIG *scfg,
const struct soc_amd_picasso_config *cfg)
{
- size_t num = sizeof(struct usb2_phy_tune);
+ ASSERT(FSPS_UPD_USB2_PORT_COUNT == USB_PORT_COUNT);
scfg->xhci0_force_gen1 = cfg->xhci0_force_gen1;
if (cfg->has_usb2_phy_tune_params) {
- memcpy(scfg->fch_usb_2_port0_phy_tune, &cfg->usb_2_port_0_tune_params, num);
- memcpy(scfg->fch_usb_2_port1_phy_tune, &cfg->usb_2_port_1_tune_params, num);
- memcpy(scfg->fch_usb_2_port2_phy_tune, &cfg->usb_2_port_2_tune_params, num);
- memcpy(scfg->fch_usb_2_port3_phy_tune, &cfg->usb_2_port_3_tune_params, num);
- memcpy(scfg->fch_usb_2_port4_phy_tune, &cfg->usb_2_port_4_tune_params, num);
- memcpy(scfg->fch_usb_2_port5_phy_tune, &cfg->usb_2_port_5_tune_params, num);
+ for (size_t i = 0; i < FSPS_UPD_USB2_PORT_COUNT; i++) {
+ memcpy(scfg->fch_usb_2_port_phy_tune[i],
+ &cfg->usb_2_port_tune_params[i],
+ sizeof(scfg->fch_usb_2_port_phy_tune[0]));
+ }
}
}