cpu.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /*
  2. * (C) Copyright 2000-2002
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * m8xx.c
  25. *
  26. * CPU specific code
  27. *
  28. * written or collected and sometimes rewritten by
  29. * Magnus Damm <damm@bitsmart.com>
  30. *
  31. * minor modifications by
  32. * Wolfgang Denk <wd@denx.de>
  33. */
  34. #include <common.h>
  35. #include <watchdog.h>
  36. #include <command.h>
  37. #include <mpc8xx.h>
  38. #include <asm/cache.h>
  39. #if defined(CONFIG_OF_LIBFDT)
  40. #include <libfdt.h>
  41. #include <libfdt_env.h>
  42. #include <fdt_support.h>
  43. #endif
  44. DECLARE_GLOBAL_DATA_PTR;
  45. static char *cpu_warning = "\n " \
  46. "*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***";
  47. #if ((defined(CONFIG_MPC86x) || defined(CONFIG_MPC855)) && \
  48. !defined(CONFIG_MPC862))
  49. static int check_CPU (long clock, uint pvr, uint immr)
  50. {
  51. char *id_str =
  52. # if defined(CONFIG_MPC855)
  53. "PC855";
  54. # elif defined(CONFIG_MPC860P)
  55. "PC860P";
  56. # else
  57. NULL;
  58. # endif
  59. volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
  60. uint k, m;
  61. char buf[32];
  62. char pre = 'X';
  63. char *mid = "xx";
  64. char *suf;
  65. /* the highest 16 bits should be 0x0050 for a 860 */
  66. if ((pvr >> 16) != 0x0050)
  67. return -1;
  68. k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
  69. m = 0;
  70. suf = "";
  71. /*
  72. * Some boards use sockets so different CPUs can be used.
  73. * We have to check chip version in run time.
  74. */
  75. switch (k) {
  76. case 0x00020001: pre = 'P'; break;
  77. case 0x00030001: break;
  78. case 0x00120003: suf = "A"; break;
  79. case 0x00130003: suf = "A3"; break;
  80. case 0x00200004: suf = "B"; break;
  81. case 0x00300004: suf = "C"; break;
  82. case 0x00310004: suf = "C1"; m = 1; break;
  83. case 0x00200064: mid = "SR"; suf = "B"; break;
  84. case 0x00300065: mid = "SR"; suf = "C"; break;
  85. case 0x00310065: mid = "SR"; suf = "C1"; m = 1; break;
  86. case 0x05010000: suf = "D3"; m = 1; break;
  87. case 0x05020000: suf = "D4"; m = 1; break;
  88. /* this value is not documented anywhere */
  89. case 0x40000000: pre = 'P'; suf = "D"; m = 1; break;
  90. /* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
  91. case 0x08010004: /* Rev. A.0 */
  92. suf = "A";
  93. /* fall through */
  94. case 0x08000003: /* Rev. 0.3 */
  95. pre = 'M'; m = 1;
  96. if (id_str == NULL)
  97. id_str =
  98. # if defined(CONFIG_MPC852T)
  99. "PC852T";
  100. # elif defined(CONFIG_MPC859T)
  101. "PC859T";
  102. # elif defined(CONFIG_MPC859DSL)
  103. "PC859DSL";
  104. # elif defined(CONFIG_MPC866T)
  105. "PC866T";
  106. # else
  107. "PC866x"; /* Unknown chip from MPC866 family */
  108. # endif
  109. break;
  110. case 0x09000000: pre = 'M'; mid = suf = ""; m = 1;
  111. if (id_str == NULL)
  112. id_str = "PC885"; /* 870/875/880/885 */
  113. break;
  114. default: suf = NULL; break;
  115. }
  116. if (id_str == NULL)
  117. id_str = "PC86x"; /* Unknown 86x chip */
  118. if (suf)
  119. printf ("%c%s%sZPnn%s", pre, id_str, mid, suf);
  120. else
  121. printf ("unknown M%s (0x%08x)", id_str, k);
  122. #if defined(CFG_8xx_CPUCLK_MIN) && defined(CFG_8xx_CPUCLK_MAX)
  123. printf (" at %s MHz [%d.%d...%d.%d MHz]\n ",
  124. strmhz (buf, clock),
  125. CFG_8xx_CPUCLK_MIN / 1000000,
  126. ((CFG_8xx_CPUCLK_MIN % 1000000) + 50000) / 100000,
  127. CFG_8xx_CPUCLK_MAX / 1000000,
  128. ((CFG_8xx_CPUCLK_MAX % 1000000) + 50000) / 100000
  129. );
  130. #else
  131. printf (" at %s MHz: ", strmhz (buf, clock));
  132. #endif
  133. printf ("%u kB I-Cache %u kB D-Cache",
  134. checkicache () >> 10,
  135. checkdcache () >> 10
  136. );
  137. /* do we have a FEC (860T/P or 852/859/866/885)? */
  138. immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
  139. if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
  140. printf (" FEC present");
  141. }
  142. if (!m) {
  143. puts (cpu_warning);
  144. }
  145. putc ('\n');
  146. #ifdef DEBUG
  147. if(clock != measure_gclk()) {
  148. printf ("clock %ldHz != %dHz\n", clock, measure_gclk());
  149. }
  150. #endif
  151. return 0;
  152. }
  153. #elif defined(CONFIG_MPC862)
  154. static int check_CPU (long clock, uint pvr, uint immr)
  155. {
  156. volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
  157. uint k, m;
  158. char buf[32];
  159. char pre = 'X';
  160. char *mid = "xx";
  161. char *suf;
  162. /* the highest 16 bits should be 0x0050 for a 8xx */
  163. if ((pvr >> 16) != 0x0050)
  164. return -1;
  165. k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
  166. m = 0;
  167. switch (k) {
  168. /* this value is not documented anywhere */
  169. case 0x06000000: mid = "P"; suf = "0"; break;
  170. case 0x06010001: mid = "P"; suf = "A"; m = 1; break;
  171. case 0x07000003: mid = "P"; suf = "B"; m = 1; break;
  172. default: suf = NULL; break;
  173. }
  174. #ifndef CONFIG_MPC857
  175. if (suf)
  176. printf ("%cPC862%sZPnn%s", pre, mid, suf);
  177. else
  178. printf ("unknown MPC862 (0x%08x)", k);
  179. #else
  180. if (suf)
  181. printf ("%cPC857TZPnn%s", pre, suf); /* only 857T tested right now! */
  182. else
  183. printf ("unknown MPC857 (0x%08x)", k);
  184. #endif
  185. printf (" at %s MHz:", strmhz (buf, clock));
  186. printf (" %u kB I-Cache", checkicache () >> 10);
  187. printf (" %u kB D-Cache", checkdcache () >> 10);
  188. /* lets check and see if we're running on a 862T (or P?) */
  189. immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
  190. if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
  191. printf (" FEC present");
  192. }
  193. if (!m) {
  194. puts (cpu_warning);
  195. }
  196. putc ('\n');
  197. return 0;
  198. }
  199. #elif defined(CONFIG_MPC823)
  200. static int check_CPU (long clock, uint pvr, uint immr)
  201. {
  202. volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
  203. uint k, m;
  204. char buf[32];
  205. char *suf;
  206. /* the highest 16 bits should be 0x0050 for a 8xx */
  207. if ((pvr >> 16) != 0x0050)
  208. return -1;
  209. k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
  210. m = 0;
  211. switch (k) {
  212. /* MPC823 */
  213. case 0x20000000: suf = "0"; break;
  214. case 0x20010000: suf = "0.1"; break;
  215. case 0x20020000: suf = "Z2/3"; break;
  216. case 0x20020001: suf = "Z3"; break;
  217. case 0x21000000: suf = "A"; break;
  218. case 0x21010000: suf = "B"; m = 1; break;
  219. case 0x21010001: suf = "B2"; m = 1; break;
  220. /* MPC823E */
  221. case 0x24010000: suf = NULL;
  222. puts ("PPC823EZTnnB2");
  223. m = 1;
  224. break;
  225. default:
  226. suf = NULL;
  227. printf ("unknown MPC823 (0x%08x)", k);
  228. break;
  229. }
  230. if (suf)
  231. printf ("PPC823ZTnn%s", suf);
  232. printf (" at %s MHz:", strmhz (buf, clock));
  233. printf (" %u kB I-Cache", checkicache () >> 10);
  234. printf (" %u kB D-Cache", checkdcache () >> 10);
  235. /* lets check and see if we're running on a 860T (or P?) */
  236. immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
  237. if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
  238. puts (" FEC present");
  239. }
  240. if (!m) {
  241. puts (cpu_warning);
  242. }
  243. putc ('\n');
  244. return 0;
  245. }
  246. #elif defined(CONFIG_MPC850)
  247. static int check_CPU (long clock, uint pvr, uint immr)
  248. {
  249. volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
  250. uint k, m;
  251. char buf[32];
  252. /* the highest 16 bits should be 0x0050 for a 8xx */
  253. if ((pvr >> 16) != 0x0050)
  254. return -1;
  255. k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
  256. m = 0;
  257. switch (k) {
  258. case 0x20020001:
  259. printf ("XPC850xxZT");
  260. break;
  261. case 0x21000065:
  262. printf ("XPC850xxZTA");
  263. break;
  264. case 0x21010067:
  265. printf ("XPC850xxZTB");
  266. m = 1;
  267. break;
  268. case 0x21020068:
  269. printf ("XPC850xxZTC");
  270. m = 1;
  271. break;
  272. default:
  273. printf ("unknown MPC850 (0x%08x)", k);
  274. }
  275. printf (" at %s MHz:", strmhz (buf, clock));
  276. printf (" %u kB I-Cache", checkicache () >> 10);
  277. printf (" %u kB D-Cache", checkdcache () >> 10);
  278. /* lets check and see if we're running on a 850T (or P?) */
  279. immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
  280. if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
  281. printf (" FEC present");
  282. }
  283. if (!m) {
  284. puts (cpu_warning);
  285. }
  286. putc ('\n');
  287. return 0;
  288. }
  289. #else
  290. #error CPU undefined
  291. #endif
  292. /* ------------------------------------------------------------------------- */
  293. int checkcpu (void)
  294. {
  295. ulong clock = gd->cpu_clk;
  296. uint immr = get_immr (0); /* Return full IMMR contents */
  297. uint pvr = get_pvr ();
  298. puts ("CPU: ");
  299. /* 850 has PARTNUM 20 */
  300. /* 801 has PARTNUM 10 */
  301. return check_CPU (clock, pvr, immr);
  302. }
  303. /* ------------------------------------------------------------------------- */
  304. /* L1 i-cache */
  305. /* the standard 860 has 128 sets of 16 bytes in 2 ways (= 4 kB) */
  306. /* the 860 P (plus) has 256 sets of 16 bytes in 4 ways (= 16 kB) */
  307. int checkicache (void)
  308. {
  309. volatile immap_t *immap = (immap_t *) CFG_IMMR;
  310. volatile memctl8xx_t *memctl = &immap->im_memctl;
  311. u32 cacheon = rd_ic_cst () & IDC_ENABLED;
  312. #ifdef CONFIG_IP86x
  313. u32 k = memctl->memc_br1 & ~0x00007fff; /* probe in flash memoryarea */
  314. #else
  315. u32 k = memctl->memc_br0 & ~0x00007fff; /* probe in flash memoryarea */
  316. #endif
  317. u32 m;
  318. u32 lines = -1;
  319. wr_ic_cst (IDC_UNALL);
  320. wr_ic_cst (IDC_INVALL);
  321. wr_ic_cst (IDC_DISABLE);
  322. __asm__ volatile ("isync");
  323. while (!((m = rd_ic_cst ()) & IDC_CERR2)) {
  324. wr_ic_adr (k);
  325. wr_ic_cst (IDC_LDLCK);
  326. __asm__ volatile ("isync");
  327. lines++;
  328. k += 0x10; /* the number of bytes in a cacheline */
  329. }
  330. wr_ic_cst (IDC_UNALL);
  331. wr_ic_cst (IDC_INVALL);
  332. if (cacheon)
  333. wr_ic_cst (IDC_ENABLE);
  334. else
  335. wr_ic_cst (IDC_DISABLE);
  336. __asm__ volatile ("isync");
  337. return lines << 4;
  338. };
  339. /* ------------------------------------------------------------------------- */
  340. /* L1 d-cache */
  341. /* the standard 860 has 128 sets of 16 bytes in 2 ways (= 4 kB) */
  342. /* the 860 P (plus) has 256 sets of 16 bytes in 2 ways (= 8 kB) */
  343. /* call with cache disabled */
  344. int checkdcache (void)
  345. {
  346. volatile immap_t *immap = (immap_t *) CFG_IMMR;
  347. volatile memctl8xx_t *memctl = &immap->im_memctl;
  348. u32 cacheon = rd_dc_cst () & IDC_ENABLED;
  349. #ifdef CONFIG_IP86x
  350. u32 k = memctl->memc_br1 & ~0x00007fff; /* probe in flash memoryarea */
  351. #else
  352. u32 k = memctl->memc_br0 & ~0x00007fff; /* probe in flash memoryarea */
  353. #endif
  354. u32 m;
  355. u32 lines = -1;
  356. wr_dc_cst (IDC_UNALL);
  357. wr_dc_cst (IDC_INVALL);
  358. wr_dc_cst (IDC_DISABLE);
  359. while (!((m = rd_dc_cst ()) & IDC_CERR2)) {
  360. wr_dc_adr (k);
  361. wr_dc_cst (IDC_LDLCK);
  362. lines++;
  363. k += 0x10; /* the number of bytes in a cacheline */
  364. }
  365. wr_dc_cst (IDC_UNALL);
  366. wr_dc_cst (IDC_INVALL);
  367. if (cacheon)
  368. wr_dc_cst (IDC_ENABLE);
  369. else
  370. wr_dc_cst (IDC_DISABLE);
  371. return lines << 4;
  372. };
  373. /* ------------------------------------------------------------------------- */
  374. void upmconfig (uint upm, uint * table, uint size)
  375. {
  376. uint i;
  377. uint addr = 0;
  378. volatile immap_t *immap = (immap_t *) CFG_IMMR;
  379. volatile memctl8xx_t *memctl = &immap->im_memctl;
  380. for (i = 0; i < size; i++) {
  381. memctl->memc_mdr = table[i]; /* (16-15) */
  382. memctl->memc_mcr = addr | upm; /* (16-16) */
  383. addr++;
  384. }
  385. }
  386. /* ------------------------------------------------------------------------- */
  387. #ifndef CONFIG_LWMON
  388. int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  389. {
  390. ulong msr, addr;
  391. volatile immap_t *immap = (immap_t *) CFG_IMMR;
  392. immap->im_clkrst.car_plprcr |= PLPRCR_CSR; /* Checkstop Reset enable */
  393. /* Interrupts and MMU off */
  394. __asm__ volatile ("mtspr 81, 0");
  395. __asm__ volatile ("mfmsr %0":"=r" (msr));
  396. msr &= ~0x1030;
  397. __asm__ volatile ("mtmsr %0"::"r" (msr));
  398. /*
  399. * Trying to execute the next instruction at a non-existing address
  400. * should cause a machine check, resulting in reset
  401. */
  402. #ifdef CFG_RESET_ADDRESS
  403. addr = CFG_RESET_ADDRESS;
  404. #else
  405. /*
  406. * note: when CFG_MONITOR_BASE points to a RAM address, CFG_MONITOR_BASE
  407. * - sizeof (ulong) is usually a valid address. Better pick an address
  408. * known to be invalid on your system and assign it to CFG_RESET_ADDRESS.
  409. * "(ulong)-1" used to be a good choice for many systems...
  410. */
  411. addr = CFG_MONITOR_BASE - sizeof (ulong);
  412. #endif
  413. ((void (*)(void)) addr) ();
  414. return 1;
  415. }
  416. #else /* CONFIG_LWMON */
  417. /*
  418. * On the LWMON board, the MCLR reset input of the PIC's on the board
  419. * uses a 47K/1n RC combination which has a 47us time constant. The
  420. * low signal on the HRESET pin of the CPU is only 512 clocks = 8 us
  421. * and thus too short to reset the external hardware. So we use the
  422. * watchdog to reset the board.
  423. */
  424. int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  425. {
  426. /* prevent triggering the watchdog */
  427. disable_interrupts ();
  428. /* make sure the watchdog is running */
  429. reset_8xx_watchdog ((immap_t *) CFG_IMMR);
  430. /* wait for watchdog reset */
  431. while (1) {};
  432. /* NOTREACHED */
  433. return 1;
  434. }
  435. #endif /* CONFIG_LWMON */
  436. /* ------------------------------------------------------------------------- */
  437. /*
  438. * Get timebase clock frequency (like cpu_clk in Hz)
  439. *
  440. * See sections 14.2 and 14.6 of the User's Manual
  441. */
  442. unsigned long get_tbclk (void)
  443. {
  444. uint immr = get_immr (0); /* Return full IMMR contents */
  445. volatile immap_t *immap = (volatile immap_t *)(immr & 0xFFFF0000);
  446. ulong oscclk, factor, pll;
  447. if (immap->im_clkrst.car_sccr & SCCR_TBS) {
  448. return (gd->cpu_clk / 16);
  449. }
  450. pll = immap->im_clkrst.car_plprcr;
  451. #define PLPRCR_val(a) ((pll & PLPRCR_ ## a ## _MSK) >> PLPRCR_ ## a ## _SHIFT)
  452. /*
  453. * For newer PQ1 chips (MPC866/87x/88x families), PLL multiplication
  454. * factor is calculated as follows:
  455. *
  456. * MFN
  457. * MFI + -------
  458. * MFD + 1
  459. * factor = -----------------
  460. * (PDF + 1) * 2^S
  461. *
  462. * For older chips, it's just MF field of PLPRCR plus one.
  463. */
  464. if ((immr & 0x0FFF) >= MPC8xx_NEW_CLK) { /* MPC866/87x/88x series */
  465. factor = (PLPRCR_val(MFI) + PLPRCR_val(MFN)/(PLPRCR_val(MFD)+1))/
  466. (PLPRCR_val(PDF)+1) / (1<<PLPRCR_val(S));
  467. } else {
  468. factor = PLPRCR_val(MF)+1;
  469. }
  470. oscclk = gd->cpu_clk / factor;
  471. if ((immap->im_clkrst.car_sccr & SCCR_RTSEL) == 0 || factor > 2) {
  472. return (oscclk / 4);
  473. }
  474. return (oscclk / 16);
  475. }
  476. /* ------------------------------------------------------------------------- */
  477. #if defined(CONFIG_WATCHDOG)
  478. void watchdog_reset (void)
  479. {
  480. int re_enable = disable_interrupts ();
  481. reset_8xx_watchdog ((immap_t *) CFG_IMMR);
  482. if (re_enable)
  483. enable_interrupts ();
  484. }
  485. #endif /* CONFIG_WATCHDOG */
  486. #if defined(CONFIG_WATCHDOG) || defined(CONFIG_LWMON)
  487. void reset_8xx_watchdog (volatile immap_t * immr)
  488. {
  489. # if defined(CONFIG_LWMON)
  490. /*
  491. * The LWMON board uses a MAX6301 Watchdog
  492. * with the trigger pin connected to port PA.7
  493. *
  494. * (The old board version used a MAX706TESA Watchdog, which
  495. * had to be handled exactly the same.)
  496. */
  497. # define WATCHDOG_BIT 0x0100
  498. immr->im_ioport.iop_papar &= ~(WATCHDOG_BIT); /* GPIO */
  499. immr->im_ioport.iop_padir |= WATCHDOG_BIT; /* Output */
  500. immr->im_ioport.iop_paodr &= ~(WATCHDOG_BIT); /* active output */
  501. immr->im_ioport.iop_padat ^= WATCHDOG_BIT; /* Toggle WDI */
  502. # elif defined(CONFIG_KUP4K) || defined(CONFIG_KUP4X)
  503. /*
  504. * The KUP4 boards uses a TPS3705 Watchdog
  505. * with the trigger pin connected to port PA.5
  506. */
  507. # define WATCHDOG_BIT 0x0400
  508. immr->im_ioport.iop_papar &= ~(WATCHDOG_BIT); /* GPIO */
  509. immr->im_ioport.iop_padir |= WATCHDOG_BIT; /* Output */
  510. immr->im_ioport.iop_paodr &= ~(WATCHDOG_BIT); /* active output */
  511. immr->im_ioport.iop_padat ^= WATCHDOG_BIT; /* Toggle WDI */
  512. # else
  513. /*
  514. * All other boards use the MPC8xx Internal Watchdog
  515. */
  516. immr->im_siu_conf.sc_swsr = 0x556c; /* write magic1 */
  517. immr->im_siu_conf.sc_swsr = 0xaa39; /* write magic2 */
  518. # endif /* CONFIG_LWMON */
  519. }
  520. #endif /* CONFIG_WATCHDOG */
  521. /* ------------------------------------------------------------------------- */
  522. #if defined(CONFIG_OF_LIBFDT)
  523. void ft_cpu_setup (void *blob, bd_t *bd)
  524. {
  525. char * cpu_path = "/cpus/" OF_CPU;
  526. do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
  527. do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
  528. do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
  529. }
  530. #endif /* CONFIG_OF_LIBFDT */