soc/intel/skylake: permit Kconfig to set subsystem ID

This change permits the subsystem ID to be specified via Kconfig for the
devices on the SoC.

Some devices are getting zero'ed subsystem IDs because the unset (and thus
zero'ed) config options are overwriting the fsp defaults. With this change
the fsp defaults will only be overwritten by non-zero config values.

Change-Id: I0f7bb8e465f55e5dd6d8e0fad71b9b2a22f089dc
Signed-off-by: Matt Delco <delco@chromium.org>
Reviewed-on: https://review.coreboot.org/27609
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
diff --git a/src/soc/intel/skylake/chip_fsp20.c b/src/soc/intel/skylake/chip_fsp20.c
index f51559f..d5f5433 100644
--- a/src/soc/intel/skylake/chip_fsp20.c
+++ b/src/soc/intel/skylake/chip_fsp20.c
@@ -374,8 +374,15 @@
 		 */
 		params->SpiFlashCfgLockDown = 0;
 	}
-	params->PchSubSystemVendorId = config->PchConfigSubSystemVendorId;
-	params->PchSubSystemId = config->PchConfigSubSystemId;
+	/* only replacing preexisting subsys ID defaults when non-zero */
+#if defined(CONFIG_SUBSYSTEM_VENDOR_ID) && CONFIG_SUBSYSTEM_VENDOR_ID
+	params->DefaultSvid = CONFIG_SUBSYSTEM_VENDOR_ID;
+	params->PchSubSystemVendorId = CONFIG_SUBSYSTEM_VENDOR_ID;
+#endif
+#if defined(CONFIG_SUBSYSTEM_DEVICE_ID) && CONFIG_SUBSYSTEM_DEVICE_ID
+	params->DefaultSid = CONFIG_SUBSYSTEM_DEVICE_ID;
+	params->PchSubSystemId = CONFIG_SUBSYSTEM_DEVICE_ID;
+#endif
 	params->PchPmWolEnableOverride = config->WakeConfigWolEnableOverride;
 	params->PchPmPcieWakeFromDeepSx = config->WakeConfigPcieWakeFromDeepSx;
 	params->PchPmDeepSxPol = config->PmConfigDeepSxPol;