All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Malek <dan@embeddededge.com>
To: Matt Porter <porter@cox.net>
Cc: "Montgomery, Tim" <timm@artesyncp.com>,
	linuxppc-embedded@lists.linuxppc.org
Subject: Re: PPC RTC on I2C
Date: Mon, 25 Nov 2002 18:06:12 -0500	[thread overview]
Message-ID: <3DE2ACE4.7070209@embeddededge.com> (raw)
In-Reply-To: 20021125161239.A20831@home.com


Matt Porter wrote:

> I always thought that one would implement some low-level ppc-specific
> i2c master access functions.

It depends upon the board implementation.  If you have devices other
than the RTC on the I2C bus it becomes a big mess.  I've had a couple
of boards with I2C RTCs, but it was the only device connected to
a couple of special purpose GPIOs, so I just used a minimal software
toggle function to do the job.  You have to keep in mind the RTC is
usually updated during the timer interrupt, not a place you want to
be calling the heavyweight I2C layer, especially if there are other
devices you may get queued behind on the bus. :-)

The timer RTC functions are written assuming you only need a
few, low latency, register accesses to read or update the RTC.  This
is also done to ensure hardware clock synchronization.  Placing an
access like this on an I2C queue, if it can be made to work, will
certainly break this synchronization.

> ...  These would be available via a few
> ppc_mds and one could have a generic i2c 'adapter' to call the
> functions.

There are already ppc_mds to read/write the RTC time from the kernel
timer functions.  You just need to install something that Does The
Right Thing. :-)

> ....rather than using the generic PPC RTC
> device.

The problem with the "generic" RTC functions is they assume one of
a few possible parts connected in one of a few possible memory mapped
methods.  I can't use CONFIG_PPC_RTC on many embedded boards, I just
let the board configuration select the RTC support functions.  Yes, it
may be I2C but I don't configure I2C to make it work.

> .... When the full driver is
> initialized then accesses would occur in the normal manner.

I don't think this would ever work for the kernel RTC access.  Check
into it very carefully before you commit to this path.

Thanks.


	-- Dan


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

  reply	other threads:[~2002-11-25 23:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-25 22:13 PPC RTC on I2C Montgomery, Tim
2002-11-25 22:43 ` "Extra cflags for kbuild 2.4." [ _devel tree ] Mark Pilon
2002-11-25 23:12 ` PPC RTC on I2C Matt Porter
2002-11-25 23:06   ` Dan Malek [this message]
2002-11-25 23:07   ` Wolfgang Denk
2002-11-26  8:09     ` Joakim Tjernlund
2002-11-26  8:23 ` leeyang
2002-12-02 10:38   ` QMC driver for 860? Joakim Tjernlund
2002-12-02 12:41     ` Pantelis Antoniou
2002-12-02 13:18       ` Joakim Tjernlund

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=3DE2ACE4.7070209@embeddededge.com \
    --to=dan@embeddededge.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=porter@cox.net \
    --cc=timm@artesyncp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.