[U-Boot] NS16550 Register structure

Pedanekar, Hemant
2010-01-05T08:55:42Z

Wolfgang,

Yes, that is not just word-aligned, instead, the Dm6467 UART access need to be "Word LOAD/STORE". Thus, if I use STRB <THR> instead of STR <THR> to transmit a character, it doesn't work.

As you said, using prepad/postpad, we can define the alignment but my understanding is that the final register access will be byte access only as the register will be declared as "unsigned char".

For generating 32-bit load/store, probably we need to declare register members as "unsigned long". Or can we achieve the same without any code changes?

Thanks
-
Hemant

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de]
> Sent: Tuesday, January 05, 2010 1:05 PM
> To: Pedanekar, Hemant
> Cc: u-boot at lists.denx.de; dzu at denx.de
> Subject: Re: [U-Boot] NS16550 Register structure
>
> Dear "Pedanekar, Hemant",
>
> In message <2A3DCF3DA181AD40BDE86A3150B27B6B03094B2982@dbde02.ent.ti.com>
> you wrote:
> >
> > I have observed that in the recent commit (file include/ns16550.h), the
> ns16550 UART register structure declaration is changed so that
> irrespective of the CONFIG_SYS_NS16550_REG_SIZE setting the register
> access will be done at byte level.
>
> This seems to be working on all systems so far, which is not so much
> of a surprise as the registers are 8 bit wide only.
>
> > This crates problem when UART space access is required to be word-
> aligned. I am particularly referring to DaVinci DM6467, where STRB over
> UART register space is not supported and requires 32-bit access (L/STR).
>
> Please make sure to use exact terms. Alignment is one thing, and bus
> width is another one. Alignment can be easily adjusted using the
> prepad_* or postpad_* settings.
>
> > If I go ahead and add a specific handling in ns16550.h file (structure
> register members as "long"), I would end up making code similar to the one
> earlier to last commit. Is there a better way to handle such case?
>
> No such changes should be needed, as far as I understand the code.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> In theory, there is no difference between theory and practice. In
> practice, however, there is.