Skip to contentSkip to conversation

U-Boot wrong cpu frequency calculation when setting PLPRCR directly

U-Boot-Users Antonio Di Bacco 2 participants 2 messages Jan 20, 2007

lore
Share & tools
lore
#0 lore raw

Hi all,

I setup the cpu frequency of a Freescale MPC880 directly providing a value for the PLPRCR register. When the u-boot (1.2.0 and previous) starts, in file speed.c it makes a calculation to display the CPU frequency based on fields in PLPRCR. Working with integers it makes an approximation that leads to a wrong cpu frequency in my case 130 Mhz instead of 132 Mhz). As a consequence my clock was wrong gaining 20 minutes per day. It is easy to patch the problem. If someone is interested I'll give him the patch.

Bye,
Antonio.

#1 lore raw

Dear Antonio,

Quoted 7 lines · Antonio Di Bacco

I setup the cpu frequency of a Freescale MPC880 directly providing a value for the PLPRCR register. When the u-boot (1.2.0 and previous) starts, in file speed.c it makes a calculation to display the CPU frequency based on fields in PLPRCR. Working with integers it makes an approximation that leads to a wrong cpu frequency in my case 130 Mhz instead of 132 Mhz). As a consequence my clock was wrong gaining 20 minutes per day. It is easy to patch the problem. If someone is interested I'll give him the patch.

Please post the patch so at least it can be found in the archives later.

Regards

Markus Klotzbuecher