[U-Boot] fls definition issue

Hu Mingkai-B21284 Mingkai.Hu at freescale.com
Thu Sep 17 13:47:58 CEST 2009


Hi all,
 
I run across an issue when startup the MPC8536DS board by using
the latest git tree. The system hanged when initialized the DDR.
 
U-Boot 2009.08-00197-g15fba32 (Sep 17 2009 - 18:15:50)
 
CPU:   8536E, Version: 1.1, (0x803f0091)
Core:  E500, Version: 3.0, (0x80210030)
Clock Configuration:
       CPU0:1499.985 MHz,
       CCB:499.995 MHz,
       DDR:333.330 MHz (666.660 MT/s data rate) (Asynchronous),
LBC:31.250 MHz
L1:    D-cache 32 kB enabled
       I-cache 32 kB enabled
Board: MPC8536DS Sys ID: 0x15, Sys Ver: 0x10, FPGA Ver: 0x13, vBank: 0
I2C:   ready
DRAM:  Initializing....ERROR
 2 GB left unmapped
    DDR:
 
I traced the code and found the variable law_sz_enc got an
error value when call __ilog2_u64 in the function set_ddr_laws.
 
The inline function __ilog2_u64 will call fls inline function
finally, but the fls is defined as a variable by the commit
52d61227b66d4099b39c8309ab37cb67ee09a405 in the platform specific
bitops.h file.
 
include/asm-ppc/bitops.h:
static __inline__ int fls(unsigned int x)
{
        return __ilog2(x) + 1;
}
#define fls

So when called fls, which one will be used?


More information about the U-Boot mailing list