linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: "Stephan Linke" <Stephan.Linke@epygi.de>
Cc: "Linuxppc-Embedded" <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: parallel I/O ports & opend darin pins on MPC8xx
Date: Wed, 09 Jul 2003 12:24:09 +0200	[thread overview]
Message-ID: <20030709102414.2879CC6D82@atlas.denx.de> (raw)
In-Reply-To: Your message of "Wed, 09 Jul 2003 12:01:39 +0200." <FCEAKDJJAPHPLJFINDAJCEGCDEAA.Stephan.Linke@epygi.de>


Dear Stephan,

in message <FCEAKDJJAPHPLJFINDAJCEGCDEAA.Stephan.Linke@epygi.de> you wrote:
>
> There are two drivers, both are manualy manipulating bits at the same I/O port.
> Both drivers use the following mechanism to change the value of their pin: they
> read the value from the data register changeing the value and writing the result
> back to the data register (hopefully an atomic access). This works fine since
> for normal output pins you can read the output value and for input pins it's a
> don't care. As soon as one of the drivers use open drain pins something changes.

You must define for your driver(s) what they shall do, and  implement
it that way.

> You can't read the output value any more sou you are starting to drive the
> output pin of the other driver with the input value. Which can be a verry bad
> idea.

Wrong.

Correct is:  You  cannot  read  the  output  value  from  the  _data_
register,  because external logic might drive a the level low even if
your output bit says "high".

Note 1: There is nothing  that  prevents  you  from  using  a  simple
        integer  variable  to latch the value you write to the output
        port. This is so simple that I'm really surprised you did not
        come up with this solution yourself. And  of  course  such  a
        "buffer" can be shared between several drivers, too.

Note 2: Actually I don't think _anything_  changes  between  actively
        driven output and open drain. I think the value you read from
        the  inputs will ALWAYS reflect the actual value at the pins.
        You may want to test what happens when you configure  a  port
        as  actively  driven  output, write a 1 bit to it, ground the
        output pin, and then read back the data  register.  I  bet  a
        case of beer that you will read a 0 bit.

	And no, I will not pay for the CPU you just fried.


> That's why I aggree open drain I/O's are a good feature but in detail they are
> difficult to deal with. The only solution I came up with was a non atomic access
> to data and open drain register and I don't what to block IRQ changing a single
> pin in let's say the I2C driver. So our current solution is to make the
> suspicious pin an input (preventing 10BT from being switched from half to full
> duplex).

??? I must be missing something. I wouldn't  think  such  complicated
stuff is necessary here at all.


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
A mouse is an elephant built by the Japanese.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

       reply	other threads:[~2003-07-09 10:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <FCEAKDJJAPHPLJFINDAJCEGCDEAA.Stephan.Linke@epygi.de>
2003-07-09 10:24 ` Wolfgang Denk [this message]
     [not found] <3F0C6C0C.8040306@earthlink.net>
2003-07-09 19:57 ` parallel I/O ports & opend darin pins on MPC8xx Wolfgang Denk
     [not found]   ` <3F0C7782.3060704@earthlink.net>
2003-07-09 20:17     ` Wolfgang Denk
2003-07-09 20:20     ` Dean Matsen
     [not found] <FCEAKDJJAPHPLJFINDAJEEGGDEAA.Stephan.Linke@epygi.de>
2003-07-09 12:09 ` Wolfgang Denk
2003-07-08 15:31 Stephan Linke
2003-07-08 15:49 ` Craig Hollabaugh
2003-07-08 21:36 ` Wolfgang Denk
2003-07-09  4:57 ` None Atall

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=20030709102414.2879CC6D82@atlas.denx.de \
    --to=wd@denx.de \
    --cc=Stephan.Linke@epygi.de \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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;
as well as URLs for NNTP newsgroup(s).