public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Tom Rini <trini@kernel•crashing.org>
To: Sven Luther <sven.luther@wanadoo•fr>
Cc: Benjamin Herrenschmidt <benh@kernel•crashing.org>,
	Lee Braiden <jel@ntlworld•com>,
	debian-powerpc@lists•debian.org, linuxppc-dev@lists•linuxppc.org
Subject: Re: Would setting the CONFIG_RTC option break the powerpc kernel on your machine ?
Date: Mon, 22 Dec 2003 09:10:42 -0700	[thread overview]
Message-ID: <20031222161042.GB10841@stop.crashing.org> (raw)
In-Reply-To: <20031222134504.GA5964@iliana>


On Mon, Dec 22, 2003 at 02:45:04PM +0100, Sven Luther wrote:

> On Fri, Dec 19, 2003 at 09:28:00AM -0700, Tom Rini wrote:
> >
> > On Fri, Dec 19, 2003 at 12:40:50PM +0100, Sven Luther wrote:
> > > On Wed, Dec 17, 2003 at 10:06:20AM -0700, Tom Rini wrote:
> > > >
> > > > On Wed, Dec 17, 2003 at 05:56:08PM +0100, Sven Luther wrote:
> > > > >
> > > > > On Wed, Dec 17, 2003 at 09:47:40AM -0700, Tom Rini wrote:
> > > > > > 4) Use CONFIG_GEN_RTC and be happy.  What _might_ be happening right now
> > > > > > is that chrp_get_rtc_time is 'funky' and not quite right for anything
> > > > > > other than an IBM OpenFirmeware'd CHRP box.  What I would suggest is
> > > > > > looking at include/asm-generic/rtc.h in 2.6 and moving much of that code
> > > > > > into 'chrp_get_rtc_time' and 'chrp_set_rtc_time'.
> > > > >
> > > > > Ok, thanks, i will look into it.
> > > > >
> > > > > But then, remember, this is for the debian powerpc kernel, and has to be
> > > > > 2.4.x still for now.
> > > >
> > > > Yes.  The code in <asm-generic/rtc.h> is taken right from
> > > > drivers/char/rtc.c.  It just didn't get sent to 2.4 for some reason.
> > >
> > > Ok, found the code, altough drivers/char/rtc.c doesn't seem to have a
> > > set_rtc_time function.
> >
> > Nope, that's why I suggested 2.6's <asm-generic/rtc.h> :)
>
> Ok.
>
> > > BTW, what exactly should i do in 'chrp_get_rtc_time' and
> > > 'chrp_set_rtc_time' ? Just replace the existing code, or make a new
> > > function, and set it depending on machine type who needs it in
> > > chrp_setup.c ? I already do that for the pegasos irq stuff. I just would
> > > have to set ppc_md.set_rtc_time accordyingly.
> >
> > My preferance would be to replace, and then see if it breaks some other
> > chrp machines (it really shouldn't).
>
> Ok, fine, altough i don't have an idea about the other chrp machine
> types out there. From what i know from Geert, generic RTC is already not working
> for its box anyway.
>
> > Something that just dawned on me again (sorry) is that I've really really
> > intended to try and kill both prep_time.c and chrp_time.c (since both of
> > those machine subtypes have PC-style RTC chips) and make them use
> > todc_time.c (see arch/ppc/kernel/todc_time.c).  I've got patches to do
> > half of this, against 2.6 (which was a trivial forward port of older
> > 2.4-based patches I had, there is nothing 2.6-specific about these
> > patches).  You would want to look at:
> > 006-redo_inb_inw_inl_outb_outw_outl.patch
> > 007-make_out_8_and_friends_synchronous.patch
> > 008-todc_warning.patch
> > 009-prep_time_death-GNU.patch
> > from http://stop.crashing.org:16080/~trini/
>
> Mmm, i am somewhat confused now on what to do.
>
> If i understood things tight, you either want to :
>
>   1) replace ppc.md chrp time stuff with similar code than what
>   asm-generic/rtc.h is doing.
>
>   2) use todc.h for all of prep/chrp.
>
> In the first case, i guess that is easy, and may break some chrp boxes
> not using a compatible clock, which may or may not exist.
>
> In the second case, well, the todc code makes use of nvram_write, which
> unless i am wrong, is not defined on chrp. the RTC code uses CMOS_WRITE,
> so maybe i should define a chrp_write wrapping this one.
>
> Also, the todc code knows about many RTC chips, among them, the MC146818
> seems to be the one used by the rtc.h stuff, and seems to be a generic
> legacy RTC chip or something. he one i have, builtin the VIA VT8231
> southbridge is said to be called VT82887, altough i have no docs of
> those, but the header files found in 2.6 concord. But i seem to have
> some additional DATE_ALARM, MONTH_ALARM and CENTURY_FIELD registers not
> found int the MC146818 header file.

I appologize since I ramble a bit too much.  For 2.4, the best fix is
(1) above.  For 2.6 however, it should be possible to remove chrp_time.c
and use todc_time.c instead (it is self-contained, wrt nvram read/write,
iirc) and do some sub-casing to pick the right RTC chip code to use.
For example on PReP we still case between the two different chips, and
just call todc_init (iirc) with a different param.  Or something along
those lines.

--
Tom Rini
http://gate.crashing.org/~trini/

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

  reply	other threads:[~2003-12-22 16:10 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031216105656.GA5291@iliana>
     [not found] ` <1071642293.753.414.camel@gaston>
     [not found]   ` <200312170717.36564.jel@ntlworld.com>
     [not found]     ` <1071646057.6370.482.camel@gaston>
2003-12-17  9:51       ` Would setting the CONFIG_RTC option break the powerpc kernel on your machine ? Sven Luther
2003-12-17 10:27         ` Geert Uytterhoeven
2003-12-17 15:45           ` Segher Boessenkool
2003-12-17 16:18             ` Geert Uytterhoeven
2003-12-17 17:16               ` Segher Boessenkool
2003-12-17 16:47         ` Tom Rini
2003-12-17 16:56           ` Sven Luther
2003-12-17 17:06             ` Tom Rini
2003-12-17 17:10               ` Sven Luther
2003-12-17 17:24                 ` Tom Rini
2003-12-19 11:40               ` Sven Luther
2003-12-19 16:28                 ` Tom Rini
2003-12-22 13:45                   ` Sven Luther
2003-12-22 16:10                     ` Tom Rini [this message]
2003-12-22 16:26                       ` Sven Luther
2003-12-22 16:33                         ` Tom Rini
2003-12-22 16:48                           ` Sven Luther
2003-12-22 16:59                             ` Tom Rini
2003-12-22 17:02                             ` Mark Guertin
2003-12-22 17:27                               ` Sven Luther
2004-01-07  6:54                           ` Sven Luther
2004-01-07  7:22                             ` Benjamin Herrenschmidt
2004-01-07  7:43                               ` Sven Luther
2004-01-07  7:47                               ` Sven Luther
2004-01-07  8:30                                 ` Benjamin Herrenschmidt
2004-01-07  9:53                                   ` Sven Luther
2004-01-07 10:44                                     ` Benjamin Herrenschmidt
2004-01-07 10:54                                       ` Sven Luther
2004-01-07 11:47                                         ` Benjamin Herrenschmidt
2004-01-07 11:53                                           ` Sven Luther
2004-01-07 18:34                                   ` Tom Rini
2004-01-07  7:51                               ` Ethan Benson
2004-01-07 11:27                                 ` Volunteer needed : " Sven Luther
2004-01-07 12:28                                   ` Ethan Benson
2004-01-07 14:47                                     ` Sven Luther
2004-01-08  7:27                                       ` Ethan Benson
2004-01-08 15:53                                         ` Tom Rini
2004-01-08 17:47                                           ` Sven Luther
2004-01-08 21:53                                             ` Benjamin Herrenschmidt
2004-01-08 21:57                                               ` Sven Luther

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=20031222161042.GB10841@stop.crashing.org \
    --to=trini@kernel$(echo .)crashing.org \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=debian-powerpc@lists$(echo .)debian.org \
    --cc=jel@ntlworld$(echo .)com \
    --cc=linuxppc-dev@lists$(echo .)linuxppc.org \
    --cc=sven.luther@wanadoo$(echo .)fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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