From: Shinya Kuribayashi <skuribay@pobox.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] include/ns16550.h: Unify structure declaration for registers
Date: Fri, 01 May 2009 09:56:08 +0900 [thread overview]
Message-ID: <49FA48A8.8030208@pobox.com> (raw)
In-Reply-To: <m2ws92clq3.fsf@ohwell.denx.de>
Hi,
Detlev Zundel wrote:
> Thinking about it some more, I wonder about the following. You said,
> this would work for you:
>
> struct NS16550 {
> unsigned long rbr;
> unsigned long postpad_rbr[3];
> ....
>
> while
>
> struct NS16550 {
> unsigned char rbr;
> unsigned char postpad_rbr[12];
15?
> ...
>
> doesn't. If we regard only the "significant" 8-bits, the first layout
> is congruent to the second shifted by 2 bytes (on big-endian machines).
I think you mean 'at offset 0x3', right?
My 16550 registers are like this:
0 1 2 3
+----+----+----+----+
0x00 | reserved |rbr |
+----+----+----+----+
0x04 | reserved |
+----+----+----+----+
0x08 | reserved |
+----+----+----+----+
0x0c | reserved |
+----+----+----+----+
0x10 | reserved |ier |
+----+----+----+----+
0x14 | reserved |
+----+----+----+----+
0x18 | reserved |
+----+----+----+----+
0x1c | reserved |
+----+----+----+----+
...
> So what about using +16 for your board and lower the base address by 2?
> Does that work? What is your base address? Is that 64-bit aligned?
With 64-bit (16 bytes) aligned base address, AND offset +0x3, AND
struct NS16550 configured by -16 (below)
struct NS16550 {
unsigned char rbr;
unsigned char postpad_rbr[15];
unsigned char ier;
unsigned char postpad_ier[15];
...
};
, then yes, I think this probably works for sane hardwares who can
handle byte read/write operations properly.
As for my hardware, however, this still doesn't work. My processor
(MIPS 4KEc) of couse supports byte read/write, on the other hand,
the address decoder at UART module can not handle byte addresses
properly; all byte read/write accesses with +1/+2/+3 offset, will
be round-down to +0. Therefore, I can take 'offset +0x3' option.
This is the reasony I said 'my hardware requires 32-bit word access
to NS16550 registers'.
> This is somewhat hypothetical and outright ugly, but I still want to
> know if this works.
I know the address decoder of my UART hardware sucks, but it's not
unusual.
I'll reply to remaining mails shortly.
Thanks,
Shinya
next prev parent reply other threads:[~2009-05-01 0:56 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
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 [this message]
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=49FA48A8.8030208@pobox.com \
--to=skuribay@pobox.com \
--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