[U-Boot] [PATCH v2] mpc86xx: set the DDR BATs after calculating true DDR size

Timur Tabi timur at freescale.com
Tue Mar 30 20:42:45 CEST 2010


Becky Bruce wrote:

> At the very least, fix this comment to mention the problem with not  
> being able to map all the RAM as well, if you're going to leave it  
> that way. 

Isn't that what the comment already says?  "region mapped by DBAT0" == "map all the RAM"?

> Can you test a board with a strange amount of RAM (1.5GB,  
> or something), and see what happens with this patch?  I really don't  
> like leaving things this way.

I'm pretty sure that U-Boot will machine check during relocation.  That's what the comment says.  I haven't tried it though.  I could probably set up bullwinkle later this week with 1.5GB and try it.

>> +#define TO_BATU_BL(x) \
>> +	(u32)((((1ull << __ilog2_u64((u64)x)) / (128 * 1024)) - 1) * 4)
> 
> It's a nit, but can we change the *4 to << 2 ?  I know most modern  
> compilers should optimize this, but I think it makes the code easier  
> to read and is logically more sensical, and if you've got to change  
> the patch, anyway, we might as well clean this up.

I used a spreadsheet to help me figure out the algorithm, so I wouldn't say that << 2 is more sensical, but I don't really care either way.  I don't see how it improves the readability, though.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list