From cd93e8e67f44caa78d2a99d22dd8a5d29489fa50 Mon Sep 17 00:00:00 2001
From: Jon Murphy <jpmurphy@google.com>
Date: Wed, 16 Mar 2022 11:00:13 -0600
Subject: soc/amd/picasso: Add counter initializers

Some counters are not being initialized and are relying on mainboards to
set their values.  If the mainboards have not implemented these
functions it leads to indeterminate behavior.

BUG=b:224987813
TEST=builds

Signed-off-by: Jon Murphy <jpmurphy@google.com>
Change-Id: I14903980fd921cad24c39cadd533349c14cc1cd3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62871
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
---
 src/soc/amd/picasso/fsp_s_params.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/soc/amd/picasso/fsp_s_params.c b/src/soc/amd/picasso/fsp_s_params.c
index af7de37057..2e1055592a 100644
--- a/src/soc/amd/picasso/fsp_s_params.c
+++ b/src/soc/amd/picasso/fsp_s_params.c
@@ -92,10 +92,10 @@ static void fill_ddi_descriptors(FSP_S_CONFIG *scfg,
 
 static void fsp_fill_pcie_ddi_descriptors(FSP_S_CONFIG *scfg)
 {
-	const fsp_dxio_descriptor *fsp_dxio;
-	const fsp_ddi_descriptor *fsp_ddi;
-	size_t num_dxio;
-	size_t num_ddi;
+	const fsp_dxio_descriptor *fsp_dxio = NULL;
+	const fsp_ddi_descriptor *fsp_ddi = NULL;
+	size_t num_dxio = 0;
+	size_t num_ddi = 0;
 
 	mainboard_get_dxio_ddi_descriptors(&fsp_dxio, &num_dxio,
 						&fsp_ddi, &num_ddi);
-- 
cgit v1.2.3