26 #define CPR_PERD0_SPIDV_MASK 0x000F0000
28 #define PLLC_SRC_MASK 0x20000000
30 #define PLLD_FBDV_MASK 0x1F000000
31 #define PLLD_FWDVA_MASK 0x000F0000
32 #define PLLD_FWDVB_MASK 0x00000700
34 #define PRIMAD_CPUDV_MASK 0x0F000000
35 #define PRIMAD_PLBDV_MASK 0x000F0000
36 #define PRIMAD_OPBDV_MASK 0x00000F00
37 #define PRIMAD_EBCDV_MASK 0x0000000F
39 #define PERD0_PWMDV_MASK 0xFF000000
40 #define PERD0_SPIDV_MASK 0x000F0000
41 #define PERD0_U0DV_MASK 0x0000FF00
42 #define PERD0_U1DV_MASK 0x000000FF
44 static void get_clocks(
void)
46 unsigned long sysclk, cpr_plld, cpr_pllc, cpr_primad, plloutb,
i;
47 unsigned long pllFwdDiv, pllFwdDivB, pllFbkDiv, pllPlbDiv, pllExtBusDiv;
48 unsigned long pllOpbDiv, freqEBC, freqUART, freqOPB;
60 sysclk = (
in_8((
unsigned char *)0x80000000) == 0xc) ? 66666666 : 33333000;
103 if (pllExtBusDiv == 0)
117 freqOPB = (sysclk *pllFbkDiv) /pllOpbDiv;
119 freqEBC = (sysclk * pllFbkDiv) / pllExtBusDiv;
122 pllFwdDivB : pllFwdDiv) *
123 pllFbkDiv) / pllFwdDivB);
125 np = find_node_by_alias(
"serial0");
126 if (getprop(np,
"current-speed", &baud,
sizeof(baud)) !=
sizeof(baud))
127 fatal(
"no current-speed property\n\r");
130 div = plloutb / (16 *
baud);
131 umin = (plloutb / freqOPB) << 1;
138 for (i = 256; i > umin; i--) {
141 idiff = (est >
div) ? (est-div) : (div-est);
145 }
else if (idiff < diff) {
150 freqUART = plloutb / udiv;
159 static void acadia_fixups(
void)
167 unsigned long r6,
unsigned long r7)