Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Mar 2008 02:41:43 +0100
From:      Bernd Walter <ticso@cicely12.cicely.de>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        arm@freebsd.org, bkoenig@alpha-tierchen.de
Subject:   Re: defining the main clock frequency of AT91 boards
Message-ID:  <20080317014143.GQ67602@cicely12.cicely.de>
In-Reply-To: <20080316.154215.1387160441.imp@bsdimp.com>
References:  <50161.192.168.1.2.1205540152.squirrel@webmail.alpha-tierchen.de> <20080316.154215.1387160441.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 16, 2008 at 03:42:15PM -0600, M. Warner Losh wrote:
> In message: <50161.192.168.1.2.1205540152.squirrel@webmail.alpha-tierchen.de>
>             Björn_König <bkoenig@alpha-tierchen.de> writes:
> : I would like to have a preprocessor definition called AT91C_MAIN_CLOCK
> : that allows you to specify the main clock frequency of a board in the
> : kernel configuration file. It avoids an intricate distinction of cases in
> : at91_pmc.c:395ff and you can use the unpatched source code with boards
> : that have a different quartz frequency than 10 or 16 MHz.
> : 
> : I attached a patch that deals with this issue. Users of TSC boards need to
> : add 'options AT91C_MAIN_CLOCK=16000000' to their kernel configuration
> : file.

And users of BWCT boards ;-)

> I'd go one step further.  I'd require everybody to define this value
> since there's no 'standard' frequency and the value that's there is
> just the value of the boards we used for the port.

Me too - that way noone can forget defining it and run with the wrong
frequency.

> It would be even better if it wasn't a #define, but a variable.
> There's registers that can be read to get the approximate frequency
> (the chip only supports one of list of something like 16 different
> frequencies).  We should consider it and have an override for those
> engineers that use a non-standard frequency.

You only need a xtal out of this selection in case you want the ROM
code to setup the clocks for console and/or USB right.
But it is not required to have them right unless you want to load
software using the ROM code with one of those two interfaces.
You can still load your software by different kind of external memories
and then setup the clocks with your own code.
For me it is important to init the external memory, but this of corse
can be done using other mechanisms as well.

But since we are already about RM9200 clocks.
Is it possible today to setup different clocks?
I remember that MCK was hardcoded some time ago, but now I saw that
it can be setup in the kernel conf.
E.g. the MCK can be 80MHz and the only reason it is 60MHz right now is
because PCK is 180MHz and MCK has to be divided from that.
I always wondered myself if it is faster to run the CPU at 160MHz and
have 80MHz MCK.
Absolutely everything beside CPU increses in speed with MCK, including
external SDRAM, which in almost every case is 133MHz specified anyway.
Not to speak about overclocking PCK.
So far MCK is defined for up to 80MHz and PCK is defined to be up to
209MHz.
The only reason to not run that high is that the PLLA is limited.
But in fact the PLL runs fine with at least up to 288MHz.
I know that because on my first tests I had the PLL setup for 10MHz
xtal, but in fact used a 16MHz - and the CPU did start just fine.
Maybe Atmel had to limit the PLL to support the full temperature range
or something like that.

I have some 32x16 SDRAM chips her to build boards with 128MB RAM and
it really would be nice to have them run faster.

-- 
B.Walter                http://www.bwct.de      http://www.fizon.de
bernd@bwct.de           info@bwct.de            support@fizon.de



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080317014143.GQ67602>