Re: [PATCH 0/5] Clean up omap24xx.h symbolic constants

Tony Lindgren
2007-05-17T18:14:23Z

* Syed Mohammed, Khasim <x0khasim@ti.com> [070517 10:54]:
> Hi:
>
> IMHO, using of SDRC_BASE as well as CTRL_BASE, PRCM_BASE etc.,
> >> can lead to name collision, the names is not so unique as may
> >> seem. I suggest using of OMAP_ prefix for these names.
> >
> >Good point. We could use OMAP_ prefix and in case of conflicts
> >with omap1 defines, we could rename them to have OMAP1_ prefix.
> >
>
> When we started with 3430 developments we had similar issues. Our approach was,
>
> OMAP3_prefix : If the Macro is defined and valid for 3430 only
> OMAP2_prefix : If its valid only for OMAP2
> OMAP242x_prefix : for 2420 specific
> OMAP243x_prefix : for 2430 specific
> OMAP1_prefix : for all OMAP1 platforms, but we didn't change any, thinking it might break previous programs.
> OMAP_prefix : Generic for all OMAP platforms.
>
> It's better if we follow some kind of standard and pass it as a review comment for any patches from now on.

Maybe just use OMAP2_ prefix for defines common to all omaps >= 2
until we have have to rename some registers again?

Anybody have better ideas?

> Other alternative is to use Peripheral version in OMAP. Example:
>
> OMAP1 has DMA version 3
> OMAP2 has DMA version 4
> OMAP3 has DMA version 4
>
> So define a macro for DMA as
>
> OMAP_DMA3_yyyyyy : for all OMAPs where DMA version 3 is used (like OMAPV1030, OMAP1710, OMAP1610, etc)
>
> OMAP_DMA4_yyyyyy : for all OMAPs where DMA version 4 is used (like OMAP3430 2430 2420, etc).
>
> Similar thing can be adopted for SPI, McBSP, I2C, and other peripherals of OMAP.

Yeah this should be used where possible to keep the drivers working.
I think omap I2C driver is already doing it.

Regards,

Tony