cpu.c 16 KB

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