[U-Boot-Users] Wrong CFG_BSTOPRE encoding in cpu/mpc824x/cpu_init.c

I'm trying to define CFG_BSTOPRE = 121, or about 1/8 of nominal REFINT. But when I read MCCR1-4 back with the BDI2000, the value looks like 604, not 121.
The encoding of BSTOPRE is complex. It is split into 3 subfields, and spread over MCCR2 and MCCR4. The discrepency seems to be due to different assumptions about how the subfields are ordered in the composite value.
The code in cpu/mpc824x/cpu_init.c extracts the pieces as ( BSTOPRE[6-9] || BSTOPRE[2-5] || BSTOPRE[0-1] )
Per Freescale technical support, these three fields are to be assembled as ( BSTOPRE[0-1] || BSTOPRE[2-5] || BSTOPRE[6-9] )
The Sandpoint 8240 configuration file confirms this view [http://www.ultsol.com/config/Motorola/SP8240.cfg]
Regards, Peter Hanson

In message 50e92330050914065119c9ce50@mail.google.com you wrote:
The encoding of BSTOPRE is complex. It is split into 3 subfields, and spread over MCCR2 and MCCR4. The discrepency seems to be due to different assumptions about how the subfields are ordered in the composite value.
The code in cpu/mpc824x/cpu_init.c extracts the pieces as ( BSTOPRE[6-9] || BSTOPRE[2-5] || BSTOPRE[0-1] )
Per Freescale technical support, these three fields are to be assembled as ( BSTOPRE[0-1] || BSTOPRE[2-5] || BSTOPRE[6-9] )
So what yould your proposed patch look like?
Best regards,
Wolfgang Denk
participants (2)
-
Peter Hanson
-
Wolfgang Denk