[U-Boot] [RFC PATCH 2/2] i.MX28: use a clear name for DDR2 initialization
Otavio Salvador
otavio at ossystems.com.br
Tue Jul 17 14:16:39 CEST 2012
On Tue, Jul 17, 2012 at 6:15 AM, Stefano Babic <sbabic at denx.de> wrote:
> Simply a general remark - I think we can discuss further when first
> patches for MX23 will be submitted. However, I think is a bad idea to
> specialize functions to a specific SOC. If a driver needs such as
> function, we will introduce some nasty #ifdef in driver code only to
> select which function must be called. And we duplicate this problem in
> all drivers.
>
> Instead of that, we could use the same general name. Where do we put
> mx23 code ? If we put it together with mx28 code (I mean in the same
> directory) we could extract specific SOC function from general files and
> use the mechanism provided by Makefile to compile the right one, for
> example:
>
> COBJS-$(CONFIG_MX28) += spl_mem_mx28.o
> COBJS-$(CONFIG_MX23) += spl_mem_mx23.o
>
> and spl_mem_init.c contains general code. Drivers call always the same
> function. Of course, this is only an example. At the moment, most mx28
> function have the mx28_ prefix, but this is acceptable because up now
> the mx28 is the only one in this architecture.
Agreed; I will check my current work in progress code and rework it
this way. However this prefix change is highly desired as it is
callmed m28 (looking as m28evk specific) instead of mx28.
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
More information about the U-Boot
mailing list