soc/amd/sabrina/fsp_m_params: fix modification of constant

mcfg->usb_phy is a pointer to a struct usb_phy_config. The config is
constant. Changing a constant is undefined behavior, so create a local
static instance of usb_phy_config that can be modified safely.

Change-Id: Iedbc49109dcd1da9198fcb2a8f84e2b567cd8f86
Signed-off-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64130
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/amd/sabrina/fsp_m_params.c b/src/soc/amd/sabrina/fsp_m_params.c
index c1f903b..1a2f23b 100644
--- a/src/soc/amd/sabrina/fsp_m_params.c
+++ b/src/soc/amd/sabrina/fsp_m_params.c
@@ -143,7 +143,10 @@
 	mcfg->hda_enable = is_dev_enabled(DEV_PTR(hda));
 
 	if (config->usb_phy_custom) {
-		mcfg->usb_phy = (struct usb_phy_config *)&config->usb_phy;
+		/* devicetree config is const, use local copy */
+		static struct usb_phy_config lcl_usb_phy;
+		lcl_usb_phy = config->usb_phy;
+		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);