diff options
author | Paul Walmsley <paul@pwsan.com> | 2009-01-28 14:27:39 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-02-08 12:50:39 -0500 |
commit | 87246b7567f7d1951bfcea29875523ef435c0ebf (patch) | |
tree | ef95c7ee66f97630f5afa59ebf7054c371743767 /arch/arm/plat-omap | |
parent | f2ab99778a1a04ddbae38f4de4ef40f2edb92080 (diff) |
[ARM] OMAP2 SDRC: add SDRAM timing parameter infrastructure
For a given SDRAM clock rate, SDRAM chips require memory controllers
to use a specific set of timing minimums and maximums to transfer data
reliably. These parameters can be different for different memory chips
and can also potentially vary by board.
This patch adds the infrastructure for board-*.c files to pass this
timing data to the SDRAM controller init function. The timing data is
specified in an 'omap_sdrc_params' structure, in terms of SDRC
controller register values. An array of these structs, one per SDRC
target clock rate, is passed by the board-*.c file to
omap2_init_common_hw().
This patch does not define the values for different memory chips, nor
does it use the values for anything; those will come in subsequent patches.
linux-omap source commit is bc84ecfc795c2d1c5cda8da4127cf972f488a696.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/mach/io.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/sdrc.h | 24 |
2 files changed, 26 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h index d92bf7964481..0610d7e2b3d7 100644 --- a/arch/arm/plat-omap/include/mach/io.h +++ b/arch/arm/plat-omap/include/mach/io.h | |||
@@ -185,11 +185,13 @@ | |||
185 | #define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a)) | 185 | #define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a)) |
186 | #define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a)) | 186 | #define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a)) |
187 | 187 | ||
188 | struct omap_sdrc_params; | ||
189 | |||
188 | extern void omap1_map_common_io(void); | 190 | extern void omap1_map_common_io(void); |
189 | extern void omap1_init_common_hw(void); | 191 | extern void omap1_init_common_hw(void); |
190 | 192 | ||
191 | extern void omap2_map_common_io(void); | 193 | extern void omap2_map_common_io(void); |
192 | extern void omap2_init_common_hw(void); | 194 | extern void omap2_init_common_hw(struct omap_sdrc_params *sp); |
193 | 195 | ||
194 | #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) | 196 | #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) |
195 | #define __arch_iounmap(v) omap_iounmap(v) | 197 | #define __arch_iounmap(v) omap_iounmap(v) |
diff --git a/arch/arm/plat-omap/include/mach/sdrc.h b/arch/arm/plat-omap/include/mach/sdrc.h index 8e0740eb83fb..adc73522491f 100644 --- a/arch/arm/plat-omap/include/mach/sdrc.h +++ b/arch/arm/plat-omap/include/mach/sdrc.h | |||
@@ -81,7 +81,29 @@ | |||
81 | 81 | ||
82 | #ifndef __ASSEMBLER__ | 82 | #ifndef __ASSEMBLER__ |
83 | 83 | ||
84 | void __init omap2_sdrc_init(void); | 84 | /** |
85 | * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate | ||
86 | * @rate: SDRC clock rate (in Hz) | ||
87 | * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate | ||
88 | * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate | ||
89 | * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate | ||
90 | * @mr: Value to program to SDRC_MR for this rate | ||
91 | * | ||
92 | * This structure holds a pre-computed set of register values for the | ||
93 | * SDRC for a given SDRC clock rate and SDRAM chip. These are | ||
94 | * intended to be pre-computed and specified in an array in the board-*.c | ||
95 | * files. The structure is keyed off the 'rate' field. | ||
96 | */ | ||
97 | struct omap_sdrc_params { | ||
98 | unsigned long rate; | ||
99 | u32 actim_ctrla; | ||
100 | u32 actim_ctrlb; | ||
101 | u32 rfr_ctrl; | ||
102 | u32 mr; | ||
103 | }; | ||
104 | |||
105 | void __init omap2_sdrc_init(struct omap_sdrc_params *sp); | ||
106 | struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r); | ||
85 | 107 | ||
86 | #ifdef CONFIG_ARCH_OMAP2 | 108 | #ifdef CONFIG_ARCH_OMAP2 |
87 | 109 | ||