[PATCH 2/5] omap: Use inituart to configure the debug serial port based on machine ID

Tony Lindgren tony at atomide.com
Fri Feb 4 11:49:36 EST 2011


* Grazvydas Ignotas <notasas at gmail.com> [110204 04:03]:
> On Fri, Feb 4, 2011 at 3:27 AM, Tony Lindgren <tony at atomide.com> wrote:
> > Set the debug serial port based on machine ID. Note that most
> > of the patch is just trivial checking for the machine ID.
> >
..
 
> This looks a bit wasteful not only because of repeated CMPs, but also
> LDRs are generating a large literal pool. Maybe something like that be
> better:
> 
>     adr     r0, uart3_machines
> 0:
>     ldrh    \v, [r0], #2
>     tst     \v, \v
>     beq     999f                    @ end of list
>     cmp     \id, \v
>     bne     0b
>     ldr     \v, =OMAP3_UART3_BASE
>     str     \v, [\a, #0]            @ save port phys addr
>     ldr     \v, =(OMAP3_UART3_BASE + OMAP2_L4_IO_OFFSET)
>     str     \v, [\a, #4]            @ save port virt addr
>     b       999f
> 
>     uart3_machines:
>     .short MACH_TYPE_CM_T35
>     .short MACH_TYPE_CM_T3517
>     ...
>     .short 0
> 
> of course this needs an extra register..

Hmm, addruart and busyuart are limited with registers, but
inituart may not be. I'll take a look if that can be done.

Regards,

Tony



More information about the linux-arm-kernel mailing list