mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
32bit BUg fix for DDR2 on 8572
This errata fix is required for 32 bit DDR2 controller on 8572. May also be required for P10XX20XX platforms Signed-off-by: Poonam_Agarwal-b10812 <b10812@lc1106.zin33.ap.freescale.net>
This commit is contained in:
parent
e0c4fac79d
commit
e1be0d25ec
2 changed files with 25 additions and 1 deletions
|
@ -19,6 +19,7 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
|
|||
{
|
||||
unsigned int i;
|
||||
volatile ccsr_ddr_t *ddr;
|
||||
u32 temp_sdram_cfg;
|
||||
|
||||
switch (ctrl_num) {
|
||||
case 0:
|
||||
|
@ -78,6 +79,10 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
|
|||
out_be32(&ddr->ddr_sdram_rcw_1, regs->ddr_sdram_rcw_1);
|
||||
out_be32(&ddr->ddr_sdram_rcw_2, regs->ddr_sdram_rcw_2);
|
||||
|
||||
/* Do not enable the memory */
|
||||
temp_sdram_cfg = in_be32(&ddr->sdram_cfg);
|
||||
temp_sdram_cfg &= ~(SDRAM_CFG_MEM_EN);
|
||||
out_be32(&ddr->sdram_cfg, temp_sdram_cfg);
|
||||
/*
|
||||
* For 8572 DDR1 erratum - DDR controller may enter illegal state
|
||||
* when operatiing in 32-bit bus mode with 4-beat bursts,
|
||||
|
@ -99,7 +104,9 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
|
|||
udelay(200);
|
||||
asm volatile("sync;isync");
|
||||
|
||||
out_be32(&ddr->sdram_cfg, regs->ddr_sdram_cfg);
|
||||
/* Let the controller go */
|
||||
temp_sdram_cfg = in_be32(&ddr->sdram_cfg);
|
||||
out_be32(&ddr->sdram_cfg, temp_sdram_cfg | SDRAM_CFG_MEM_EN);
|
||||
|
||||
/* Poll DDR_SDRAM_CFG_2[D_INIT] bit until auto-data init is done. */
|
||||
while (in_be32(&ddr->sdram_cfg_2) & 0x10) {
|
||||
|
|
|
@ -51,6 +51,23 @@ typedef ddr3_spd_eeprom_t generic_spd_eeprom_t;
|
|||
#define FSL_DDR_BANK_INTERLEAVING 0x2
|
||||
#define FSL_DDR_SUPERBANK_INTERLEAVING 0x3
|
||||
|
||||
/* DDR_SDRAM_CFG - DDR SDRAM Control Configuration
|
||||
*/
|
||||
#define SDRAM_CFG_MEM_EN 0x80000000
|
||||
#define SDRAM_CFG_SREN 0x40000000
|
||||
#define SDRAM_CFG_ECC_EN 0x20000000
|
||||
#define SDRAM_CFG_RD_EN 0x10000000
|
||||
#define SDRAM_CFG_SDRAM_TYPE_DDR1 0x02000000
|
||||
#define SDRAM_CFG_SDRAM_TYPE_DDR2 0x03000000
|
||||
#define SDRAM_CFG_SDRAM_TYPE_MASK 0x07000000
|
||||
#define SDRAM_CFG_SDRAM_TYPE_SHIFT 24
|
||||
#define SDRAM_CFG_DYN_PWR 0x00200000
|
||||
#define SDRAM_CFG_32_BE 0x00080000
|
||||
#define SDRAM_CFG_8_BE 0x00040000
|
||||
#define SDRAM_CFG_NCAP 0x00020000
|
||||
#define SDRAM_CFG_2T_EN 0x00008000
|
||||
#define SDRAM_CFG_BI 0x00000001
|
||||
|
||||
/* Record of register values computed */
|
||||
typedef struct fsl_ddr_cfg_regs_s {
|
||||
struct {
|
||||
|
|
Loading…
Add table
Reference in a new issue