soc/amd/*/fsp_m_params: rework local USB PHY table update

Update the fields that need to be updated directly in the local static
usb_phy_config struct instead of dereferencing the pointer written to
the corresponding UPD field. This will allow updating the type of UPD
field in a follow-up commit to enable 64 bit coreboot builds.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I44a9fe719e6803fc957fee3db13b261489ed313d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69896
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
diff --git a/src/soc/amd/cezanne/fsp_m_params.c b/src/soc/amd/cezanne/fsp_m_params.c
index ba2663a..f370331 100644
--- a/src/soc/amd/cezanne/fsp_m_params.c
+++ b/src/soc/amd/cezanne/fsp_m_params.c
@@ -153,10 +153,10 @@
 		/* devicetree config is const, use local copy */
 		static struct usb_phy_config lcl_usb_phy;
 		lcl_usb_phy = config->usb_phy;
+		lcl_usb_phy.Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
+		lcl_usb_phy.Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
+		lcl_usb_phy.TableLength = sizeof(struct usb_phy_config);
 		mcfg->usb_phy = &lcl_usb_phy;
-		mcfg->usb_phy->Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
-		mcfg->usb_phy->Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
-		mcfg->usb_phy->TableLength = sizeof(struct usb_phy_config);
 	} else {
 		mcfg->usb_phy = NULL;
 	}
diff --git a/src/soc/amd/glinda/fsp_m_params.c b/src/soc/amd/glinda/fsp_m_params.c
index 7e78287..d8de742 100644
--- a/src/soc/amd/glinda/fsp_m_params.c
+++ b/src/soc/amd/glinda/fsp_m_params.c
@@ -155,10 +155,10 @@
 		/* devicetree config is const, use local copy */
 		static struct usb_phy_config lcl_usb_phy;
 		lcl_usb_phy = config->usb_phy;
+		lcl_usb_phy.Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
+		lcl_usb_phy.Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
+		lcl_usb_phy.TableLength = sizeof(struct usb_phy_config);
 		mcfg->usb_phy = &lcl_usb_phy;
-		mcfg->usb_phy->Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
-		mcfg->usb_phy->Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
-		mcfg->usb_phy->TableLength = sizeof(struct usb_phy_config);
 	} else {
 		mcfg->usb_phy = NULL;
 	}
diff --git a/src/soc/amd/mendocino/fsp_m_params.c b/src/soc/amd/mendocino/fsp_m_params.c
index ed8be66..8cbea5d 100644
--- a/src/soc/amd/mendocino/fsp_m_params.c
+++ b/src/soc/amd/mendocino/fsp_m_params.c
@@ -154,10 +154,10 @@
 		/* devicetree config is const, use local copy */
 		static struct usb_phy_config lcl_usb_phy;
 		lcl_usb_phy = config->usb_phy;
+		lcl_usb_phy.Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
+		lcl_usb_phy.Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
+		lcl_usb_phy.TableLength = sizeof(struct usb_phy_config);
 		mcfg->usb_phy = &lcl_usb_phy;
-		mcfg->usb_phy->Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
-		mcfg->usb_phy->Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
-		mcfg->usb_phy->TableLength = sizeof(struct usb_phy_config);
 	} else {
 		mcfg->usb_phy = NULL;
 	}
diff --git a/src/soc/amd/morgana/fsp_m_params.c b/src/soc/amd/morgana/fsp_m_params.c
index e1e8c26..0c51c1a 100644
--- a/src/soc/amd/morgana/fsp_m_params.c
+++ b/src/soc/amd/morgana/fsp_m_params.c
@@ -155,10 +155,10 @@
 		/* devicetree config is const, use local copy */
 		static struct usb_phy_config lcl_usb_phy;
 		lcl_usb_phy = config->usb_phy;
+		lcl_usb_phy.Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
+		lcl_usb_phy.Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
+		lcl_usb_phy.TableLength = sizeof(struct usb_phy_config);
 		mcfg->usb_phy = &lcl_usb_phy;
-		mcfg->usb_phy->Version_Major = FSP_USB_STRUCT_MAJOR_VERSION;
-		mcfg->usb_phy->Version_Minor = FSP_USB_STRUCT_MINOR_VERSION;
-		mcfg->usb_phy->TableLength = sizeof(struct usb_phy_config);
 	} else {
 		mcfg->usb_phy = NULL;
 	}