[U-Boot-Users] variable type issues in LMB code

Becky Bruce becky.bruce at freescale.com
Mon Jul 7 17:50:00 CEST 2008


On Jul 5, 2008, at 5:32 PM, Wolfgang Denk wrote:

> Hello Andy & Becky & Kumar,
>
> there is a general problem of variable types with the  LMB  code;  at
> the moment, it uses some "u64" (and in lib_ppc/bootm.c actually a mix
> of  "u64"  and  "uint64_t")  declarations where I think we should use
> phys_addr_t resp. phys_size_t types  instead.  At  the  moment,  this
> results in lots of compiler messages:
>
> 	warning: cast from pointer to integer of different size
>
> Could you please have a look and try and clean up?
>
> Thanks in advance.

I see the following when I build for 8641HPCN on the latest tree:

bootm.c: In function ‘do_bootm_linux’:
bootm.c:208: warning: cast from pointer to integer of different size
bootm.c:215: warning: cast from pointer to integer of different size

It looks like these errors were introduced in the following 2 commits:

commit 41c5eaa7253ed82bbae1eda5667755872c615164
Author: Andy Fleming <afleming at freescale.com>
Date:   Mon Jun 16 13:58:56 2008 -0500

     Resize device tree to allow space for board changes and the  
chosen node

commit 63796c4e61b207d2e635729d41b7a7f7d188b03c
Author: Andy Fleming <afleming at freescale.com>
Date:   Mon Jun 16 13:58:54 2008 -0500

     Add lmb_free

Andy, please fix the build warnings, and change lmb_free to use  
phys_size_t/phys_addr_t as appropriate - let me know if you have  
questions about this.

Wolfgang, please let me know if there are other errors you're seeing  
on some other build config that I haven't addressed here, and I'll  
look into those.

FYI, one possible source of confusion here for folks who are used to  
the linux version of the lmb: when the lmb became generic instead of  
ppc-only, the linux folks decided to always use u64 for types in the  
lmb code.  This made some sense since ppc was the only platform using  
the lmb that used a smaller data type, and the other platforms lacked  
the concept of phys_addr_t.  We've done "the right thing" in u-boot  
and used phys_size/addr_t since most of the platforms are 32-bit, and  
using u64 unconditionally is a waste.

Cheers,
B





More information about the U-Boot mailing list