20 #define MPC8XX_PLPRCR (0x284/4)
27 int mfi, mfn, mfd, pdf,
div;
32 printf(
"mpc885_get_clock: Couldn't get IMMR base.\r\n");
38 mfi = (plprcr >> 16) & 15;
40 printf(
"Warning: PLPRCR[MFI] value of %d out-of-bounds\r\n",
45 pdf = (plprcr >> 1) & 0xf;
46 div = (plprcr >> 20) & 3;
47 mfd = (plprcr >> 22) & 0x1f;
48 mfn = (plprcr >> 27) & 0x1f;
53 ret += crystal * mfn / (mfd + 1);
55 return ret / (pdf + 1);
65 node = finddevice(
"/soc/cpm");
67 setprop(node,
"clock-frequency", &sysclk, 4);
69 node = finddevice(
"/soc/cpm/brg");
71 setprop(node,
"clock-frequency", &sysclk, 4);