From: Heiko Stuebner <heiko@sntech.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 03/20] rockchip: rk3288: sdram: use constants in ddrconf table
Date: Sat, 18 Feb 2017 19:46:23 +0100 [thread overview]
Message-ID: <20170218184640.30635-4-heiko@sntech.de> (raw)
In-Reply-To: <20170218184640.30635-1-heiko@sntech.de>
Use defines to describe the bit shifts used to create the
table for ddrconf register values.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 ++++++++
arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 20 ++++++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/arch/arm/include/asm/arch-rockchip/ddr_rk3288.h b/arch/arm/include/asm/arch-rockchip/ddr_rk3288.h
index fccabcd2c0..9a59075afc 100644
--- a/arch/arm/include/asm/arch-rockchip/ddr_rk3288.h
+++ b/arch/arm/include/asm/arch-rockchip/ddr_rk3288.h
@@ -425,6 +425,14 @@ enum {
#define START_CMD (1u << 31)
+/*
+ * DDRCONF
+ * [5:4] row(13+n)
+ * [1:0] col(9+n), assume bw=2
+ */
+#define DDRCONF_ROW_SHIFT 4
+#define DDRCONF_COL_SHIFT 0
+
/* DEVTODEV */
#define BUSWRTORD_SHIFT 4
#define BUSRDTOWR_SHIFT 2
diff --git a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
index be3d713202..41661046af 100644
--- a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
@@ -596,16 +596,16 @@ static void dram_all_config(const struct dram_info *dram,
const int ddrconf_table[] = {
/* row col,bw */
0,
- ((1 << 4) | 1),
- ((2 << 4) | 1),
- ((3 << 4) | 1),
- ((4 << 4) | 1),
- ((1 << 4) | 2),
- ((2 << 4) | 2),
- ((3 << 4) | 2),
- ((1 << 4) | 0),
- ((2 << 4) | 0),
- ((3 << 4) | 0),
+ ((1 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+ ((2 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+ ((3 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+ ((4 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+ ((1 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+ ((2 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+ ((3 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+ ((1 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
+ ((2 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
+ ((3 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
0,
0,
0,
--
2.11.0
next prev parent reply other threads:[~2017-02-18 18:46 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-18 18:46 [U-Boot] [PATCH v4 00/20] rk3188 uboot support Heiko Stuebner
2017-02-18 18:46 ` [U-Boot] [PATCH v4 01/20] dm: allow limiting pre-reloc markings to spl or tpl Heiko Stuebner
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 02/20] clk: rk3288: limit gpll and cpll init to SPL build Heiko Stuebner
2017-02-21 18:08 ` Simon Glass
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` Heiko Stuebner [this message]
2017-02-21 18:08 ` [U-Boot] [PATCH v4 03/20] rockchip: rk3288: sdram: use constants in ddrconf table Simon Glass
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 04/20] rockchip: rk3288: sdram: style fixes from rk3188 sdram review Heiko Stuebner
2017-02-21 18:08 ` Simon Glass
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 05/20] rockchip: Move bootrom helper compilation to a hidden option Heiko Stuebner
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 06/20] rockchip: Move bootrom-related declarations to a header Heiko Stuebner
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 07/20] rockchip: mkimage: Allow encoding of loader code in spl images Heiko Stuebner
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 08/20] rockchip: mkimage: Add support rk3188 serial Heiko Stuebner
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 09/20] rockchip: serial: Adapt rockchip of-platdata driver for rk3188 Heiko Stuebner
2017-02-21 20:34 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 10/20] rockchip: rk3188: Add header files for PMU and GRF Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 11/20] rockchip: rk3188: Add pinctrl driver Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 12/20] rockchip: rk3188: Add sysreset driver Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 13/20] rockchip: rk3188: Add rk3066/rk3188 clock bindings Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 14/20] rockchip: rk3188: Add clock driver Heiko Stuebner
2017-02-18 18:46 ` [U-Boot] [PATCH v4 15/20] rockchip: rk3188: Add core devicetree files Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 16/20] rockchip: rk3188: Add core support Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 17/20] rockchip: rk3188: Add sdram driver Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 18/20] rockchip: rk3188: Add main, spl and tpl boards Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-02-18 18:46 ` [U-Boot] [PATCH v4 19/20] rockchip: rk3188: Add Radxa Rock board Heiko Stuebner
2017-02-21 20:35 ` Simon Glass
2017-03-23 16:18 ` Simon Glass
2017-03-23 16:34 ` Heiko Stübner
2017-02-18 18:46 ` [U-Boot] [PATCH v4 20/20] rockchip: rk3188: add README.rockchip paragraph describing sd boot Heiko Stuebner
2017-02-21 18:08 ` Simon Glass
2017-02-21 20:35 ` Simon Glass
2017-02-23 3:26 ` [U-Boot] [PATCH v4 00/20] rk3188 uboot support Simon Glass
2017-02-23 3:59 ` Heiko Stuebner
2017-02-23 16:19 ` Simon Glass
2017-02-23 16:29 ` Heiko Stuebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170218184640.30635-4-heiko@sntech.de \
--to=heiko@sntech.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox