Adding fixed sdram setting for cornet_ds board
PATCH v2 1/2 Adding fixed sdram setting for cornet_ds board
800, 900, 1000, 1200MT/s data rate parameters are added for fixed sdram setting. SPD based parameters and fixed parameters can be toggled by hwconfig. To use fixed parameters,
hwconfig=fsl_ddr:sdram=fixed
To use SPD parameters,
hwconfig=fsl_ddr:ctlr_intlv=cacheline,bank_intlv=cs0_cs1
--- arch/powerpc/include/asm/fsl_ddr_sdram.h | 6 + board/freescale/corenet_ds/Makefile | 8 +- board/freescale/corenet_ds/corenet_ds.c | 15 -- board/freescale/corenet_ds/ddr.c | 131 +++++++++++- board/freescale/corenet_ds/p3041ds_ddr.c | 14 ++ board/freescale/corenet_ds/p4080ds_ddr.c | 356 ++++++++++++++++++++++++++++++ board/freescale/corenet_ds/p5020ds_ddr.c | 18 ++ include/configs/corenet_ds.h | 60 +----- 8 files changed, 529 insertions(+), 79 deletions(-) create mode 100644 board/freescale/corenet_ds/p3041ds_ddr.c create mode 100644 board/freescale/corenet_ds/p4080ds_ddr.c create mode 100644 board/freescale/corenet_ds/p5020ds_ddr.c
arch/powerpc/include/asm/fsl_ddr_sdram.h +6 -0
@@ -213,4 +213,10 @@ typedef struct memctl_options_s { } memctl_options_t;extern phys_size_t fsl_ddr_sdram (void ); + +typedef struct fixed_ddr_parm { +int min_freq; +int max_freq; +fsl_ddr_cfg_regs_t *ddr_settings; +}fixed_ddr_parm_t ;#endif
board/freescale/corenet_ds/Makefile +4 -4
@@ -27,10 +27,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a COBJS-y += $(BOARD).o -COBJS-$(CONFIG_DDR_SPD) += ddr.o -COBJS-$(CONFIG_P3041DS) += eth_hydra.o -COBJS-$(CONFIG_P4080DS) += eth_p4080.o -COBJS-$(CONFIG_P5020DS) += eth_hydra.o +COBJS-y += ddr.o +COBJS-$(CONFIG_P3041DS) += eth_hydra.o p3041ds_ddr.o +COBJS-$(CONFIG_P4080DS) += eth_p4080.o p4080ds_ddr.o +COBJS-$(CONFIG_P5020DS) += eth_hydra.o p5020ds_ddr.o COBJS-$(CONFIG_PCI) += pci.o COBJS-y += law.o COBJS-y += tlb.o
board/freescale/corenet_ds/corenet_ds.c +0 -15
@@ -29,7 +29,6 @@#include <asm/cache.h> #include <asm/immap_85xx.h> #include <asm/fsl_law.h> -#include <asm/fsl_ddr_sdram.h> #include <asm/fsl_serdes.h> #include <asm/fsl_portals.h> #include <asm/fsl_liodn.h>
@@ -239,20 +238,6 @@ int misc_init_r(void)return 0 ; } -phys_size_t initdram (int board_type) -{ -phys_size_t dram_size; - -puts ("Initializing....\n" ); - - dram_size =fsl_ddr_sdram (); - -setup_ddr_tlbs (dram_size /0x100000 ); - -puts (" DDR: " ); -return dram_size; -} -#ifdef CONFIG_MP void board_lmb_reserve (struct lmb *lmb) {
board/freescale/corenet_ds/ddr.c +130 -1
142 lines not on this page · raw message
board/freescale/corenet_ds/p3041ds_ddr.c new file +14 -0
@@ -0,0 +1,14 @@ +/* +* Copyright 2009-2010 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 +* Version 2 as published by the Free Software Foundation. +*/ + +#include <common.h> +#include <asm/fsl_ddr_sdram.h> + +fixed_ddr_parm_t fixed_ddr_parm_0[] = { + {0 ,0 ,NULL } +};
board/freescale/corenet_ds/p4080ds_ddr.c new file +356 -0
356 lines not on this page · raw message
board/freescale/corenet_ds/p5020ds_ddr.c new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Copyright 2009-2010 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 +* Version 2 as published by the Free Software Foundation. +*/ + +#include <common.h> +#include <asm/fsl_ddr_sdram.h> + +fixed_ddr_parm_t fixed_ddr_parm_0[] = { + {0 ,0 ,NULL } +}; + +fixed_ddr_parm_t fixed_ddr_parm_1[] = { + {0 ,0 ,NULL } +};
include/configs/corenet_ds.h +1 -59
69 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH v2 2/2 Disable unused chip-select for DDR controller interleaving
When DDR controller interleaving is eabled and less than all bank (chip-select) interleaving is seletected, the unused chip-select should be disabled.
--- arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +14 -3
@@ -1184,6 +1184,7 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,unsigned int sr_it;unsigned int zq_en;unsigned int wrlvl_en; +int cs_en =1 ;memset (ddr,0 ,sizeof (fsl_ddr_cfg_regs_t));
@@ -1250,16 +1251,23 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,* and each controller uses rank interleaving within * itself. Therefore the starting and ending address * on each controller is twice the amount present on -* each controller. +* each controller. If any CS is not included in the +* interleaving, the memory on that CS is not accssible +* and the total memory size is reduced. The CS is also +* disabled. */ unsigned long long ctlr_density =0 ;switch (popts->ba_intlv_ctl &FSL_DDR_CS0_CS1_CS2_CS3 ) {case FSL_DDR_CS0_CS1 :case FSL_DDR_CS0_CS1_AND_CS2_CS3 : ctlr_density = dimm_params[0 ].rank_density *2 ; +if (i >1 ) + cs_en =0 ;break ;case FSL_DDR_CS2_CS3 : ctlr_density = dimm_params[0 ].rank_density; +if (i >0 ) + cs_en =0 ;break ;case FSL_DDR_CS0_CS1_CS2_CS3 :/*
@@ -1379,8 +1387,11 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts, );debug ("FSLDDR: cs[%d]_bnds = 0x%08x\n" , i, ddr->cs[i].bnds); -set_csn_config (dimm_number, i, ddr, popts, dimm_params); -set_csn_config_2 (i, ddr); +if (cs_en) { +set_csn_config (dimm_number, i, ddr, popts, dimm_params); +set_csn_config_2 (i, ddr); + }else +printf ("CS%d is disabled.\n" , i); }set_ddr_eor (ddr, popts);
Signature · 1 line
1.7.0.4
Kumar Gala
AppliedPATCH v2 2/2 Disable unused chip-select for DDR controller interleaving
Quoted 7 lines · York Sun
When DDR controller interleaving is eabled and less than all bank (chip-select) interleaving is seletected, the unused chip-select should be disabled.
Signed-off-by York Sun <[email protected]>---
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c| 17 ++++++++++++++---1 files changed, 14 insertions(+), 3 deletions(-)
applied to 85xx
- k
Kumar Gala
AppliedPATCH v2 1/2 Adding fixed sdram setting for cornet_ds board
In reply to York SunQuoted 21 lines · York Sun
800, 900, 1000, 1200MT/s data rate parameters are added for fixed sdram setting. SPD based parameters and fixed parameters can be toggled by hwconfig. To use fixed parameters,
hwconfig=fsl_ddr:sdram=fixed
To use SPD parameters,
hwconfig=fsl_ddr:ctlr_intlv=cacheline,bank_intlv=cs0_cs1
Signed-off-by York Sun <[email protected]>---
arch/powerpc/include/asm/fsl_ddr_sdram.h | 6 + board/freescale/corenet_ds/Makefile | 8 +- board/freescale/corenet_ds/corenet_ds.c | 15 -- board/freescale/corenet_ds/ddr.c | 131 +++++++++++- board/freescale/corenet_ds/p3041ds_ddr.c | 14 ++ board/freescale/corenet_ds/p4080ds_ddr.c | 356 ++++++++++++++++++++++++++++++ board/freescale/corenet_ds/p5020ds_ddr.c | 18 ++ include/configs/corenet_ds.h | 60 +----- 8 files changed, 529 insertions(+), 79 deletions(-)
Quoted 3 lines
create mode 100644
board/freescale/corenet_ds/p3041ds_ddr.ccreate mode 100644board/freescale/corenet_ds/p4080ds_ddr.ccreate mode 100644board/freescale/corenet_ds/p5020ds_ddr.c
applied to 85xx, but removed p3041/p5020 stuff as its not upstream yet.
- k