From: Yuli Barcohen Date: Wed, 17 Mar 2004 13:46:33 +0200 Subject: [U-Boot-Users] Re: Patch: Support for PQ27e (8247/48/71/72) chips and MPC8272ADS board In-Reply-To: <20040315133721.CF29FC0655@atlas.denx.de> References: <16469.44734.573362.958637@gargle.gargle.HOWL> <20040315133721.CF29FC0655@atlas.denx.de> Message-ID: <16472.15001.340060.100485@gargle.gargle.HOWL> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de >>>>> Wolfgang Denk writes: Yuli> This would require that, for every PQ27e-based board, it would Yuli> be defined in the board configuration file that it's PQ27e and Yuli> not just Yuli> 8260. Then CPM_DATAONLY_SIZE can be defined conditionally on Yuli> this definition in cpm_8260.h. I personally don't like such Yuli> compile-time definitions because chip version can be easily Yuli> detected in run-time. Wolfgang> The advantage of compile-time definitions is that they Wolfgang> result in smaller code. Of course, but here we're speaking about couple of `if's. Wolfgang> PQ27E_FCC_SPECIAL_BASE vs. CPM_FCC_SPECIAL_BASE ... Yuli> Well, the question is if it's better that the CPU-specific Yuli> code will silently handle the differences or we'll make it the Yuli> user's responsibility to define the difference manually. I Yuli> think automatic handling is better but if you insist on Yuli> #ifdefs, I can implement it too. Wolfgang> Sorry, but I can't follow. Wolfgang> From what I have seen your patches used _two_ #defines Wolfgang> instead of one. Well, my explanations can be confusing... I'll try to explain it differently. You're right, there are two #defines in one common file and it's all what needed for PQ27e support. If you prefer the compile-time solution, this means that: new CPU type is to be defined (CONFIG_MPC8272 or something like this) in addition to CONFIG_MPC8260, this type must be used for every PQ27e based board instead of CONFIG_MPC8260, and in a common file it must be defined that CONFIG_MPC8272 is a flavour of CONFIG_MPC8260 otherwise the common MPC8260 code won't work for PQ27e. IMHO this means much more work and more possibilities to make a mistake, especially when porting U-Boot to a new board, but you're the maintainer so make your choice. -- ======================================================================== Yuli Barcohen | Phone +972-9-765-1788 | Software Project Leader yuli at arabellasw.com | Fax +972-9-765-7494 | Arabella Software, Israel ========================================================================