Skip to contentSkip to conversation

ARM926: compile cpu_init_crit function only if CONFIG_SKIP_LOWLEVEL_INIT is not defined

PATCH New Gururaja Hebbar K R 2 participants 2 messages Dec 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM926: compile cpu_init_crit function only if CONFIG_SKIP_LOWLEVEL_INIT is not defined

Hi,

At present in "start.S" inside cpu\arm926ejs, cpu_init_crit is called only if "CONFIG_SKIP_LOWLEVEL_INIT" is not defined

#ifndef CONFIG_SKIP_LOWLEVEL_INIT
bl cpu_init_crit
#endif

But "cpu_init_crit" function doesnt have any if defs which means cpu_init_crit function will compile irrespective of "CONFIG_SKIP_LOWLEVEL_INIT". Hence the patch. The same is done in other processor files. Kindly check "cpu\arm920t\start.S"

Regards

Gururaja

________________________________

From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wed 19-Dec-07 3:27 PM
To: Gururaja Hebbar K R
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] [PATCH] ARM926: compile cpu_init_crit function only if CONFIG_SKIP_LOWLEVEL_INIT is not defined

Quoted 29 lines · Hebbar

This patches allows cpu_init_crit function to be compilled only if CONFIG_SKIP_LOWLEVEL_INIT is not defined. At present irrespective of CONFIG_SKIP_LOWLEVEL_INIT, cpu_init_crit is always compilled. This is for arm926ejs module.

cpu/arm926ejs/start.S 2007-12-19 08:40:37.296875000 -0800 renamed from cpu/arm926ejs/start.S 2007-12-06 01:21:19.000000000 -0800 +4 -1
@@ -187,7 +187,7 @@ clbss_l:str       r2, [r0]                /* clear loop... 
 _start_armboot:
      .word start_armboot
 
-
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*
  *************************************************************************
  *
@@ -225,6 +225,9 @@ cpu_init_crit:
      bl      lowlevel_init   /* go setup pll,mux,memory */
      mov     lr, ip          /* restore link */
      mov     pc, lr          /* back to my caller */
+    
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
+    
 /*
  *************************************************************************
  *
Quoted 1 line

I welcome comments, complaints, suggestions and advices.

The reason for this is to decrease resulting binary size? If so, all lowlevel_init() should be encapsulated as well to save even more space?

Dirk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20071219/c56e5a54/attachment.htm

#1 lore raw

PATCH 1/1 ARM926: compile cpu_init_crit function only if CONFIG_SKIP_LOWLEVEL_INIT is not defined

Quoted 5 lines · Gururaja Hebbar K R

Hi,

At present in "start.S" inside cpu\arm926ejs, cpu_init_crit is called
only if "CONFIG_SKIP_LOWLEVEL_INIT" is not defined

Quoted 7 lines

#ifndef CONFIG_SKIP_LOWLEVEL_INIT
bl cpu_init_crit
#endif

But "cpu_init_crit" function doesnt have any if defs which means cpu_init_crit function will compile irrespective of "CONFIG_SKIP_LOWLEVEL_INIT".

Yes, thats clear.

Quoted 2 lines

Hence the patch. The same is done in other processor files. Kindly check "cpu\arm920t\start.S"

So the only reason that you do this is because its done in other files this way as well?

To not execute cpu_init_crit the existing ifndef is sufficent. But my point is: When you want to decrease resulting binary size by excluding unnecessary code (cpu_init_crit), then you should also exclude the then unused board specific lowlevel_init called from cpu_init_crit as well.

Dirk

Quoted 49 lines

------------------------------------------------------------------------
*From:* Dirk Behme [mailto:dirk.behme at googlemail.com] *Sent:* Wed 19-Dec-07 3:27 PM
*To:* Gururaja Hebbar K R
*Cc:* u-boot-users at lists.sourceforge.net
*Subject:* Re: [U-Boot-Users] [PATCH] ARM926: compile cpu_init_crit function only if CONFIG_SKIP_LOWLEVEL_INIT is not defined

Quoted 9 lines · Hebbar

This patches allows cpu_init_crit function to be compilled only if CONFIG_SKIP_LOWLEVEL_INIT is not defined. At present irrespective of CONFIG_SKIP_LOWLEVEL_INIT, cpu_init_crit is always compilled. This is for arm926ejs module.

--- u-boot-1.3.1/cpu/arm926ejs/start.S 2007-12-06

01:21:19.000000000 -0800

Review clbss_l:str r2, [r0] /*

Quoted 2 lines

+++ uboot/cpu/arm926ejs/start.S 2007-12-19 08:40:37.296875000 -0800

(quoted diff) +0 -0
@@ -187,7 +187,7 @@ clbss_l:str       r2, [r0]                /* 

clear loop...

Review clbss_l:str r2, [r0] /* · line 192

Quoted 7 lines
(quoted diff) +1 -1
 _start_armboot:
      .word start_armboot
 
-
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*
 

*************************************************************************

Review cpu_init_crit: · line 232

Quoted 10 lines
(quoted diff) +3 -0
  *
@@ -225,6 +225,9 @@ cpu_init_crit:
      bl      lowlevel_init   /* go setup pll,mux,memory */
      mov     lr, ip          /* restore link */
      mov     pc, lr          /* back to my caller */
+    
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
+    
 /*
 

*************************************************************************

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

I welcome comments, complaints, suggestions and advices.

The reason for this is to decrease resulting binary size? If so, all lowlevel_init() should be encapsulated as well to save even more space?

Dirk