public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] serial: ns16550: fix different reg size access
Date: Fri, 01 Apr 2011 09:39:22 +0200	[thread overview]
Message-ID: <20110401073922.5A7ECF0320A@gemini.denx.de> (raw)
In-Reply-To: <AANLkTindN8kSqiq28H68Rs77Dc6Pf-4MSTibAq_2dRaV@mail.gmail.com>

Dear Lei Wen,

In message <AANLkTindN8kSqiq28H68Rs77Dc6Pf-4MSTibAq_2dRaV@mail.gmail.com> you wrote:
> 
> > This makes no sense to me. I have never seen any 9 bit registers in
> > any processor I ever encountered in real life.
> 
> I don't mean that register is 9bit...
> I means that register, IER, is 32bit long, but 9-31th bit is reserved, and
> 0th to 8th bit is used... Maybe I don't say clearly...
> So byte access would only cover 0-7th bit, while 8th bit is not covered.
> 
> > Also, in this case the serial controller is probably not NS16550
> > compatible, because AFAICT the NS16550 uses only 8 bit wide
> > registers.
> 
> This is may be additional feature added. For another part except this
> one bit is all compatible with ns16550.

OK, so let's summarize the facts we found so far:

1. Your hardware is NOT NS16550 compatible.  It does not have the
   typical 8 bit register interface, but provides additional bits that
   somehow control non-standard functionality.

2. You say there is one additional bit (bit 9, i. e. 0x00000100) which
   must remain set to 1 which appears to be the default setting after
   power-on reset.

3. You say that the current implementation, which uses a writeb() call
   (i. e. a byte write operation) to this register would not only
   affect bits 0...7, as expected, but also clear bit 9.

   This seems somewhat unlikely to me, so please confirm that I
   understood correctly.

4. You say that writing a 32 bit value instead (i. e. using writel())
   would work for you.

   This seems also unlikely to me, as the driver just operates on 8
   bit data, and will insert only 8 bit data into the word written, so
   you will write some data word like 0x000000XX - and in this case
   (and only in this case) the 9th bit would explicitly be set to 0.

So from my understanding of the code the original version is supposed
to work on your hardware, while your patched version should definitely
NOT work.

Yet you state it's exactly vice versa.

Either I'm missing something, or you fail to provide complete
information.

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
Space is big. You just won't believe how vastly, hugely, mind-
bogglingly big it is. I mean, you may think it's a long way down the
road to the drug store, but that's just peanuts to space.
                              -- The Hitchhiker's Guide to the Galaxy

  reply	other threads:[~2011-04-01  7:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 15:52 [U-Boot] [PATCH] serial: ns16550: fix different reg size access Lei Wen
2011-03-31 15:58 ` Wolfgang Denk
2011-04-01  5:24   ` Lei Wen
2011-04-01  5:35     ` Wolfgang Denk
2011-04-01  5:39       ` Lei Wen
2011-04-01  7:39         ` Wolfgang Denk [this message]
2011-04-01  7:59           ` Lei Wen
2011-04-01 10:25             ` Wolfgang Denk
2011-04-01 12:03               ` Lei Wen
2011-04-01 12:41                 ` Wolfgang Denk
2011-04-01 13:07                   ` Lei Wen
2011-04-01 13:55                     ` Wolfgang Denk
2011-04-01 13:58                       ` Lei Wen
2011-04-01 14:25                         ` Wolfgang Denk
2011-04-01 14:34                           ` Lei Wen
2011-04-01 17:45                             ` Wolfgang Denk
2011-04-01 18:59                             ` Prafulla Wadaskar
2011-04-01 19:04                               ` Wolfgang Denk

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=20110401073922.5A7ECF0320A@gemini.denx.de \
    --to=wd@denx.de \
    --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