summaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/mpc85xx/ddr-gen3.c
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2011-01-10 12:02:59 +0000
committerKumar Gala <galak@kernel.crashing.org>2011-01-19 22:58:23 -0600
commitd2a9568c57f0aa02f097911d3811e002a1eec1b8 (patch)
tree9cb9c95879bfbc5de66d8ff12f6179d27ae4db0d /arch/powerpc/cpu/mpc85xx/ddr-gen3.c
parent8ed20f2c178aa44c8e1a35703579fd63350e9f42 (diff)
downloadu-boot-imx-d2a9568c57f0aa02f097911d3811e002a1eec1b8.zip
u-boot-imx-d2a9568c57f0aa02f097911d3811e002a1eec1b8.tar.gz
u-boot-imx-d2a9568c57f0aa02f097911d3811e002a1eec1b8.tar.bz2
mpc85xx: Adding more registers and options
This patch exposes more registers which can be used by the DDR drivers or interactive debugging. U-boot doesn't use all the registers in DDRC. When advanced tuning is required, writing to those registers is needed. Add writing to cdr1, cdr2, err_disable, err_int_en and debug registers Add options to override rcw, address parity to RDIMMs. Use array for debug registers. Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/ddr-gen3.c')
-rw-r--r--arch/powerpc/cpu/mpc85xx/ddr-gen3.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/ddr-gen3.c b/arch/powerpc/cpu/mpc85xx/ddr-gen3.c
index e46dcb7..4e768d3 100644
--- a/arch/powerpc/cpu/mpc85xx/ddr-gen3.c
+++ b/arch/powerpc/cpu/mpc85xx/ddr-gen3.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Freescale Semiconductor, Inc.
+ * Copyright 2008-2011 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -9,6 +9,7 @@
#include <common.h>
#include <asm/io.h>
#include <asm/fsl_ddr_sdram.h>
+#include <asm/processor.h>
#if (CONFIG_CHIP_SELECTS_PER_CTRL > 4)
#error Invalid setting for CONFIG_CHIP_SELECTS_PER_CTRL
@@ -79,6 +80,12 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
out_be32(&ddr->ddr_sr_cntr, regs->ddr_sr_cntr);
out_be32(&ddr->ddr_sdram_rcw_1, regs->ddr_sdram_rcw_1);
out_be32(&ddr->ddr_sdram_rcw_2, regs->ddr_sdram_rcw_2);
+ out_be32(&ddr->ddr_cdr1, regs->ddr_cdr1);
+ out_be32(&ddr->ddr_cdr2, regs->ddr_cdr2);
+ out_be32(&ddr->err_disable, regs->err_disable);
+ out_be32(&ddr->err_int_en, regs->err_int_en);
+ for (i = 0; i < 32; i++)
+ out_be32(&ddr->debug[i], regs->debug[i]);
/* Set, but do not enable the memory */
temp_sdram_cfg = regs->ddr_sdram_cfg;
@@ -93,8 +100,7 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
if ((((in_be32(&ddr->sdram_cfg) >> 24) & 0x7) == SDRAM_TYPE_DDR2)
&& in_be32(&ddr->sdram_cfg) & 0x80000) {
/* set DEBUG_1[31] */
- u32 temp = in_be32(&ddr->debug_1);
- out_be32(&ddr->debug_1, temp | 1);
+ setbits_be32(&ddr->debug[0], 1);
}
#endif