defining the main clock frequency of AT91 boards
M. Warner Losh
imp at bsdimp.com
Sun Mar 16 21:44:04 UTC 2008
In message: <5022.214.171.124.2.1205540152.squirrel at webmail.alpha-tierchen.de>
Björn_König <bkoenig at 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
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.
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.
More information about the freebsd-arm