On Thu, Mar 25, 2010 at 20:39:02, Chemparathy, Cyril wrote:
> Sergei,
>
> [...]
> > > > +#if defined(CONFIG_ARCH_DAVINCI_DMx)
> > > > +#define UART_PHYS      DAVINCI_UART0_BASE
> > > > +#define UART_VIRT      IO_ADDRESS(UART_PHYS)
> > > > +#endif
> > >
> > >    These UART addressed are machine-, not arch-specific.
> >
> > Thanks.  Will change in v2.
>
> On second thoughts, if we were to make these definitions machine specific, it 
> would explode into excruciating verbosity:
>
> #if     defined(CONFIG_MACH_DAVINCI_EVM)        || \
>         defined(CONFIG_MACH_SFFSDR)             || \
>         defined(CONFIG_MACH_NEUROS_OSD2)        || \
>         defined(CONFIG_MACH_DAVINCI_DM355_EVM)  || \
>         defined(CONFIG_MACH_DM355_LEOPARD)      || \
>         defined(CONFIG_MACH_DAVINCI_DM6467_EVM) || \
>         defined(CONFIG_MACH_DAVINCI_DM6467TEVM) || \
>         defined(CONFIG_MACH_DAVINCI_DM365_EVM)
>
> Is that the preferred approach?  Would we be better off leaving UART 
> selection arch-specific for now and making it machine-specific as and when a 
> new board deviates from the norm on that arch?
>

How about trying to do some runtime detection of the enabled
UART by checking the enabled status in PWREMU_MGMT register of
each UART starting from UART0. You would probably also need a
fall-back option that can be chosen by boards on which this is
guaranteed not to work (they can provide the debug UART# in kernel
configuration).

I quickly checked DM644x and OMAP-L138 documentation and both
of these have the register implemented and have the UART reset
by default.

OMAP2/3 seems to manage this by writing a pattern to the UART SCR
registers, but unfortunately none of the DaVinci bootloaders
support this.

Thanks,
Sekhar

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to