cpu.c 15 KB

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