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 12:25:26 +0200	[thread overview]
Message-ID: <20110401102526.C1F09F03209@gemini.denx.de> (raw)
In-Reply-To: <AANLkTingSAd=sQH=QbmJjvOFjVbjsCbWH0SFFyKzVrs4@mail.gmail.com>

Dear Lei Wen,

In message <AANLkTingSAd=sQH=QbmJjvOFjVbjsCbWH0SFFyKzVrs4@mail.gmail.com> you wrote:
> 
> > 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.
> 
> That is not my case. In my case, for writeb, it would affect only
> bits0-7, but leave
> bit 8 untouched. However, I need the bit 8 to be set to be 0, which is
> 1 at the power
> on.
...
> Yes, that is what I want. The bit8 set to 0.

Ah.  But this is completely different thing, then.

Your code would only perform this operation by accident, and this is
definitely wrong.   Assume some other system where this bit needs to
be set to 1 - then your code would corrupt the setting.

So I think:

1) The current NS16550 driver behaves correctly.  It sets up the
   NS16550 compatible parts of your chip in the correct way, without
   messing with any non-standard bits.

2) If you have additional, non-standard bits in your device, you must
   initialize these separately.  Eventually you provide a custom
   driver which just calls the standard NS16550 driver functions,
   except where you have additional need to manipulate the extra,
   non-standard bits of your device.


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
For every complex problem, there is a solution that is simple,  neat,
and wrong.                                           -- H. L. Mencken

  reply	other threads:[~2011-04-01 10:25 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
2011-04-01  7:59           ` Lei Wen
2011-04-01 10:25             ` Wolfgang Denk [this message]
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=20110401102526.C1F09F03209@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