All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] rockchip: rk3188: ram: add support for 16bit row address
@ 2017-09-29  1:38 Kever Yang
  0 siblings, 0 replies; only message in thread
From: Kever Yang @ 2017-09-29  1:38 UTC (permalink / raw)
  To: u-boot

RK3188 using the same ddr_conf for both 15 bit and 16 bit row address.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v2:
- add missing row definition

 drivers/ram/rockchip/sdram_rk3188.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/ram/rockchip/sdram_rk3188.c b/drivers/ram/rockchip/sdram_rk3188.c
index 9d8b225..365d00e 100644
--- a/drivers/ram/rockchip/sdram_rk3188.c
+++ b/drivers/ram/rockchip/sdram_rk3188.c
@@ -682,11 +682,18 @@ out:
 
 static int sdram_get_niu_config(struct rk3188_sdram_params *sdram_params)
 {
-	int i, tmp, size, ret = 0;
+	int i, tmp, size, row, ret = 0;
 
+	row = sdram_params->ch[0].cs0_row;
+	/*
+	 * RK3188 share the rank and row bit15, we use same ddr config for 15bit
+	 * and 16bit row
+	 */
+	if (row == 16)
+		row = 15;
 	tmp = sdram_params->ch[0].col - 9;
 	tmp -= (sdram_params->ch[0].bw == 2) ? 0 : 1;
-	tmp |= ((sdram_params->ch[0].cs0_row - 13) << 4);
+	tmp |= ((row - 13) << 4);
 	size = sizeof(ddrconf_table)/sizeof(ddrconf_table[0]);
 	for (i = 0; i < size; i++)
 		if (tmp == ddrconf_table[i])
-- 
1.9.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-29  1:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-29  1:38 [U-Boot] [PATCH v2] rockchip: rk3188: ram: add support for 16bit row address Kever Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.