From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Gurevich Date: Mon, 03 Apr 2006 13:51:05 -0700 Subject: [U-Boot-Users] [PATCH] SPI relocation fix In-Reply-To: <20060403201825.0EE49353C10@atlas.denx.de> References: <20060403201825.0EE49353C10@atlas.denx.de> Message-ID: <44318AB9.2070209@paulidav.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Wolfgang, Wolfgang Denk wrote: >Please don't call empty functions if you can avoid it. It adds to the >code size, and makes understanding the code much harder. > > 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 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). 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. Regards, Vladimir