Rename CONFIG_SYS_MDDRC memory constants for all mpc512x boards
PATCH 1/1 Rename CONFIG_SYS_MDDRC memory constants for all mpc512x boards
From: Martha Marx <[email protected]>
--- cpu/mpc512x/fixed_sdram.c | 104 ++++++++++++------------ include/configs/aria.h | 190 +++++++++++++++++++++--------------------- include/configs/mecp5123.h | 78 +++++++++--------- include/configs/mpc5121ads.h | 86 ++++++++++---------- 4 files changed, 229 insertions(+), 229 deletions(-)
cpu/mpc512x/fixed_sdram.c +52 -52
@@ -46,68 +46,68 @@ long int fixed_sdram(void)sync_law (&im->sysconf.ddrlaw.ar);/* Enable DDR */ -out_be32 (&im->mddrc.ddr_sys_config,CONFIG_SYS_MDDRC_SYS_CFG_EN ); +out_be32 (&im->mddrc.ddr_sys_config,MDDRC_SYS_CFG_EN );/* Initialize DDR Priority Manager */ -out_be32 (&im->mddrc.prioman_config1,CONFIG_SYS_MDDRCGRP_PM_CFG1 ); -out_be32 (&im->mddrc.prioman_config2,CONFIG_SYS_MDDRCGRP_PM_CFG2 ); -out_be32 (&im->mddrc.hiprio_config,CONFIG_SYS_MDDRCGRP_HIPRIO_CFG ); -out_be32 (&im->mddrc.lut_table0_main_upper,CONFIG_SYS_MDDRCGRP_LUT0_MU ); -out_be32 (&im->mddrc.lut_table0_main_lower,CONFIG_SYS_MDDRCGRP_LUT0_ML ); -out_be32 (&im->mddrc.lut_table1_main_upper,CONFIG_SYS_MDDRCGRP_LUT1_MU ); -out_be32 (&im->mddrc.lut_table1_main_lower,CONFIG_SYS_MDDRCGRP_LUT1_ML ); -out_be32 (&im->mddrc.lut_table2_main_upper,CONFIG_SYS_MDDRCGRP_LUT2_MU ); -out_be32 (&im->mddrc.lut_table2_main_lower,CONFIG_SYS_MDDRCGRP_LUT2_ML ); -out_be32 (&im->mddrc.lut_table3_main_upper,CONFIG_SYS_MDDRCGRP_LUT3_MU ); -out_be32 (&im->mddrc.lut_table3_main_lower,CONFIG_SYS_MDDRCGRP_LUT3_ML ); -out_be32 (&im->mddrc.lut_table4_main_upper,CONFIG_SYS_MDDRCGRP_LUT4_MU ); -out_be32 (&im->mddrc.lut_table4_main_lower,CONFIG_SYS_MDDRCGRP_LUT4_ML ); -out_be32 (&im->mddrc.lut_table0_alternate_upper,CONFIG_SYS_MDDRCGRP_LUT0_AU ); -out_be32 (&im->mddrc.lut_table0_alternate_lower,CONFIG_SYS_MDDRCGRP_LUT0_AL ); -out_be32 (&im->mddrc.lut_table1_alternate_upper,CONFIG_SYS_MDDRCGRP_LUT1_AU ); -out_be32 (&im->mddrc.lut_table1_alternate_lower,CONFIG_SYS_MDDRCGRP_LUT1_AL ); -out_be32 (&im->mddrc.lut_table2_alternate_upper,CONFIG_SYS_MDDRCGRP_LUT2_AU ); -out_be32 (&im->mddrc.lut_table2_alternate_lower,CONFIG_SYS_MDDRCGRP_LUT2_AL ); -out_be32 (&im->mddrc.lut_table3_alternate_upper,CONFIG_SYS_MDDRCGRP_LUT3_AU ); -out_be32 (&im->mddrc.lut_table3_alternate_lower,CONFIG_SYS_MDDRCGRP_LUT3_AL ); -out_be32 (&im->mddrc.lut_table4_alternate_upper,CONFIG_SYS_MDDRCGRP_LUT4_AU ); -out_be32 (&im->mddrc.lut_table4_alternate_lower,CONFIG_SYS_MDDRCGRP_LUT4_AL ); +out_be32 (&im->mddrc.prioman_config1,MDDRCGRP_PM_CFG1 ); +out_be32 (&im->mddrc.prioman_config2,MDDRCGRP_PM_CFG2 ); +out_be32 (&im->mddrc.hiprio_config,MDDRCGRP_HIPRIO_CFG ); +out_be32 (&im->mddrc.lut_table0_main_upper,MDDRCGRP_LUT0_MU ); +out_be32 (&im->mddrc.lut_table0_main_lower,MDDRCGRP_LUT0_ML ); +out_be32 (&im->mddrc.lut_table1_main_upper,MDDRCGRP_LUT1_MU ); +out_be32 (&im->mddrc.lut_table1_main_lower,MDDRCGRP_LUT1_ML ); +out_be32 (&im->mddrc.lut_table2_main_upper,MDDRCGRP_LUT2_MU ); +out_be32 (&im->mddrc.lut_table2_main_lower,MDDRCGRP_LUT2_ML ); +out_be32 (&im->mddrc.lut_table3_main_upper,MDDRCGRP_LUT3_MU ); +out_be32 (&im->mddrc.lut_table3_main_lower,MDDRCGRP_LUT3_ML ); +out_be32 (&im->mddrc.lut_table4_main_upper,MDDRCGRP_LUT4_MU ); +out_be32 (&im->mddrc.lut_table4_main_lower,MDDRCGRP_LUT4_ML ); +out_be32 (&im->mddrc.lut_table0_alternate_upper,MDDRCGRP_LUT0_AU ); +out_be32 (&im->mddrc.lut_table0_alternate_lower,MDDRCGRP_LUT0_AL ); +out_be32 (&im->mddrc.lut_table1_alternate_upper,MDDRCGRP_LUT1_AU ); +out_be32 (&im->mddrc.lut_table1_alternate_lower,MDDRCGRP_LUT1_AL ); +out_be32 (&im->mddrc.lut_table2_alternate_upper,MDDRCGRP_LUT2_AU ); +out_be32 (&im->mddrc.lut_table2_alternate_lower,MDDRCGRP_LUT2_AL ); +out_be32 (&im->mddrc.lut_table3_alternate_upper,MDDRCGRP_LUT3_AU ); +out_be32 (&im->mddrc.lut_table3_alternate_lower,MDDRCGRP_LUT3_AL ); +out_be32 (&im->mddrc.lut_table4_alternate_upper,MDDRCGRP_LUT4_AU ); +out_be32 (&im->mddrc.lut_table4_alternate_lower,MDDRCGRP_LUT4_AL );/* Initialize MDDRC */ -out_be32 (&im->mddrc.ddr_sys_config,CONFIG_SYS_MDDRC_SYS_CFG ); -out_be32 (&im->mddrc.ddr_time_config0,CONFIG_SYS_MDDRC_TIME_CFG0 ); -out_be32 (&im->mddrc.ddr_time_config1,CONFIG_SYS_MDDRC_TIME_CFG1 ); -out_be32 (&im->mddrc.ddr_time_config2,CONFIG_SYS_MDDRC_TIME_CFG2 ); +out_be32 (&im->mddrc.ddr_sys_config,MDDRC_SYS_CFG ); +out_be32 (&im->mddrc.ddr_time_config0,MDDRC_TIME_CFG0 ); +out_be32 (&im->mddrc.ddr_time_config1,MDDRC_TIME_CFG1 ); +out_be32 (&im->mddrc.ddr_time_config2,MDDRC_TIME_CFG2 );/* Initialize DDR */ for (i =0 ; i <10 ; i++) -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_NOP ); +out_be32 (&im->mddrc.ddr_command,DDR_NOP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_PCHG_ALL ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_NOP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_RFSH ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_NOP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_RFSH ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_NOP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_INIT_DEV_OP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_NOP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_EM2 ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_NOP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_PCHG_ALL ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_EM2 ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_EM3 ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_EN_DLL ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_INIT_DEV_OP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_PCHG_ALL ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_RFSH ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_INIT_DEV_OP ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_OCD_DEFAULT ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_PCHG_ALL ); -out_be32 (&im->mddrc.ddr_command,CONFIG_SYS_MICRON_NOP ); +out_be32 (&im->mddrc.ddr_command,DDR_PCHG_ALL ); +out_be32 (&im->mddrc.ddr_command,DDR_NOP ); +out_be32 (&im->mddrc.ddr_command,DDR_RFSH ); +out_be32 (&im->mddrc.ddr_command,DDR_NOP ); +out_be32 (&im->mddrc.ddr_command,DDR_RFSH ); +out_be32 (&im->mddrc.ddr_command,DDR_NOP ); +out_be32 (&im->mddrc.ddr_command,DDR_MICRON_INIT_DEV_OP ); +out_be32 (&im->mddrc.ddr_command,DDR_NOP ); +out_be32 (&im->mddrc.ddr_command,DDR_EM2 ); +out_be32 (&im->mddrc.ddr_command,DDR_NOP ); +out_be32 (&im->mddrc.ddr_command,DDR_PCHG_ALL ); +out_be32 (&im->mddrc.ddr_command,DDR_EM2 ); +out_be32 (&im->mddrc.ddr_command,DDR_EM3 ); +out_be32 (&im->mddrc.ddr_command,DDR_EN_DLL ); +out_be32 (&im->mddrc.ddr_command,DDR_MICRON_INIT_DEV_OP ); +out_be32 (&im->mddrc.ddr_command,DDR_PCHG_ALL ); +out_be32 (&im->mddrc.ddr_command,DDR_RFSH ); +out_be32 (&im->mddrc.ddr_command,DDR_MICRON_INIT_DEV_OP ); +out_be32 (&im->mddrc.ddr_command,DDR_OCD_DEFAULT ); +out_be32 (&im->mddrc.ddr_command,DDR_PCHG_ALL ); +out_be32 (&im->mddrc.ddr_command,DDR_NOP );/* Start MDDRC */ -out_be32 (&im->mddrc.ddr_time_config0,CONFIG_SYS_MDDRC_TIME_CFG0_RUN ); -out_be32 (&im->mddrc.ddr_sys_config,CONFIG_SYS_MDDRC_SYS_CFG_RUN ); +out_be32 (&im->mddrc.ddr_time_config0,MDDRC_TIME_CFG0_RUN ); +out_be32 (&im->mddrc.ddr_sys_config,MDDRC_SYS_CFG_RUN );return msize; }
include/configs/aria.h +95 -95
203 lines not on this page · raw message
include/configs/mecp5123.h +39 -39
86 lines not on this page · raw message
include/configs/mpc5121ads.h +43 -43
96 lines not on this page · raw message
Signature · 1 line
1.5.2.4
PATCH 1/1 Rename CONFIG_SYS_MDDRC memory constants for all mpc512x boards
Dear Martha M Stan,
Quoted 1 line · In message <[email protected]> you wrote:
From: Martha Marx <[email protected]>
May I ask what the purpose of such a rename is? I mean, which problem are you tryin to fix, and in which way is the new code supposed to be better than the old one?
Actually I think the new names are much worse. What's the purpose of omitting the "CONFIG_SYS_" part?
...
Review
Quoted 2 lines
(quoted diff) +1
-1- out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); + out_be32(&im->mddrc.ddr_command, DDR_NOP);
For example this rename - using "DDR_NOP" for a configurable parameter in a global file, and having to #define this in the board config files makes no sense to me.
We have standard rule about naming of configration options. This here is clearly a case where "CONFIG_SYS_" applies.
All the other renames fall in the same category.
Unless you have a very good reason for this rename I tend to NAK this.
Best regards,
Wolfgang Denk
Signature · 4 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 Drawing on my fine command of language, I said nothing.
PATCH 1/1 Rename CONFIG_SYS_MDDRC memory constants for all mpc512x boards
Hello Wolfgang,
I know this was a while ago ... but when I first posted the Elpida patch you asked me to FIX the my memory constant changes. At that time you said the following
Quoted 5 lines
While performing such a global rename, please let's get rid of the
CONFIG_SYS_names. These are NOT options that can be changed by the user in the board config file, so they should not look like such.
This is when I tried to change some constants because they had "MICRON" in there. I decided to take out MICRON since they are being shared by both ELPIDA and MICRON.
How bout I just make a whole new set of constants for ELPIDA ??? and Leave the "MICRON" ones the way they stand ?
Best Regards,
-Martha Stan
Quoted 46 lines
-----Original Message-----
From: Wolfgang Denk [mailto:wd at denx.de]
Sent: Thursday, September 10, 2009 2:49 PM
To: Martha M Stan
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] RenameCONFIG_SYS_MDDRCmemory constants for all mpc512x boardsDear Martha M Stan,
Quoted 1 line · In message <[email protected]> you wrote:
From: Martha Marx <[email protected]>
May I ask what the purpose of such a rename is? I mean, which problem are you tryin to fix, and in which way is the new code supposed to be better than the old one?
Actually I think the new names are much worse. What's the purpose of omitting the "
CONFIG_SYS_" part?...
Review
Quoted 2 lines
(quoted diff) +1
-1- out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); + out_be32(&im->mddrc.ddr_command, DDR_NOP);For example this rename - using "
DDR_NOP" for a configurable parameter in a global file, and having to #define this in the board config files makes no sense to me.We have standard rule about naming of configration options. This here is clearly a case where "
CONFIG_SYS_" applies.All the other renames fall in the same category.
Unless you have a very good reason for this rename I tend to NAK this.
Best regards,
Wolfgang Denk
--
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 Drawing on my fine command of language, I said nothing.
PATCH 1/1 Rename CONFIG_SYS_MDDRC memory constants for all mpc512x boards
Dear "Martha J Marx",
Quoted 6 lines · In message <200909101515289.SM07320@cw4mb41> you wrote:
I know this was a while ago ... but when I first posted the Elpida patch you asked me to FIX the my memory constant changes. At that time you said the following
Quoted 1 line
Quoted 8 lines
Quoted 4 lines
While performing such a global rename, please let's get rid of the
CONFIG_SYS_names. These are NOT options that can be changed by the user in the board config file, so they should not look like such.This is when I tried to change some constants because they had "MICRON" in there. I decided to take out MICRON since they are being shared by both ELPIDA and MICRON.
I remember. I was wrong. By then, the MPC5121ADS was the only MPC512x board, and the changes were to board/ads5121/ads5121.c (and include/configs/ads5121.h). We (well, especially I) assumed that this was strictly board-specific code.
But since then, a number of other MPC512x boards have been added, and in this process it turned out that this is actually common code, which can be used unchanged by all boards. So it was moved from "private" to "public". Also it became clear that the values to insert here are no magic constants, but board-specific configuration options, and for these the name should be CONFIG_SYS_*.
Quoted 2 lines
How bout I just make a whole new set of constants for ELPIDA ??? and Leave the "MICRON" ones the way they stand ?
I think all such renaming doesn't bring us forward.
Looking at the code it seems we have just a list of constants that need to get written all to the same mddrc.ddr_command register. To make this configurable, we should probably not try to add more such stuff, but separate code and data to simplify the design.
I think we should turn the existing code:
/* Initialize DDR */ for (i = 0; i < 10; i++) out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_RFSH); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_RFSH); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_INIT_DEV_OP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EM2); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EM2); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EM3); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EN_DLL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_INIT_DEV_OP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_RFSH); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_INIT_DEV_OP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_OCD_DEFAULT); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP);
into something like this:
u32 micron_table[] = {
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_RFSH,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_RFSH,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_INIT_DEV_OP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_EM2,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_EM2,
CONFIG_SYS_MICRON_EM3,
CONFIG_SYS_MICRON_EN_DLL,
CONFIG_SYS_MICRON_INIT_DEV_OP,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_RFSH,
CONFIG_SYS_MICRON_INIT_DEV_OP,
CONFIG_SYS_MICRON_OCD_DEFAULT,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_NOP,
};
...
long int fixed_sdram(u32 ram_table[], int table_size)
{
int i;
...
for (i=0; i<table_size; ++i)
out_be32(&im->mddrc.ddr_sys_config, ram_table[i])
...
}The board specific code would then be changed from
fixed_sdram()
into for example
fixed_sdram(micron_table,sizeof(micron_table)/sizeof(u32))
In board/freescale/mpc5121ads/mpc5121ads.c, you could provide an additional set of data (elpida_table[]), and then pass either of these to fixed_sdram().
What do you think?
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
The optimum committee has no members.
- Norman AugustinePATCH 1/1 Rename CONFIG_SYS_MDDRC memory constants for all mpc512x boards
Very Elegant Wolfgang - I like it ... I'll take a stab and I'll try not to tarnish it!
-M
Quoted 105 lines
Looking at the code it seems we have just a list of constants that need to get written all to the same mddrc.ddr_command register. To make this configurable, we should probably not try to add more such stuff, but separate code and data to simplify the design.
I think we should turn the existing code:
/* Initialize DDR */ for (i = 0; i < 10; i++) out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_RFSH); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_RFSH); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_INIT_DEV_OP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EM2); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EM2); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EM3); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_EN_DLL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_INIT_DEV_OP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_RFSH); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_INIT_DEV_OP); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_OCD_DEFAULT); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_PCHG_ALL); out_be32(&im->mddrc.ddr_command, CONFIG_SYS_MICRON_NOP);into something like this:
u32 micron_table[] = {
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_RFSH,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_RFSH,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_INIT_DEV_OP,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_EM2,
CONFIG_SYS_MICRON_NOP,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_EM2,
CONFIG_SYS_MICRON_EM3,
CONFIG_SYS_MICRON_EN_DLL,
CONFIG_SYS_MICRON_INIT_DEV_OP,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_RFSH,
CONFIG_SYS_MICRON_INIT_DEV_OP,
CONFIG_SYS_MICRON_OCD_DEFAULT,
CONFIG_SYS_MICRON_PCHG_ALL,
CONFIG_SYS_MICRON_NOP,
};
...long int
fixed_sdram(u32 ram_table[], int table_size){ int i; ... for (i=0; i<table_size; ++i) out_be32(&im->mddrc.ddr_sys_config, ram_table[i]) ... }The board specific code would then be changed from
fixed_sdram()into for example
fixed_sdram(micron_table,sizeof(micron_table)/sizeof(u32))
In
board/freescale/mpc5121ads/mpc5121ads.c, you could provide an additional set of data (elpida_table[]), and then pass either of these tofixed_sdram().What do you think?
Best regards,
Wolfgang Denk
--
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 The optimum committee has no members.
- Norman Augustine