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