armv7, beagle: Second SDRAM bank don;t work
PATCH 1/1 armv7, beagle: Second SDRAM bank don;t work
since commit 3667cbeed5e3c4067e624e52a916b1ebb02c8f05 on beagle board the second sdram bank didn;t longer work. Since this patch sdram settings just get copied from bank a, but CMD_NOP, CMD_PRECHARGE, CMD_AUTOREFRESH are not executed and after that mr register is also not updated. This patch adds this for the bank b.
---
Wolfgang, this patch should also be added to u-boot-arm elf_reloc
arch/arm/cpu/armv7/omap3/sdrc.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/omap3/sdrc.c +7 -0
@@ -149,6 +149,13 @@ void do_sdrc_init(u32 cs, u32 early) &sdrc_actim_base1->ctrla);writel (readl (&sdrc_actim_base0->ctrlb), &sdrc_actim_base1->ctrlb); + +writel (CMD_NOP , &sdrc_base->cs[cs].manual); +writel (CMD_PRECHARGE , &sdrc_base->cs[cs].manual); +writel (CMD_AUTOREFRESH , &sdrc_base->cs[cs].manual); +writel (CMD_AUTOREFRESH , &sdrc_base->cs[cs].manual); +writel (readl (&sdrc_base->cs[CS0 ].mr), + &sdrc_base->cs[CS1 ].mr); }/*
Signature · 1 line
1.7.2.3
PATCH 1/1 armv7, beagle: Second SDRAM bank don;t work
Dear Heiko Schocher,
Quoted 6 lines · In message <[email protected]> you wrote:
since commit
3667cbeed5e3c4067e624e52a916b1ebb02c8f05on beagle board the second sdram bank didn;t longer work. Since this patch sdram settings just get copied from bank a, butCMD_NOP,CMD_PRECHARGE,CMD_AUTOREFRESHare not executed and after that mr register is also not updated. This patch adds this for the bank b.
I would like to see Steve's ACK for the original Beagle board, and it's several versions.
Steve, what Heiko forgets to mention here is that this problem happened on a EBV-Beagle, so there are certrain hardware differences.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de This restaurant was advertising breakfast any time. So I ordered french toast in the renaissance. - Steven Wright, comedian
PATCH 1/1 armv7, beagle: Second SDRAM bank don;t work
Quoted 10 lines · Wolfgang Denk
Dear Heiko Schocher,
Quoted 6 lines · In message <[email protected]> you wrote:
since commit
3667cbeed5e3c4067e624e52a916b1ebb02c8f05on beagle board the second sdram bank didn;t longer work. Since this patch sdram settings just get copied from bank a, butCMD_NOP,CMD_PRECHARGE,CMD_AUTOREFRESHare not executed and after that mr register is also not updated. This patch adds this for the bank b.
Quoted 5 lines
I would like to see Steve's ACK for the original Beagle board, and it's several versions.
Steve, what Heiko forgets to mention here is that this problem happened on a EBV-Beagle, so there are certrain hardware differences.
I suspect that his using an EVB-Beagle (with associated EVB x-load) is what is causing the issue for him.
With the introduction of the Beagle xM came the need to deal with several types of POP memory, and the resulting need for customized setup for the SDRC.
This is best handled in x-load while running from SRAM, since timings and mux setup are different for each memory type.
The code in Beagle x-load currently looks like this:
void config_3430sdram_ddr(void)
{
/* reset sdrc controller */
__raw_writel(SOFTRESET, SDRC_SYSCONFIG);
wait_on_value(BIT0, BIT0, SDRC_STATUS, 12000000);
__raw_writel(0, SDRC_SYSCONFIG);
/* setup sdrc to ball mux */
__raw_writel(SDP_SDRC_SHARING, SDRC_SHARING);
if (beagle_revision() == REVISION_XM) {
if (identify_xm_ddr() == MICRON_DDR) {
__raw_writel(0x2, SDRC_CS_CFG); /* 256MB/bank */
__raw_writel(SDP_SDRC_MDCFG_0_DDR_MICRON_XM, SDRC_MCFG_0);
__raw_writel(SDP_SDRC_MDCFG_0_DDR_MICRON_XM, SDRC_MCFG_1);
__raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_0);
__raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_0);
__raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_1);
__raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_1);
__raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_0);
__raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_1);
} else {
__raw_writel(0x4, SDRC_CS_CFG); /* 512MB/bank */
__raw_writel(SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM, SDRC_MCFG_0);
__raw_writel(SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM, SDRC_MCFG_1);
__raw_writel(NUMONYX_V_ACTIMA_165, SDRC_ACTIM_CTRLA_0);
__raw_writel(NUMONYX_V_ACTIMB_165, SDRC_ACTIM_CTRLB_0);
__raw_writel(NUMONYX_V_ACTIMA_165, SDRC_ACTIM_CTRLA_1);
__raw_writel(NUMONYX_V_ACTIMB_165, SDRC_ACTIM_CTRLB_1);
__raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_0);
__raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_1);
}
} else {
__raw_writel(0x1, SDRC_CS_CFG); /* 128MB/bank */
__raw_writel(SDP_SDRC_MDCFG_0_DDR, SDRC_MCFG_0);
__raw_writel(SDP_SDRC_MDCFG_0_DDR, SDRC_MCFG_1);
__raw_writel(MICRON_V_ACTIMA_165, SDRC_ACTIM_CTRLA_0);
__raw_writel(MICRON_V_ACTIMB_165, SDRC_ACTIM_CTRLB_0);
__raw_writel(MICRON_V_ACTIMA_165, SDRC_ACTIM_CTRLA_1);
__raw_writel(MICRON_V_ACTIMB_165, SDRC_ACTIM_CTRLB_1);
__raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_0);
__raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_1);
}
__raw_writel(SDP_SDRC_POWER_POP, SDRC_POWER);
/* init sequence for mDDR/mSDR using manual commands (DDR is different) */
__raw_writel(CMD_NOP, SDRC_MANUAL_0);
__raw_writel(CMD_NOP, SDRC_MANUAL_1);
delay(5000);
__raw_writel(CMD_PRECHARGE, SDRC_MANUAL_0);
__raw_writel(CMD_PRECHARGE, SDRC_MANUAL_1);
__raw_writel(CMD_AUTOREFRESH, SDRC_MANUAL_0);
__raw_writel(CMD_AUTOREFRESH, SDRC_MANUAL_1);
__raw_writel(CMD_AUTOREFRESH, SDRC_MANUAL_0);
__raw_writel(CMD_AUTOREFRESH, SDRC_MANUAL_1);
/* set mr0 */
__raw_writel(SDP_SDRC_MR_0_DDR, SDRC_MR_0);
__raw_writel(SDP_SDRC_MR_0_DDR, SDRC_MR_1);
/* set up dll */
__raw_writel(SDP_SDRC_DLLAB_CTRL, SDRC_DLLA_CTRL);
delay(0x2000); /* give time to lock */}
The code in u-boot to copy bank 1 settings to bank 2 was a workaround so that Beagle users who didn't update x-load immediately would at least have a functioning system.
I don't think that Heiko's patch will do any harm and it might be a good idea so that EVB Beagle users can use the standard Beagle u-boot. I will have to verify that it does no harm on all the various Beagle versions first though.
I will Ack or Nack after I do some testing.
Regards,
Steve
PATCH 1/1 armv7, beagle: Second SDRAM bank don;t work
Hello Steve,
Quoted 10 lines · Steve Sakoman
Quoted 9 lines · Wolfgang Denk
Dear Heiko Schocher,
Quoted 6 lines · In message <[email protected]> you wrote:
since commit
3667cbeed5e3c4067e624e52a916b1ebb02c8f05on beagle board the second sdram bank didn;t longer work. Since this patch sdram settings just get copied from bank a, butCMD_NOP,CMD_PRECHARGE,CMD_AUTOREFRESHare not executed and after that mr register is also not updated. This patch adds this for the bank b.
Quoted 8 lines
Quoted 5 lines
I would like to see Steve's ACK for the original Beagle board, and it's several versions.
Steve, what Heiko forgets to mention here is that this problem happened on a EBV-Beagle, so there are certrain hardware differences.
I suspect that his using an EVB-Beagle (with associated EVB x-load) is what is causing the issue for him.
Yep, seems so.
Quoted 8 lines
With the introduction of the Beagle xM came the need to deal with several types of POP memory, and the resulting need for customized setup for the SDRC.
This is best handled in x-load while running from SRAM, since timings and mux setup are different for each memory type.
The code in Beagle x-load currently looks like this:
[...]
Quoted 5 lines
The code in u-boot to copy bank 1 settings to bank 2 was a workaround so that Beagle users who didn't update x-load immediately would at least have a functioning system.
I don't think that Heiko's patch will do any harm and it might be a good idea so that EVB
Yep, so I think too ...
Quoted 4 lines
Beagle users can use the standard Beagle u-boot. I will have to verify that it does no harm on all the various Beagle versions first though.
I will Ack or Nack after I do some testing.
Thanks!
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 armv7, beagle: Second SDRAM bank don;t work
In reply to Steve SakomanDear Steve Sakoman,
Quoted 7 lines · In message <1287064487.7756.21.camel@quadra> you wrote:
With the introduction of the Beagle xM came the need to deal with several types of POP memory, and the resulting need for customized setup for the SDRC.
This is best handled in x-load while running from SRAM, since timings and mux setup are different for each memory type.
I still wonder why x-load was foprked out of the U-Boot tree; I guess a number of problems would simply not exist at all if the code was maintained together.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Some people march to the beat of a different drummer. And some people tango!
Paulraj
PATCH 1/1 armv7, beagle: Second SDRAM bank don;t work
In reply to Steve SakomanQuoted 5 lines
The code in u-boot to copy bank 1 settings to bank 2 was a workaround so that Beagle users
who didn't update x-load immediately would at least have a functioning system.
Quoted 7 lines
I don't think that Heiko's patch will do any harm and it might be a good idea so that EVB
Beagle users can use the standard Beagle u-boot. I will have to verify that it does no
harm on all the various Beagle versions first though.I will Ack or Nack after I do some testing.
Do let me know the results of your testing
Regards,
Sandeep
PATCH 1/1 armv7, beagle: Second SDRAM bank don;t work
In reply to Heiko SchocherQuoted 34 lines · Heiko Schocher
since commit
3667cbeed5e3c4067e624e52a916b1ebb02c8f05on beagle board the second sdram bank didn;t longer work. Since this patch sdram settings just get copied from bank a, butCMD_NOP,CMD_PRECHARGE,CMD_AUTOREFRESHare not executed and after that mr register is also not updated. This patch adds this for the bank b.Signed-off-by Heiko Schocher <[email protected]>cc Steve Sakoman <[email protected]>cc Sandeep Paulraj <[email protected]>cc Wolfgang Denk <[email protected]>---
Wolfgang, this patch should also be added to u-boot-armelf_reloc?arch/arm/cpu/armv7/omap3/sdrc.c | ? ?7 +++++++
?1 files changed, 7 insertions(+), 0 deletions(-)arch/arm/cpu/armv7/omap3/sdrc.c +7
-0@@ -149,6 +149,13 @@ void do_sdrc_init(u32 cs, u32 early) ? ? ? ? ? ? ? ? ? ? ? ?&sdrc_actim_base1->ctrla); ? ? ? ? ? ? ? ?writel(readl(&sdrc_actim_base0->ctrlb), ? ? ? ? ? ? ? ? ? ? ? ?&sdrc_actim_base1->ctrlb); + + ? ? ? ? ? ? ? writel(CMD_NOP, &sdrc_base->cs[cs].manual); + ? ? ? ? ? ? ? writel(CMD_PRECHARGE, &sdrc_base->cs[cs].manual); + ? ? ? ? ? ? ? writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual); + ? ? ? ? ? ? ? writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual); + ? ? ? ? ? ? ? writel(readl(&sdrc_base->cs[CS0].mr), + ? ? ? ? ? ? ? ? ? ? ? &sdrc_base->cs[CS1].mr); ? ? ? ?}
Quoted 3 lines
? ? ? ?/*
--
1.7.2.3
I tested this on Overos with 3 brands of POP memory and both 35XX and 37XX processors. Seemed to do no harm on any combination, so: