Skip to contentSkip to conversation

powerpc/mpc8xxx: Fix ddr build error

PATCH New Becky Bruce 3 participants 5 messages Oct 3, 2011 – Oct 4, 2011 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix ddr build error

Commit ID 60ce53cf9f40

"GCC4.6: Convert various empty macros to inline functions"

changed the "debug" macro to an inline function. This causes the mpc8xxx ddr code to stop building because there is a debug() statement that references symbols that only exist when DEBUG is defined. This patch makes those symbols unconditional.

---
 arch/powerpc/cpu/mpc8xxx/ddr/main.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/main.c +0 -2
index 249fd7d..eb70535 100644
@@ -132,7 +132,6 @@ void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
  *				|  interleaving
  */
 
-#ifdef DEBUG
 const char *step_string_tbl[] = {
 	"STEP_GET_SPD",
 	"STEP_COMPUTE_DIMM_PARMS",
@@ -153,7 +152,6 @@ const char * step_to_string(unsigned int step) {
 
 	return step_string_tbl[s];
 }
-#endif
 
 int step_assign_addresses(fsl_ddr_info_t *pinfo,
 			  unsigned int dbw_cap_adj[],
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix ddr build error

arch/powerpc/cpu/mpc8xxx/ddr/main.c const char * step_to_string(unsigned int step) { · line 156

Quoted 9 lines · Becky Bruce

-#ifdef DEBUG
?const char *step_string_tbl[] = {
? ? ? ?"STEP_GET_SPD",
? ? ? ?"STEP_COMPUTE_DIMM_PARMS",

arch/powerpc/cpu/mpc8xxx/ddr/main.c +0 -1
@@ -153,7 +152,6 @@ const char * step_to_string(unsigned int step) {
 
 ? ? ? ?return step_string_tbl[s];
 ?}
-#endif

How big is this array? It looks like it's going to add a bunch of data to the u-boot image that will typically never be used, since DEBUG is usually not defined.

There should be an easy way to keep this array defined only when DEBUG is defined.

Quoted 2 lines
(quoted diff) +0 -1
--

1.5.6.5

Your version of git is outdated, BTW.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#2 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix ddr build error

Quoted 16 lines · On Oct 3, 2011, at 8:40 PM, Tabi Timur-B04825 wrote:

arch/powerpc/cpu/mpc8xxx/ddr/main.c const char * step_to_string(unsigned int step) { · line 156

Quoted 9 lines · Becky Bruce
arch/powerpc/cpu/mpc8xxx/ddr/main.c +0 -2
-#ifdef DEBUG
 const char *step_string_tbl[] = {
       "STEP_GET_SPD",
       "STEP_COMPUTE_DIMM_PARMS",
@@ -153,7 +152,6 @@ const char * step_to_string(unsigned int step) {
 
       return step_string_tbl[s];
 }
-#endif

How big is this array? It looks like it's going to add a bunch of data to the u-boot image that will typically never be used, since DEBUG is usually not defined.

Quoted 2 lines

There should be an easy way to keep this array defined only when DEBUG is defined.

It's got like 7 or 8 members so it's not that big and the code that gets enabled is < 5 lines. I thought about just yanking out the debug() that uses this stuff but assumed somebody actually needed it.

Feel free to publish a different patch if you want a different fix.

-B

#3 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix ddr build error

In reply to Becky Bruce
Quoted 10 lines

Commit ID 60ce53cf9f40

"GCC4.6: Convert various empty macros to inline functions"

changed the "debug" macro to an inline function.? This causes the mpc8xxx ddr code to stop building because there is a debug() statement that references symbols that only exist when DEBUG is defined.? This patch makes those symbols unconditional.

NAK. This approach increases code size. The patch you mentioned is going to be reverted until fixed.

Better fix is welcome though!

Cheers

Quoted 28 lines

---
? arch/powerpc/cpu/mpc8xxx/ddr/main.c |? ? ? 2 -- ? 1 files changed, 0 insertions(+), 2 deletions(-)

(quoted diff) +0 -0

b/arch/powerpc/cpu/mpc8xxx/ddr/main.c index 249fd7d..eb70535 100644

arch/powerpc/cpu/mpc8xxx/ddr/main.c +0 -0
@@ -132,7 +132,6 @@ void fsl_ddr_get_spd(generic_spd_eeprom_t
 *ctrl_dimms_spd,?  *??? ??? ??? ??? |?  interleaving

? ? */
?
-#ifdef DEBUG

?  const char *step_string_tbl[] = {
?  ??? "STEP_GET_SPD",
?  ??? "STEP_COMPUTE_DIMM_PARMS",
arch/powerpc/cpu/mpc8xxx/ddr/main.c +0 -0
@@ -153,7 +152,6 @@ const char * step_to_string(unsigned int step) {

?
? ??? return step_string_tbl[s];
? }
-#endif
?
? int step_assign_addresses(fsl_ddr_info_t *pinfo, ? ??? ??? ??? ? unsigned int dbw_cap_adj[],

Signature · 1 line
1.5.6.5
#4 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix ddr build error

Quoted 9 lines · Marek Vasut
Quoted 9 lines

Commit ID 60ce53cf9f40

"GCC4.6: Convert various empty macros to inline functions"

changed the "debug" macro to an inline function. This causes
the mpc8xxx ddr code to stop building because there is a debug() statement that references symbols that only exist when DEBUG is
defined. This patch makes those symbols unconditional.

Quoted 5 lines
Quoted 1 line

NAK. This approach increases code size. The patch you mentioned is going to be reverted until fixed.

Better fix is welcome though!

Like I said to Timur, I just need stuff to build, and this increases code size only a tiny bit..... I'd prefer the revert, though.

-B

Quoted 31 lines

Cheers

Quoted 28 lines
---
   arch/powerpc/cpu/mpc8xxx/ddr/main.c |       2 --
   1 files changed, 0 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/arch/powerpc/cpu/mpc8xxx/ddr/main.c index 249fd7d..eb70535 100644

arch/powerpc/cpu/mpc8xxx/ddr/main.c +0 -2
@@ -132,7 +132,6 @@ void fsl_ddr_get_spd(generic_spd_eeprom_t
 *ctrl_dimms_spd,   *                |   interleaving
     */
 
-#ifdef DEBUG
   const char *step_string_tbl[] = {
       "STEP_GET_SPD",
       "STEP_COMPUTE_DIMM_PARMS",
@@ -153,7 +152,6 @@ const char * step_to_string(unsigned int step) {
 
       return step_string_tbl[s];
   }
-#endif
 
   int step_assign_addresses(fsl_ddr_info_t *pinfo,
                  unsigned int dbw_cap_adj[],
Signature · 1 line
1.5.6.5