[U-Boot-Users] MPC85xx: Question about Local Bus initialization

Jens Gehrlein sew_s at tqs.de
Thu Nov 29 10:55:37 CET 2007


Hi,

I took a look into the files board/mpc8560ads.c and board/tqm85xx.c and 
found something strange:

1. In the function local_bus_init() the current CLKDIV is read from the 
register LCRR as was set by Hardreset. After that, the decision is made, 
wether the DLL has to be enabled/disabled/overridden. Inside the if-else 
blocks the new CLKDIV is changed. But IMO the CLKDIV has to be set 
before the query.

This is the current code:
	clkdiv = lbc->lcrr & 0x0f;
	lbc_hz = sysinfo.freqSystemBus / 1000000 / clkdiv;

	if (lbc_hz < 66) {
		lbc->lcrr = CFG_LBC_LCRR | 0x80000000;	/* DLL Bypass */

	} else if (lbc_hz >= 133) {
		lbc->lcrr = CFG_LBC_LCRR & (~0x80000000); /* DLL Enabled
	...
This may be the situation on other 85xx boards, too. I didn't check them 
all.
What was the intention, DLL modification dependent on the clock set by
the MPC at hardreset or dependent on the targeted frequency?


2. The variable is named lbc_hz, but it contains a value in units of 
MHz. I suggest to use the name lbc_mhz or to use Hertz values by 
removing the division by 1,000,000 and replacing 66 and 133 by 66666667 
and 133333333.
What's your opinion?


3. I assume, the function above is called while the MPC executes this 
code from flash memory (array init_sequence[] in lib_ppc/board.c). Is 
there a potential that the U-Boot would hang when it changed the CLKDIV?


Regards,
Jens




More information about the U-Boot mailing list