diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2020-07-14 00:23:11 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-07-15 08:32:47 +0000 |
commit | f06d7d7003b788c74b0fb6ab8fefaa4524cf2808 (patch) | |
tree | 747e971c443a91b3bbbc436928b79b873a94f816 /src/soc | |
parent | 692dde599f35719d3e9e9a43800b9deea50c002a (diff) |
amd/picasso: rework DXIO and DDI UPD handling
Turning the DXIO and DDI descriptor fields in the FSP_S_CONFIG struct
into arrays allows to properly iterate over the fields.
BUG=b:158695393
TEST=Mandolin still boots.
Change-Id: I85debe4d52399e933768b89b665ff10c9f7779f8
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43434
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/amd/picasso/fsp_params.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/soc/amd/picasso/fsp_params.c b/src/soc/amd/picasso/fsp_params.c index 10bca005e7..80d43fb245 100644 --- a/src/soc/amd/picasso/fsp_params.c +++ b/src/soc/amd/picasso/fsp_params.c @@ -59,13 +59,9 @@ static void fill_pcie_descriptors(FSP_S_CONFIG *scfg, const fsp_pcie_descriptor *descs, size_t num) { size_t i; - fsp_pcie_descriptor *fsp_pcie; - - /* FIXME: this violates C rules. */ - fsp_pcie = (fsp_pcie_descriptor *)(scfg->dxio_descriptor0); for (i = 0; i < num; i++) { - fsp_pcie[i] = descs[i]; + memcpy(scfg->dxio_descriptor[i], &descs[i], sizeof(scfg->dxio_descriptor[0])); } } @@ -73,13 +69,9 @@ static void fill_ddi_descriptors(FSP_S_CONFIG *scfg, const fsp_ddi_descriptor *descs, size_t num) { size_t i; - fsp_ddi_descriptor *fsp_ddi; - - /* FIXME: this violates C rules. */ - fsp_ddi = (fsp_ddi_descriptor *)&(scfg->ddi_descriptor0); for (i = 0; i < num; i++) { - fsp_ddi[i] = descs[i]; + memcpy(&scfg->ddi_descriptor[i], &descs[i], sizeof(scfg->ddi_descriptor[0])); } } static void fsp_fill_pcie_ddi_descriptors(FSP_S_CONFIG *scfg) |