This code is no longer specific to the any board. Signed-off-by: John Watts <contact@xxxxxxxxxx> --- common/Makefile | 4 ++++ {drivers/ddr/fsl => common}/ddr1_dimm_params.c | 0 {drivers/ddr/fsl => common}/ddr2_dimm_params.c | 0 {drivers/ddr/fsl => common}/ddr3_dimm_params.c | 0 {drivers/ddr/fsl => common}/ddr4_dimm_params.c | 0 drivers/ddr/fsl/Makefile | 4 ---- drivers/ddr/fsl/fsl_ddr.h | 12 ------------ include/ddr_dimms.h | 13 +++++++++++++ 8 files changed, 17 insertions(+), 16 deletions(-) rename {drivers/ddr/fsl => common}/ddr1_dimm_params.c (100%) rename {drivers/ddr/fsl => common}/ddr2_dimm_params.c (100%) rename {drivers/ddr/fsl => common}/ddr3_dimm_params.c (100%) rename {drivers/ddr/fsl => common}/ddr4_dimm_params.c (100%) diff --git a/common/Makefile b/common/Makefile index 25f5653f90..7131f15cc8 100644 --- a/common/Makefile +++ b/common/Makefile @@ -33,6 +33,10 @@ obj-$(CONFIG_CONSOLE_FULL) += console.o obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o obj-y += console_countdown.o obj-pbl-$(CONFIG_DDR_SPD) += ddr_spd.o +obj-pbl-$(CONFIG_DDR_SPD) += ddr1_dimm_params.o +obj-pbl-$(CONFIG_DDR_SPD) += ddr2_dimm_params.o +obj-pbl-$(CONFIG_DDR_SPD) += ddr3_dimm_params.o +obj-pbl-$(CONFIG_DDR_SPD) += ddr4_dimm_params.o obj-$(CONFIG_ENV_HANDLING) += environment.o envfs-core.o obj-$(CONFIG_DEFAULT_ENVIRONMENT) += envfs-core.o obj-$(CONFIG_ENVIRONMENT_VARIABLES) += env.o diff --git a/drivers/ddr/fsl/ddr1_dimm_params.c b/common/ddr1_dimm_params.c similarity index 100% rename from drivers/ddr/fsl/ddr1_dimm_params.c rename to common/ddr1_dimm_params.c diff --git a/drivers/ddr/fsl/ddr2_dimm_params.c b/common/ddr2_dimm_params.c similarity index 100% rename from drivers/ddr/fsl/ddr2_dimm_params.c rename to common/ddr2_dimm_params.c diff --git a/drivers/ddr/fsl/ddr3_dimm_params.c b/common/ddr3_dimm_params.c similarity index 100% rename from drivers/ddr/fsl/ddr3_dimm_params.c rename to common/ddr3_dimm_params.c diff --git a/drivers/ddr/fsl/ddr4_dimm_params.c b/common/ddr4_dimm_params.c similarity index 100% rename from drivers/ddr/fsl/ddr4_dimm_params.c rename to common/ddr4_dimm_params.c diff --git a/drivers/ddr/fsl/Makefile b/drivers/ddr/fsl/Makefile index 394ae55383..787b4453f3 100644 --- a/drivers/ddr/fsl/Makefile +++ b/drivers/ddr/fsl/Makefile @@ -4,9 +4,5 @@ pbl-y += main.o util.o ctrl_regs.o options.o lc_common_dimm_params.o -pbl-y += ddr1_dimm_params.o -pbl-y += ddr2_dimm_params.o -pbl-y += ddr3_dimm_params.o -pbl-y += ddr4_dimm_params.o obj-y += arm_ddr_gen3.o pbl-y += fsl_ddr_gen4.o diff --git a/drivers/ddr/fsl/fsl_ddr.h b/drivers/ddr/fsl/fsl_ddr.h index 87edd10ac1..e95cea1657 100644 --- a/drivers/ddr/fsl/fsl_ddr.h +++ b/drivers/ddr/fsl/fsl_ddr.h @@ -204,18 +204,6 @@ struct fsl_ddr_controller; u32 fsl_ddr_get_version(struct fsl_ddr_controller *c); -unsigned int ddr1_compute_dimm_parameters(unsigned int mclk_ps, - const struct ddr1_spd_eeprom *spd, - struct dimm_params *pdimm); -unsigned int ddr2_compute_dimm_parameters(unsigned int mclk_ps, - const struct ddr2_spd_eeprom *spd, - struct dimm_params *pdimm); -unsigned int ddr3_compute_dimm_parameters(unsigned int mclk_ps, - const struct ddr3_spd_eeprom *spd, - struct dimm_params *pdimm); -unsigned int ddr4_compute_dimm_parameters(unsigned int mclk_ps, - const struct ddr4_spd_eeprom *spd, - struct dimm_params *pdimm); void fsl_ddr_set_intl3r(const unsigned int granule_size); unsigned int compute_fsl_memctl_config_regs(struct fsl_ddr_controller *c); diff --git a/include/ddr_dimms.h b/include/ddr_dimms.h index ea5ec85b82..f44c46447a 100644 --- a/include/ddr_dimms.h +++ b/include/ddr_dimms.h @@ -100,4 +100,17 @@ struct dimm_params { unsigned int dq_mapping_ors; /* DDR4 */ }; +unsigned int ddr1_compute_dimm_parameters(unsigned int mclk_ps, + const struct ddr1_spd_eeprom *spd, + struct dimm_params *pdimm); +unsigned int ddr2_compute_dimm_parameters(unsigned int mclk_ps, + const struct ddr2_spd_eeprom *spd, + struct dimm_params *pdimm); +unsigned int ddr3_compute_dimm_parameters(unsigned int mclk_ps, + const struct ddr3_spd_eeprom *spd, + struct dimm_params *pdimm); +unsigned int ddr4_compute_dimm_parameters(unsigned int mclk_ps, + const struct ddr4_spd_eeprom *spd, + struct dimm_params *pdimm); + #endif /* _DDR_DIMMS_H_ */ -- 2.39.0