[U-Boot-Users] [PATCH] SPI relocation fix

Wolfgang Denk wd at denx.de
Mon Apr 3 23:36:03 CEST 2006


Dear Vladimir,

in message <44318AB9.2070209 at paulidav.org> you wrote:
> 
> No problem. I can easily #ifdef the call to UcodeCopy rather than the 
> body itself, since it's predicated on the need for the patch. But 
> cpm_load_patch() should still has to be called unconditionally and if no 

Ummm... why would I want to call this function if I don't need it?

> relocation is required at all, it will be empty. This is a small price 
> to pay for the ability to handle different cases automatically without 
> the need to worry about whether a microcode patch is actually needed 
> (because depending on the CPU and actual settings there might be no 
> relocation or relocation with or without a patch).

Ummm... The function name "CPM load patch" suggests that it  is  used
to load a microcode patch. 

> I believe that we need some centralized code, because certain 
> combination of patches/devices do affect other devices (that's the 
> nature of microcode patches provided my Motorola) that might not really 
> be used by a certain board, but still have to be programmed correctly. 
> For example, the combined I2C/SPI/SMC relocation patch requires correct 
> rpbase settings on both SMC1 and SMC2 regardless of whether you plan to 
> use them or not.
> 
> Unfortunately, all these dependancies are a little difficult to express 
> via C preprocessor (at least not without making the configuration much 
> more complex and error prone). You can see that  the code in 
> mpc8xx_upatch.h got pretty complex on its own.

Then let's at least rename the function to have a name that says what
it's supposed to do.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The universe is all a spin-off of the Big Bang.




More information about the U-Boot mailing list