#1738 closed defect (fixed)

uC5282 BSP assumes 64MHz clock

Reported by: strauman Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: bsps Version: 4.9
Severity: normal Keywords:
Cc: norume@… Blocked By:
Blocking:

Description

Currently, the uC5282 BSP requires relinking
the application with a special linker flag
in order to make it work with 80MHz boards
(breaking run-time compatibility with 64MHz
variants).

The attached patch aims adds support for
run-time guessing/setting of the system-clock
frequency:

1) If uCbootloader environment variable

SYS_CLOCK_SPEED is set to a non-zero
number then the BSP assumes this number
to specify the clock frequency in Hz.

2) If 1) yields no non-zero frequency then

the linker-provided symbol _CPUClockSpeed
is assumed to specify the clock frequency
(in Hz). This is the traditional behavior
but the default value of _CPUClockSpeed
was changed from 64000000 to 0 (in order
to let step 3) do it's work by default).

3) If neither 1) nor 2) yield a non-zero frequency

then assume a PLL reference frequency (in Hz) as
defined by the linker-provided symbol
'_PLLRefClockSpeed' (which defaults to 8000000)
and compute the system clock frequency from
the divisor/multiplier settings in the SYNCR
register.

We have both, 64MHz and 80MHz variants and both
use a PLL reference of 8MHz so that run-time
heuristics + detection 3) work fine.

1) + 2) give the user methods for overriding
the detection if needed.

Attachments (2)

uC5282_clk_speed.diff (5.0 KB) - added by strauman on Feb 8, 2011 at 11:38:25 PM.
patch against rtems-4-10-branch implementing proposed change
rtems-PR#1738-uC5282-clock.diff (10.2 KB) - added by strauman on Feb 22, 2011 at 5:16:02 PM.
additional patch fixing system clock rate for non-64MHz boards

Download all attachments as: .zip

Change History (4)

Changed on Feb 8, 2011 at 11:38:25 PM by strauman

Attachment: uC5282_clk_speed.diff added

patch against rtems-4-10-branch implementing proposed change

Changed on Feb 22, 2011 at 5:16:02 PM by strauman

additional patch fixing system clock rate for non-64MHz boards

comment:1 Changed on Feb 22, 2011 at 5:18:33 PM by strauman

Cc: Eric Norum added

comment:2 Changed on Mar 4, 2011 at 3:04:07 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

Patch applied to 4.10 and head.

Note: See TracTickets for help on using tickets.