"Nori, Sekhar" <[email protected]> writes: > 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.
Actually, we don't need bootloader support for this. On OMAP, we do this in the uncompress code. See: arch/arm/plat-omap/include/plat/uncompress.h, and in this commit[1] for details. Rather than continuing to hack the current hack, I'd like to see something similar on DaVinci. This will also remove one more barrier to multiple-SoC support. Also, we don't necessarily have to use the UART1 scratchpad register. All we need is some temporary, writable register that is available on all supported SoCs. Any suggestions? Kevin [1] commit 0c8219f0302d0d27fda52c790d38406801e547ec Author: Tony Lindgren <[email protected]> Date: Mon Feb 15 08:49:01 2010 -0800 omap: Make uncompress code and DEBUG_LL code generic Define arch_decomp_setup() the same way as some other architectures do. Use arch_id to configure the debug uart based on the machine_is by storing it into the uart scratchpad register for DEBUG_LL code to use. Signed-off-by: Tony Lindgren <[email protected]> _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
