summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/picasso/fsp_params.c12
-rw-r--r--src/vendorcode/amd/fsp/picasso/FspsUpd.h15
2 files changed, 7 insertions, 20 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)
diff --git a/src/vendorcode/amd/fsp/picasso/FspsUpd.h b/src/vendorcode/amd/fsp/picasso/FspsUpd.h
index 5a408316ff..11e77bd3ff 100644
--- a/src/vendorcode/amd/fsp/picasso/FspsUpd.h
+++ b/src/vendorcode/amd/fsp/picasso/FspsUpd.h
@@ -9,19 +9,14 @@
#include <FspUpd.h>
+#define FSPS_UPD_DXIO_DESCRIPTOR_COUNT 6
+#define FSPS_UPD_DDI_DESCRIPTOR_COUNT 4
+
typedef struct __packed {
/** Offset 0x0020**/ uint32_t emmc0_mode;
/** Offset 0x0024**/ uint8_t unused0[12];
- /** Offset 0x0030**/ uint8_t dxio_descriptor0[16];
- /** Offset 0x0040**/ uint8_t dxio_descriptor1[16];
- /** Offset 0x0050**/ uint8_t dxio_descriptor2[16];
- /** Offset 0x0060**/ uint8_t dxio_descriptor3[16];
- /** Offset 0x0070**/ uint8_t dxio_descriptor4[16];
- /** Offset 0x0080**/ uint8_t dxio_descriptor5[16];
- /** Offset 0x0090**/ uint32_t ddi_descriptor0;
- /** Offset 0x0094**/ uint32_t ddi_descriptor1;
- /** Offset 0x0098**/ uint32_t ddi_descriptor2;
- /** Offset 0x009C**/ uint32_t ddi_descriptor3;
+ /** Offset 0x0030**/ uint8_t dxio_descriptor[FSPS_UPD_DXIO_DESCRIPTOR_COUNT][16];
+ /** Offset 0x0090**/ uint32_t ddi_descriptor[FSPS_UPD_DDI_DESCRIPTOR_COUNT];
/** Offset 0x00A0**/ uint32_t unused1;
/** Offset 0x00A4**/ uint32_t unused2;
/** Offset 0x00A8**/ uint32_t unused3;