On Mon, May 04, 2015 at 11:04:25AM -0700, Andrey Smirnov wrote: > > Please add a imx6_ namespace to this function. The calling code always > > knows that it is running on imx6, so you can use IMX6_CCM_BASE_ADDR > > directly rather than using soc##_. The function above is imx6 specific > > anyway since only this SoC has the gate registers on 0x68..0x80. > > What about i.MX51? As far as I can tell it is the same as i.MX6 in > this aspect. This function wouldn't have any consumers on i.MX51 > architecture, of course, but shouldn't this function have a SoC > variant agnostic name, just for the sake of genericity?
On i.MX1/21/25/27/31/35 the function would look different, so when trying to create a generic function we would need to decide which SoC we are on. cpu_is_imxxy() doesn't work at that place because it needs initialisation. #ifdefs do not work because we may have multiple SoC supports compiled in. Even if we could decide which SoC we are on, we still need a cascade of if() or #ifdef. Since the caller already knows the SoC type it's easiest to create SoC specific functions. If i.MX51 (and i.MX53 probably aswell) is the same as i.MX6 the i.MX6 function could simply call the i.MX5 function. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox