Skip to contentSkip to conversation

ppc4xx: Remove duplicated code for Sequoia NAND booting version

PATCH New Stefan Roese 2 participants 5 messages Apr 15, 2009 – Apr 16, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc4xx: Remove duplicated code for Sequoia NAND booting version

---
 board/amcc/sequoia/sdram.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
board/amcc/sequoia/sdram.c +1 -5
index c26e6ee..6df4c6d 100644
@@ -44,7 +44,7 @@ extern void denali_core_search_data_eye(void);
  * for the 4k NAND boot image so define bus_frequency to 133MHz here
  * which is save for the refresh counter setup.
  */
-#define get_bus_freq(val)	133000000
+#define get_bus_freq(val)	133333333
 #endif
 
 /*************************************************************************
@@ -55,11 +55,7 @@ extern void denali_core_search_data_eye(void);
 phys_size_t initdram (int board_type)
 {
 #if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
-#if !defined(CONFIG_NAND_SPL)
 	ulong speed = get_bus_freq(0);
-#else
-	ulong speed = 133333333;	/* 133MHz is on the safe side	*/
-#endif
 
 	mtsdram(DDR0_02, 0x00000000);
 
Signature · 1 line
1.6.2.3
#1 lore raw

PATCH 1/1 ppc4xx: Remove duplicated code for Sequoia NAND booting version

Dear Stefan Roese,

Quoted 10 lines · In message <[email protected]> you wrote:
---
 board/amcc/sequoia/sdram.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
board/amcc/sequoia/sdram.c +0 -0
index c26e6ee..6df4c6d 100644

board/amcc/sequoia/sdram.c extern void denali_core_search_data_eye(void); · line 48

Quoted 6 lines
board/amcc/sequoia/sdram.c +1 -1
@@ -44,7 +44,7 @@ extern void denali_core_search_data_eye(void);
  * for the 4k NAND boot image so define bus_frequency to 133MHz here
  * which is save for the refresh counter setup.
  */
-#define get_bus_freq(val)	133000000
+#define get_bus_freq(val)	133333333
 #endif

To me that does not look exactly like duplicated code removal...

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
It's a small world, but I wouldn't want to paint it.
#2 lore raw

PATCH 1/1 ppc4xx: Remove duplicated code for Sequoia NAND booting version

Hi Wolfgang,

Quoted 10 lines · Wolfgang Denk

board/amcc/sequoia/sdram.c extern void denali_core_search_data_eye(void); · line 48

Quoted 8 lines

+++ b/board/amcc/sequoia/sdram.c

board/amcc/sequoia/sdram.c +1 -1
@@ -44,7 +44,7 @@ extern void denali_core_search_data_eye(void);
  * for the 4k NAND boot image so define bus_frequency to 133MHz here
  * which is save for the refresh counter setup.
  */
-#define get_bus_freq(val)	133000000
+#define get_bus_freq(val)	133333333
 #endif

To me that does not look exactly like duplicated code removal...

Here a closer look at the patch:

-#define get_bus_freq(val) 133000000
+#define get_bus_freq(val) 133333333
#endif

/*************************************************************************
@@ -55,11 +55,7 @@ extern void denali_core_search_data_eye(void);
phys_size_t initdram (int board_type)
{
#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
-#if !defined(CONFIG_NAND_SPL)
ulong speed = get_bus_freq(0);
-#else
- ulong speed = 133333333; /* 133MHz is on the safe side */
-#endif

As you can see, the top patch part changes the define of get_bus_frequency() to 133333333. This define was only enabled (via ifdef) for the CONFIG_NAND_SPL part:

#if defined(CONFIG_NAND_SPL)
/* Using cpu/ppc4xx/speed.c to calculate the bus frequency is too big
* for the 4k NAND boot image so define bus_frequency to 133MHz here
* which is save for the refresh counter setup.
*/
#define get_bus_freq(val) 133333333
#endif

And now the 2nd patch part makes sure that this define is really used.

So what the patch does is to remove an unused code part. Is this what you are complaining about? If really needed I could resend this patch with a modified patch subject.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#3 lore raw

PATCH 1/1 ppc4xx: Remove duplicated code for Sequoia NAND booting version

Dear Stefan Roese,

Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 6 lines

board/amcc/sequoia/sdram.c extern void denali_core_search_data_eye(void); · line 48

Quoted 4 lines
board/amcc/sequoia/sdram.c +1 -1
-#define get_bus_freq(val)	133000000
+#define get_bus_freq(val)	133333333
 #endif

To me that does not look exactly like duplicated code removal...

...

Quoted 3 lines

So what the patch does is to remove an unused code part. Is this what you are complaining about? If really needed I could resend this patch with a modified patch subject.

No, I complain that you also change a vital costant without even mentioning.

Normally, this should be split into two separate patches., but at least it should be stated in the commit message.

Best regards,

Wolfgang Denk

Signature · 6 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
What can it profit a man to gain the whole world and to come  to  his
property with a gastric ulcer, a blown prostate, and bifocals?
                                     -- John Steinbeck, _Cannery Row_
#4 lore raw

PATCH 1/1 ppc4xx: Remove duplicated code for Sequoia NAND booting version

Quoted 6 lines · Wolfgang Denk
Quoted 3 lines

So what the patch does is to remove an unused code part. Is this what you are complaining about? If really needed I could resend this patch with a modified patch subject.

No, I complain that you also change a vital costant without even mentioning.

The constant was not used at all (as I mentioned in my last mail). So changing it to the really used value seems logical to me.

Quoted 2 lines

Normally, this should be split into two separate patches., but at least it should be stated in the commit message.

I'll resend the patch with a changed commit text later.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================