[PATCH 3/3][POWERPC][V2] Xilinx: boot support for Xilinx uart 16550.

Grant Likely grant.likely at secretlab.ca
Thu Apr 3 12:16:29 EST 2008


On Wed, Apr 2, 2008 at 6:02 PM, David Gibson
<david at gibson.dropbear.id.au> wrote:
>
> On Wed, Apr 02, 2008 at 09:52:14AM -0700, John Linn wrote:
>  > The Xilinx 16550 uart core is not a standard 16550 because it uses
>  > word-based addressing rather than byte-based adressing. With
>  > additional properties it is compatible with the open firmware
>  > 'ns16550' compatible binding.
>  >
>  > This code updates the ns16550 driver to use the reg-offset property
>  > so that the Xilinx UART 16550 can be used with it. The reg-shift
>  > was already being handled.
>  >
>  > Signed-off-by: John Linn <john.linn at xilinx.com>
>  > ---
>  >  arch/powerpc/boot/ns16550.c |    5 +++++
>  >  1 files changed, 5 insertions(+), 0 deletions(-)
>  >
>  > diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
>  > index f8f1b2f..da9d2c2 100644
>  > --- a/arch/powerpc/boot/ns16550.c
>  > +++ b/arch/powerpc/boot/ns16550.c
>  > @@ -56,6 +56,7 @@ int ns16550_console_init(void *devp, struct serial_console_data *scdp)
>  >  {
>  >       int n;
>  >       unsigned long reg_phys;
>  > +     u32 reg_offset;
>  >
>  >       n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base));
>  >       if (n != sizeof(reg_base)) {
>  > @@ -65,6 +66,10 @@ int ns16550_console_init(void *devp, struct serial_console_data *scdp)
>  >               reg_base = (void *)reg_phys;
>  >       }
>  >
>  > +     n = getprop(devp, "reg-offset", &reg_offset, sizeof(reg_offset));
>  > +     if (n == sizeof(reg_offset))
>  > +             reg_base += reg_offset;
>
>  Uh... how does the behaviour of reg-offset differ from just bumping
>  the address in "reg"?

Mostly because the registers are actually 32 bit registers that can be
accessed with 32bit reads at offset 0.  Using this property keeps the
reg property describing the real address range.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list