MPC8248 goes berserk when printing messages on the SMC console

Laurent Pinchart laurent.pinchart at tbox.biz
Wed May 17 01:09:36 EST 2006


Hi,

after further investigation, I found out that my SMC problem is probably 
caused by cache issues.

> The SMC console works fine in U-Boot. 115200 8N1, no problem there.
>
> When booting a Linux 2.6.16 kernel, the processor doesn't print anything on
> the console and seems to hang. Further analysis with a BDI2000 reveals the
> following.
>
> - The CPU is stuck in cpm_uart_console_write, checking for
>
> while ((bdp->cbd_sc & BD_SC_READY) != 0);
>
>   At that point, most of the external and internal memory read as 0 (SDRAM,
> flash, ...). A few memory locations contain values different than 0, and I
> suspect those to come directly from the cache.

The only memory locations that aren't filled with 0 when read from the BDI are 
the ones present in D-cache lines. Accessing unmapped memory doesn't fail and 
returns 0.

> - If I break right before setting the BD_SC_READY flag and run using stepi,
> random characters are sent on the serial port. Measuring the baudrate using
> an oscilloscope confirms that it has been correctly configured. Only the
> data is wrong.

From http://www.freescale.com/webapp/sps/utils/SingleFaq.jsp?FAQ-19683.xml

"Note. If the core is in the debug mode then the cache content will not be 
updated by the snooping."

I tried to clear the GBL bit in the SMC TFCR register to disable memory 
snooping. This solved part of the problem, as the CPU doesn't hang anymore, 
but the data sent on the serial port are garbage. I suppose that's a normal 
behaviour once the D-cache is enabled.

This leads me to believe that I have a cache issue. Has anyone experienced the 
same problem ?

Laurent Pinchart



More information about the Linuxppc-embedded mailing list