From: Po Liu Date: Tue, 26 Nov 2013 14:34:07 +0800 Subject: [U-Boot] [PATCH v3] powerpc/c29xpcie: Getting DDR SPD image from 16-bit sub-address EEPROM In-Reply-To: <1379813507-26800-1-git-send-email-Po.Liu@freescale.com> References: <1379813507-26800-1-git-send-email-Po.Liu@freescale.com> Message-ID: <1385447647-1597-1-git-send-email-Po.Liu@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Currently, there is only one EEPROM on c29xpcie board which is AT24C1024. We program the SPD data at beginning of the AT24C1024.But the AT24C1024 has a 16-bit sub-address mode. This patch is tomake it work when getting SPD in a 16-bit sub-address EEPROM. Signed-off-by: Po Liu --- Changes for V2: - add #include Changes for V3: - change spd type to uint8_t according to the define board/freescale/c29xpcie/ddr.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/board/freescale/c29xpcie/ddr.c b/board/freescale/c29xpcie/ddr.c index 57a9b61..ff7989a 100644 --- a/board/freescale/c29xpcie/ddr.c +++ b/board/freescale/c29xpcie/ddr.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -92,3 +93,15 @@ void fsl_ddr_board_options(memctl_options_t *popts, popts->cs_local_opts[i].odt_wr_cfg = FSL_DDR_ODT_CS; } } + +void get_spd(generic_spd_eeprom_t *spd, u8 i2c_address) +{ + int ret = i2c_read(i2c_address, 0, 2, (uint8_t *)spd, + sizeof(generic_spd_eeprom_t)); + + if (ret) { + printf("DDR: failed to read SPD from address %u\n", + i2c_address); + memset(spd, 0, sizeof(generic_spd_eeprom_t)); + } +} -- 1.8.0