Garrett D'Amore | 11 Sep 2006 07:41

footbridge support for timecounter

The following patch is my attempt at enabling timecounters for
footbridge based ARM32 systems.  As far as I can see, this is only cats
and netwinder.

Thus I've dispensed with all the checks for __HAVE_TIMECOUNTER and just
assumed it for both ports.

I've changed the semantics of the delay timer (previously used for
delay()) slightly -- it now is let run free, rather than being
periodic.  This works better for timecounters.

I have _not_ tested this patch, although it does compile.  If someone
could verify it, I would be grateful, as it converts not one but _two_
ports. :-)

Thanks.

--

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191

Attachment (footbridge.diff): text/x-patch, 10 KiB
Garrett D'Amore | 11 Sep 2006 07:47

oops, fixed diff

My last diff for footbridge tc was botched.  Thanks to Matt Thomas for
pointing out my error.  Again, this isn't tested yet, but it has a
better chance of not panic'ing.  :-)

--

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191

Attachment (footbridge.diff): text/x-patch, 10 KiB
Ignatios Souvatzis | 11 Sep 2006 08:41
Picon

Re: footbridge support for timecounter

On Sun, Sep 10, 2006 at 10:41:05PM -0700, Garrett D'Amore wrote:
> The following patch is my attempt at enabling timecounters for
> footbridge based ARM32 systems.  As far as I can see, this is only cats
> and netwinder.

What about Shark?

	-is

Garrett D'Amore | 11 Sep 2006 08:46

Re: footbridge support for timecounter

Ignatios Souvatzis wrote:
> On Sun, Sep 10, 2006 at 10:41:05PM -0700, Garrett D'Amore wrote:
>   
>> The following patch is my attempt at enabling timecounters for
>> footbridge based ARM32 systems.  As far as I can see, this is only cats
>> and netwinder.
>>     
>
> What about Shark?
>
> 	-is
>   
If shark has a footbridge in it, I can't see it.  It certainly isn't
using the code.  I don't mind working on shark, but I need documentation
on its counters.  It looks like it might have an 8253 hooked up via ISA...

--

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191

Garrett D'Amore | 11 Sep 2006 08:47

Re: oops, fixed diff

Thank for testing it Nick.

At this point all I need is a go-ahead from either of the portmasters,
and I'll commit.

    -- Garrett

Nick Hudson wrote:
> On Monday 11 September 2006 06:47, Garrett D'Amore wrote:
>   
>> My last diff for footbridge tc was botched.  Thanks to Matt Thomas for
>> pointing out my error.  Again, this isn't tested yet, but it has a
>> better chance of not panic'ing.  :-)
>>     
>
> For the record my CATS gives:
>
> $ sysctl kern.timecounter
> kern.timecounter.choice = dc21285_fclk(q=100, f=50000000 Hz) clockinterrupt(q=0, f=100 Hz)
dummy(q=-1000000, f=1000000 Hz)
> kern.timecounter.hardware = dc21285_fclk
> kern.timecounter.timestepwarnings = 0
> $
> $ date; time sleep 10; date
> Mon Sep 11 06:10:56 UTC 2006
>    10.03s real     0.00s user     0.03s system
> Mon Sep 11 06:11:06 UTC 2006
>
> and regress/sys/kern/time ends with
>
(Continue reading)

Nick Hudson | 11 Sep 2006 08:39
Picon

Re: oops, fixed diff

On Monday 11 September 2006 06:47, Garrett D'Amore wrote:
> My last diff for footbridge tc was botched.  Thanks to Matt Thomas for
> pointing out my error.  Again, this isn't tested yet, but it has a
> better chance of not panic'ing.  :-)

For the record my CATS gives:

$ sysctl kern.timecounter
kern.timecounter.choice = dc21285_fclk(q=100, f=50000000 Hz) clockinterrupt(q=0, f=100 Hz)
dummy(q=-1000000, f=1000000 Hz)
kern.timecounter.hardware = dc21285_fclk
kern.timecounter.timestepwarnings = 0
$
$ date; time sleep 10; date
Mon Sep 11 06:10:56 UTC 2006
   10.03s real     0.00s user     0.03s system
Mon Sep 11 06:11:06 UTC 2006

and regress/sys/kern/time ends with

TEST SUCCESSFUL

Nick

Garrett D'Amore | 11 Sep 2006 16:59

Re: oops, fixed diff

Chris Gilbert wrote:
> As Nick's tested it, and it seems ok, I'm happy in terms of functionality.
>  My cats (well computer ones) haven't been powered up yet, as I moved
> house a month or so ago, and just haven't had time (partly due to having
> real cats :)
>
> However to be minorly picky on the diff, your:
> +#define	__HAVE_TIMECOUNTER
> uses a Tab, not a space after define (the defines above use space,
> although I've no idea which one is "the NetBSD" way)
>   

It probably isn't even worth fixing this.  I hope to remove the define
and make it implicit in the next month or so.  Along with GENERIC_TODR,
and maybe eventually GENERIC_SOFTINR. :-)

> (Although I shouldn't complain, given how little time I've had for the
> netbsd of late *sigh*)
>
> And you've nicely pre-empted my other comment which was for the KNF/ANSI
> thing to be done seperately  (I really should do the whole port at some
> point) So the change has more signal in it than noise :)
>
> Where does timer 3 get setup?  IE what hz is it running at, or is a
> default value assumed?  it used to be set in calibrate_timer, but no
> longer is.  (sorry I don't have the datasheet to hand)
>   

It is let run "free", and runs at dc21285_fclk.  This is still set up in
calibrate_timer, but it is implied since that is the behavior when only
(Continue reading)

Chris Gilbert | 11 Sep 2006 15:59
Picon

Re: oops, fixed diff

As Nick's tested it, and it seems ok, I'm happy in terms of functionality
Iain Hibbert | 11 Sep 2006 19:32

bluetooth on cats

Hi,
   I dont have any cats hardware to test (indeed, I'm not sure what the
cats hardware is :) but I have successfully cross-compiled a cats kernel
with bluetooth added. Is it ok to commit the attached patch to enable it
in the GENERIC kernel?

iain
Index: sys/arch/cats/conf/files.cats
===================================================================
RCS file: /cvsroot/src/sys/arch/cats/conf/files.cats,v
retrieving revision 1.32
diff -u -r1.32 files.cats
--- sys/arch/cats/conf/files.cats	11 Dec 2005 12:17:04 -0000	1.32
+++ sys/arch/cats/conf/files.cats	10 Sep 2006 13:13:21 -0000
 <at>  <at>  -102,4 +102,7  <at>  <at> 
 # Include USB stuff
 include "dev/usb/files.usb"
 
+# Include Bluetooth stuff
+include "dev/bluetooth/files.bluetooth"
+
 include "arch/arm/conf/majors.arm32"
Index: sys/arch/cats/conf/GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/cats/conf/GENERIC,v
retrieving revision 1.110
diff -u -r1.110 GENERIC
--- sys/arch/cats/conf/GENERIC	26 Aug 2006 20:26:44 -0000	1.110
+++ sys/arch/cats/conf/GENERIC	10 Sep 2006 13:13:21 -0000
(Continue reading)

Garrett D'Amore | 11 Sep 2006 22:44

real time clock (todr) updates

All,

Attached is a diff to convert netwinder and cats to the MI todr framework.

Note that there is currently no TODR chip driver that I can see for
Netwinder.  As Netwinder apparently lacks a battery backed clock (opting
for a large capacitor instead -- only good for a couple of days without
power I guess), this isn't much of a loss.

However, this means that once you power down or reboot the unit, you'll
get the standard "no TOD clock present" warning.   I recommend that
someone look at writing a driver for the TOD clock, so that this warning
is not printed out if the RTC has not lost power.  (Plus it will mean
more accurate time keeping when powering off, even if only for a few
minutes.)

Having looked a bit at the Linux sources, I'd even venture to improve
Netwinder support a bit if someone out there has a spare unit or two
that they are willing to ship me.

--

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191


Gmane