linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Paubert <paubert@iram.es>
To: Mark Zhan <rongkai.zhan@windriver.com>
Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com,
	"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] Add the support of ST M48T59 RTC chip in rtc-class driver subsystem
Date: Thu, 14 Jun 2007 12:32:03 +0200	[thread overview]
Message-ID: <20070614103203.GA21400@iram.es> (raw)
In-Reply-To: <1181656776.3975.16.camel@mark>

On Tue, Jun 12, 2007 at 09:59:36PM +0800, Mark Zhan wrote:
> Hi Gabriel,
> 
> On Mon, 2007-06-11 at 14:11 +0200, Gabriel Paubert wrote:
> ....
> > There are other boards which have exactly the same chip, but use
> > a very different (uglier) access method: using ISA 2 I/O ports
> > (0x74 and 0x75) to write the address and another port (0x77) to 
> > read/write the data.
> > 
> > Besides that, these boards also use the NVRAM part which means that
> > a spinlock must be used to serialize between RTC and NVRAM access.
> > 
> > I have no idea whether the drivers should be shared or two
> > different drivers should be written... But if there are two
> > different drivers, there should be a way to distinguish them
> > (different config name, different module names, and some
> > explanation in the config help text).
> > 
> 
> I will rework this driver to add a platform data structure which enables
> the platform to provide the platform specific access method.

I'm not even sure that this is a good idea: the direct mapped nvram/RTC 
is much simpler, and adding another indirection layer transforms many 
leaf functions into non leaf one, which makes the code significantly bigger.

> 
> For the NVRAM issue, I have no idea how other boards access the NVRAM.
> So could you provide me more information?

That's the hardest problem. Since you use the same ISA (yuck) I/O
ports to access the NVRAM and the RTC (after all it is the same chip,
using the same address pins), the accesses need to be serialized
through a shared spinlock. 

With a direct mapped like your machine, the drivers can be completely 
independent: they will never step on each other's toes. 

I've not yet made up my mind on which is the best way to handle
the problem and am leaving tomorrow for about 1 week. For
now I think that your patch is fine (using NO_IRQ as I suggested)
and I shall revisit it when time comes to port the kernel
to these boards (running 2.2 for 8 years, it's not a few
more months to switch to 2.6 that matters).

	Regards,
	Gabriel

  parent reply	other threads:[~2007-06-14 10:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11  7:56 [PATCH] Add the support of ST M48T59 RTC chip in rtc-class driver subsystem Mark Zhan
2007-06-11 11:25 ` [rtc-linux] " Alessandro Zummo
2007-06-11 12:11 ` Gabriel Paubert
2007-06-12 13:59   ` Mark Zhan
2007-06-12 14:12     ` Mark Zhan
2007-06-19 12:29       ` Alessandro Zummo
2007-06-14 10:32     ` Gabriel Paubert [this message]
2007-06-11 14:35 ` Milton Miller

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=20070614103203.GA21400@iram.es \
    --to=paubert@iram.es \
    --cc=a.zummo@towertech.it \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=rongkai.zhan@windriver.com \
    --cc=rtc-linux@googlegroups.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 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).