diff mbox

[1/5] OMAP: Add in helper macros for the SDRAM timings

Message ID 1270572668-2336-2-git-send-email-lwalkera@ieee.org (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Laine Walker-Avina April 6, 2010, 4:51 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
index 7b76f50..c74d1e7 100644
--- a/arch/arm/plat-omap/include/plat/sdrc.h
+++ b/arch/arm/plat-omap/include/plat/sdrc.h
@@ -124,6 +124,29 @@  struct omap_sdrc_params {
 	u32 mr;
 };
 
+/* Helper macros and defines for the omap_sdrc_params registers */
+#define ACTIM_TRFC(a)		(((a) & 0x1f)<<27)
+#define ACTIM_TRC(a)		(((a) & 0x1f)<<22)
+#define ACTIM_TRAS(a)		(((a) & 0xf)<<18)
+#define ACTIM_TRP(a)		(((a) & 0x3)<<15)
+#define ACTIM_TRCD(a)		(((a) & 0x3)<<12)
+#define ACTIM_TRRD(a)		(((a) & 0x3)<<9)
+#define ACTIM_TDPL(a)		(((a) & 0x3)<<6)
+#define ACTIM_TDAL(a)		(((a) & 0x1f)<<0)
+
+#define ACTIM_TWTR(a)		(((a) & 0x3)<<16)
+#define ACTIM_TCKE(a)		(((a) & 0x7)<<12)
+#define ACTIM_TXP(a)		(((a) & 0x7)<<8)
+#define ACTIM_TXSR(a)		(((a) & 0xff)<<0)
+
+#define RFR_CTRL_ARCV(a)	(((a) & 0xffff)<<8)
+#define RFR_CTRL_ARE(a)		(((a) & 0x3)<<0)
+
+#define MR_WBST(a)			(((a) & 0x1)<<9)
+#define MR_CASL(a)			(((a) & 0x7)<<4)
+#define MR_BL(a)			(((a) & 0x7)<<0)
+
+
 void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
 			    struct omap_sdrc_params *sdrc_cs1);
 int omap2_sdrc_get_params(unsigned long r,