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
Quoted 11 lines · In message <[email protected]> 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.cextracts 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
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "No problem is so formidable that you can't walk away from it." - C. Schulz