]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
driver/ddr/fsl: Add a hook to update SPD address
authorYork Sun <yorksun at freescale.com>
Thu, 28 May 2015 09:24:08 +0000 (14:54 +0530)
committerYork Sun <yorksun@freescale.com>
Mon, 20 Jul 2015 18:44:35 +0000 (11:44 -0700)
In case SPD address changes between board revisions, updating SPD
address can be called from board file.

Signed-off-by: York Sun <yorksun at freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar at freescale.com>
drivers/ddr/fsl/main.c
include/fsl_ddr.h

index fa223834f28d79e9c5518ee6682359066f3205c4..14ecf1219c5cda3dfe81bdba9b0c24ae8aa473e6 100644 (file)
@@ -135,6 +135,13 @@ static void __get_spd(generic_spd_eeprom_t *spd, u8 i2c_address)
 __attribute__((weak, alias("__get_spd")))
 void get_spd(generic_spd_eeprom_t *spd, u8 i2c_address);
 
+/* This function allows boards to update SPD address */
+__weak void update_spd_address(unsigned int ctrl_num,
+                              unsigned int slot,
+                              unsigned int *addr)
+{
+}
+
 void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
                      unsigned int ctrl_num, unsigned int dimm_slots_per_ctrl)
 {
@@ -148,6 +155,7 @@ void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
 
        for (i = 0; i < dimm_slots_per_ctrl; i++) {
                i2c_address = spd_i2c_addr[ctrl_num][i];
+               update_spd_address(ctrl_num, i, &i2c_address);
                get_spd(&(ctrl_dimms_spd[i]), i2c_address);
        }
 }
index 4099a74a4af2cf0b86a4664c6d367a176ba90861..728503b62c9f4324626e77561da9af0d810e112a 100644 (file)
@@ -136,4 +136,7 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
 int fsl_ddr_get_dimm_params(dimm_params_t *pdimm,
                        unsigned int controller_number,
                        unsigned int dimm_number);
+void update_spd_address(unsigned int ctrl_num,
+                       unsigned int slot,
+                       unsigned int *addr);
 #endif