summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Axelrod <victora@marvell.com>2017-07-05 13:26:44 +0300
committerKostya Porotchkin <kostap@marvell.com>2017-07-09 14:58:35 +0300
commitd77aeb0e88718f84489e813355127060c33f935d (patch)
treeab003488dbf8bf620c4ef8439eb1b37124614e41
parent32dd95bf51ca72ad311fd4b967a4ed3a300d3efa (diff)
fix: ddr: select spd mem page 0 to get dram config
This patch replaces the i2c read to write operation to 0x36 device to select SPD memory page 0 in order to access DRAM configuration data. The read operation returns Ack when the current page is 0 or NoAck when the current page is 1, while the write operation actually sets the current page to 0. Change-Id: Iab2b78d005b5967c75d0544f6f7770631165db7e Signed-off-by: Victor Axelrod <victora@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/41184 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
-rw-r--r--plat/marvell/a8k/a70x0_cust/board/dram_port.c10
-rw-r--r--plat/marvell/a8k/a80x0/board/dram_port.c8
-rw-r--r--plat/marvell/a8k/a80x0_mcbin/board/dram_port.c8
3 files changed, 7 insertions, 19 deletions
diff --git a/plat/marvell/a8k/a70x0_cust/board/dram_port.c b/plat/marvell/a8k/a70x0_cust/board/dram_port.c
index e235d9a5..513e26ac 100644
--- a/plat/marvell/a8k/a70x0_cust/board/dram_port.c
+++ b/plat/marvell/a8k/a70x0_cust/board/dram_port.c
@@ -114,13 +114,9 @@ int update_dram_info(struct dram_config *cfg)
mpp_config();
/* initialize ap i2c */
i2c_init((void *)MVEBU_CP0_I2C_BASE);
- /*
- * Dummy read to the SPD chip memory page selector.
- * It is needed for for selecting the SPD memory page 0
- * prior to accessing the DRAM configuration data
- */
- i2c_read(CP0_I2C_SPD_P0_ADDR, 0x0, 2,
- tm->spd_data.all_bytes, 1);
+ /* select SPD memory page 0 to access DRAM configuration */
+ i2c_write(CP0_I2C_SPD_P0_ADDR, 0x0, 2,
+ tm->spd_data.all_bytes, 1);
/* read data from spd */
i2c_read(CP0_I2C_SPD_ADDR, 0x0, 2, tm->spd_data.all_bytes,
sizeof(tm->spd_data.all_bytes));
diff --git a/plat/marvell/a8k/a80x0/board/dram_port.c b/plat/marvell/a8k/a80x0/board/dram_port.c
index acbaec0a..7689102c 100644
--- a/plat/marvell/a8k/a80x0/board/dram_port.c
+++ b/plat/marvell/a8k/a80x0/board/dram_port.c
@@ -167,12 +167,8 @@ int update_dram_info(struct dram_config *cfg)
else
/* initialize ap i2c */
i2c_init((void *)MVEBU_CP0_I2C_BASE);
- /*
- * Dummy read to the SPD chip memory page selector.
- * It is needed for for selecting the SPD memory page 0
- * prior to accessing the DRAM configuration data
- */
- i2c_read(I2C_SPD_P0_ADDR, 0x0, 1, tm->spd_data.all_bytes, 1);
+ /* select SPD memory page 0 to access DRAM configuration */
+ i2c_write(I2C_SPD_P0_ADDR, 0x0, 1, tm->spd_data.all_bytes, 1);
/* read data from spd */
i2c_read(I2C_SPD_ADDR, 0x0, 1, tm->spd_data.all_bytes,
sizeof(tm->spd_data.all_bytes));
diff --git a/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c b/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c
index 01cfdc92..68e8a870 100644
--- a/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c
+++ b/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c
@@ -127,12 +127,8 @@ int update_dram_info(struct dram_config *cfg)
mpp_config();
/* initialize the i2c */
i2c_init((void *)MVEBU_CP0_I2C_BASE);
- /*
- * Dummy read to the SPD chip memory page selector.
- * It is needed for for selecting the SPD memory page 0
- * prior to accessing the DRAM configuration data
- */
- i2c_read(I2C_SPD_P0_ADDR, 0x0, 1, tm->spd_data.all_bytes, 1);
+ /* select SPD memory page 0 to access DRAM configuration */
+ i2c_write(I2C_SPD_P0_ADDR, 0x0, 1, tm->spd_data.all_bytes, 1);
/* read data from spd */
i2c_read(I2C_SPD_ADDR, 0x0, 1, tm->spd_data.all_bytes,
sizeof(tm->spd_data.all_bytes));