/* Return the current mem clock frequency in units of 10kHz as reflected by CCCR, B, and L  */
unsigned int pxa27x_get_memclk_frequency_10khz(void)
/* Return the current mem clock frequency in units of 10kHz as reflected by CCCR, B, and L  */
unsigned int pxa27x_get_memclk_frequency_10khz(void)
{
	unsigned long ccsr, clkcfg;
	unsigned int l, L, m, M;
       	int cccr_a, b;
	ccsr = CCSR;
	cccr_a = CCCR & (1 << 25);
	asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
	b = clkcfg & (1 << 3);
	l = ccsr & 0x1f;
	m = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
	L = l * BASE_CLK;
	M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
	return (M / 10000);
}