From: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] include/ns16550.h: Unify structure declaration for registers
Date: Sat, 25 Apr 2009 10:21:01 +0900 [thread overview]
Message-ID: <49F2657D.5080706@ruby.dti.ne.jp> (raw)
In-Reply-To: <1238769946-30370-1-git-send-email-dzu@denx.de>
Detlev-san,
Detlev Zundel wrote:
> Instead of special casing the different access patterns, use common
> code with light macros sprinkled in to accomodate for the different
> layouts of the register structure.
>
> Note that this also changes the types of the registers for the
> "positively packed (>1)" cases. As the registers truly are unsigned
> chars, this is surely the Right Thing, but it is a semantic change.
> Note that for this case depending on the endianness on the bus, we may
> see a change of behaviour.
>
> Signed-off-by: Detlev Zundel <dzu@denx.de>
> ---
> include/ns16550.h | 130 +++++++++++++++--------------------------------------
> 1 files changed, 37 insertions(+), 93 deletions(-)
>
>
> Note, that I checked that the offsets are ok in the used cases
> switching from the old to the new code. They *do* shift however in
> the positive packed cases, because the old code uses data types
> different than unsigned char. Note that doing this, I also noticed
> that using "unsigned long" for 4 byte registers is also no longer true
> on 64-bit architectures. One more reason to change the code.
>
> Apart from that the code was also compile tested on several
> configurations using different REG_SIZES and compiles without
> warnings. The special interesting case of +4 was successfully tested
> on CU824.
My hardware required 32-bit word access to NS16550 registers due to
byte-enable-lane reason (note that it's different from endian-ness).
I mean,
struct NS16550 {
unsigned char rbr;
unsigned char postpad_rbr[15];
:
:
};
if different from
struct NS16550 {
unsigned long rbr;
unsigned long postpad_rbr[3];
:
:
};
, at least for my hardware.
How do I supposed to configure UART in my board config file?
Shinya
next prev parent reply other threads:[~2009-04-25 1:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-03 14:45 [U-Boot] [PATCH] include/ns16550.h: Unify structure declaration for registers Detlev Zundel
2009-04-03 14:55 ` Detlev Zundel
2009-04-03 23:24 ` Wolfgang Denk
2009-04-25 1:21 ` Shinya Kuribayashi [this message]
2009-04-27 13:41 ` Detlev Zundel
2009-04-27 14:26 ` Shinya Kuribayashi
2009-04-27 15:36 ` Detlev Zundel
2009-04-27 16:09 ` Detlev Zundel
2009-04-29 18:51 ` Shinya Kuribayashi
2009-04-29 19:12 ` Shinya Kuribayashi
2009-04-30 13:30 ` Detlev Zundel
2009-04-30 14:10 ` Detlev Zundel
2009-05-01 0:56 ` Shinya Kuribayashi
2009-05-01 5:29 ` Shinya Kuribayashi
2009-04-30 12:26 ` Detlev Zundel
2009-04-30 12:52 ` Jerry Van Baren
2009-04-30 14:08 ` Detlev Zundel
2009-04-30 14:38 ` Detlev Zundel
2009-04-30 17:06 ` Jerry Van Baren
2009-05-01 2:21 ` Shinya Kuribayashi
2009-05-01 1:59 ` Shinya Kuribayashi
2009-05-04 15:40 ` Detlev Zundel
2009-05-04 21:21 ` Scott Wood
2009-05-04 21:57 ` Wolfgang Denk
2009-05-05 1:36 ` Shinya Kuribayashi
2009-05-05 9:09 ` Detlev Zundel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49F2657D.5080706@ruby.dti.ne.jp \
--to=skuribay@ruby.dti.ne.jp \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox