fec.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /*
  2. * (C) Copyright 2000-2004
  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. #include <common.h>
  24. #include <malloc.h>
  25. #include <asm/fec.h>
  26. #ifdef CONFIG_M5271
  27. #include <asm/m5271.h>
  28. #include <asm/immap_5271.h>
  29. #endif
  30. #ifdef CONFIG_M5272
  31. #include <asm/m5272.h>
  32. #include <asm/immap_5272.h>
  33. #endif
  34. #ifdef CONFIG_M5282
  35. #include <asm/m5282.h>
  36. #include <asm/immap_5282.h>
  37. #endif
  38. #include <net.h>
  39. #include <command.h>
  40. #ifdef CONFIG_M5272
  41. #define FEC_ADDR (CFG_MBAR + 0x840)
  42. #endif
  43. #if defined(CONFIG_M5282) || defined(CONFIG_M5271)
  44. #define FEC_ADDR (CFG_MBAR + 0x1000)
  45. #endif
  46. #undef ET_DEBUG
  47. #undef MII_DEBUG
  48. #if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET)
  49. #ifdef CFG_DISCOVER_PHY
  50. #include <miiphy.h>
  51. static void mii_discover_phy (void);
  52. #endif
  53. /* Ethernet Transmit and Receive Buffers */
  54. #define DBUF_LENGTH 1520
  55. #define TX_BUF_CNT 2
  56. #define TOUT_LOOP 100
  57. #define PKT_MAXBUF_SIZE 1518
  58. #define PKT_MINBUF_SIZE 64
  59. #define PKT_MAXBLR_SIZE 1520
  60. static char txbuf[DBUF_LENGTH];
  61. static uint rxIdx; /* index of the current RX buffer */
  62. static uint txIdx; /* index of the current TX buffer */
  63. /*
  64. * FEC Ethernet Tx and Rx buffer descriptors allocated at the
  65. * immr->udata_bd address on Dual-Port RAM
  66. * Provide for Double Buffering
  67. */
  68. typedef volatile struct CommonBufferDescriptor {
  69. cbd_t rxbd[PKTBUFSRX]; /* Rx BD */
  70. cbd_t txbd[TX_BUF_CNT]; /* Tx BD */
  71. } RTXBD;
  72. static RTXBD *rtx = NULL;
  73. int eth_send (volatile void *packet, int length)
  74. {
  75. int j, rc;
  76. volatile fec_t *fecp = (fec_t *) (FEC_ADDR);
  77. /* section 16.9.23.3
  78. * Wait for ready
  79. */
  80. j = 0;
  81. while ((rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY)
  82. && (j < TOUT_LOOP)) {
  83. udelay (1);
  84. j++;
  85. }
  86. if (j >= TOUT_LOOP) {
  87. printf ("TX not ready\n");
  88. }
  89. rtx->txbd[txIdx].cbd_bufaddr = (uint) packet;
  90. rtx->txbd[txIdx].cbd_datlen = length;
  91. rtx->txbd[txIdx].cbd_sc |= BD_ENET_TX_READY | BD_ENET_TX_LAST;
  92. /* Activate transmit Buffer Descriptor polling */
  93. fecp->fec_x_des_active = 0x01000000; /* Descriptor polling active */
  94. j = 0;
  95. while ((rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY)
  96. && (j < TOUT_LOOP)) {
  97. udelay (1);
  98. j++;
  99. }
  100. if (j >= TOUT_LOOP) {
  101. printf ("TX timeout\n");
  102. }
  103. #ifdef ET_DEBUG
  104. printf ("%s[%d] %s: cycles: %d status: %x retry cnt: %d\n",
  105. __FILE__, __LINE__, __FUNCTION__, j, rtx->txbd[txIdx].cbd_sc,
  106. (rtx->txbd[txIdx].cbd_sc & 0x003C) >> 2);
  107. #endif
  108. /* return only status bits */ ;
  109. rc = (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_STATS);
  110. txIdx = (txIdx + 1) % TX_BUF_CNT;
  111. return rc;
  112. }
  113. int eth_rx (void)
  114. {
  115. int length;
  116. volatile fec_t *fecp = (fec_t *) FEC_ADDR;
  117. for (;;) {
  118. /* section 16.9.23.2 */
  119. if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_EMPTY) {
  120. length = -1;
  121. break; /* nothing received - leave for() loop */
  122. }
  123. length = rtx->rxbd[rxIdx].cbd_datlen;
  124. if (rtx->rxbd[rxIdx].cbd_sc & 0x003f) {
  125. #ifdef ET_DEBUG
  126. printf ("%s[%d] err: %x\n",
  127. __FUNCTION__, __LINE__,
  128. rtx->rxbd[rxIdx].cbd_sc);
  129. #endif
  130. } else {
  131. /* Pass the packet up to the protocol layers. */
  132. NetReceive (NetRxPackets[rxIdx], length - 4);
  133. }
  134. /* Give the buffer back to the FEC. */
  135. rtx->rxbd[rxIdx].cbd_datlen = 0;
  136. /* wrap around buffer index when necessary */
  137. if ((rxIdx + 1) >= PKTBUFSRX) {
  138. rtx->rxbd[PKTBUFSRX - 1].cbd_sc =
  139. (BD_ENET_RX_WRAP | BD_ENET_RX_EMPTY);
  140. rxIdx = 0;
  141. } else {
  142. rtx->rxbd[rxIdx].cbd_sc = BD_ENET_RX_EMPTY;
  143. rxIdx++;
  144. }
  145. /* Try to fill Buffer Descriptors */
  146. fecp->fec_r_des_active = 0x01000000; /* Descriptor polling active */
  147. }
  148. return length;
  149. }
  150. /**************************************************************
  151. *
  152. * FEC Ethernet Initialization Routine
  153. *
  154. *************************************************************/
  155. #define FEC_ECNTRL_ETHER_EN 0x00000002
  156. #define FEC_ECNTRL_RESET 0x00000001
  157. #define FEC_RCNTRL_BC_REJ 0x00000010
  158. #define FEC_RCNTRL_PROM 0x00000008
  159. #define FEC_RCNTRL_MII_MODE 0x00000004
  160. #define FEC_RCNTRL_DRT 0x00000002
  161. #define FEC_RCNTRL_LOOP 0x00000001
  162. #define FEC_TCNTRL_FDEN 0x00000004
  163. #define FEC_TCNTRL_HBC 0x00000002
  164. #define FEC_TCNTRL_GTS 0x00000001
  165. #define FEC_RESET_DELAY 50000
  166. int eth_init (bd_t * bd)
  167. {
  168. #ifndef CFG_ENET_BD_BASE
  169. DECLARE_GLOBAL_DATA_PTR;
  170. #endif
  171. int i;
  172. volatile fec_t *fecp = (fec_t *) (FEC_ADDR);
  173. /* Whack a reset.
  174. * A delay is required between a reset of the FEC block and
  175. * initialization of other FEC registers because the reset takes
  176. * some time to complete. If you don't delay, subsequent writes
  177. * to FEC registers might get killed by the reset routine which is
  178. * still in progress.
  179. */
  180. fecp->fec_ecntrl = FEC_ECNTRL_RESET;
  181. for (i = 0;
  182. (fecp->fec_ecntrl & FEC_ECNTRL_RESET) && (i < FEC_RESET_DELAY);
  183. ++i) {
  184. udelay (1);
  185. }
  186. if (i == FEC_RESET_DELAY) {
  187. printf ("FEC_RESET_DELAY timeout\n");
  188. return 0;
  189. }
  190. /* We use strictly polling mode only
  191. */
  192. fecp->fec_imask = 0;
  193. /* Clear any pending interrupt */
  194. fecp->fec_ievent = 0xffffffff;
  195. /* Set station address */
  196. #define ea bd->bi_enetaddr
  197. fecp->fec_addr_low = (ea[0] << 24) | (ea[1] << 16) |
  198. (ea[2] << 8) | (ea[3]);
  199. fecp->fec_addr_high = (ea[4] << 24) | (ea[5] << 16);
  200. #ifdef ET_DEBUG
  201. printf ("Eth Addrs: %02x:%02x:%02x:%02x:%02x:%02x\n",
  202. ea[0], ea[1], ea[2], ea[3], ea[4], ea[5]);
  203. #endif
  204. #undef ea
  205. #ifdef CONFIG_M5271
  206. /* Clear multicast address hash table
  207. */
  208. fecp->fec_ghash_table_high = 0;
  209. fecp->fec_ghash_table_low = 0;
  210. /* Clear individual address hash table
  211. */
  212. fecp->fec_ihash_table_high = 0;
  213. fecp->fec_ihash_table_low = 0;
  214. #else
  215. /* Clear multicast address hash table
  216. */
  217. #ifdef CONFIG_M5282
  218. fecp->fec_ihash_table_high = 0;
  219. fecp->fec_ihash_table_low = 0;
  220. #else
  221. fecp->fec_hash_table_high = 0;
  222. fecp->fec_hash_table_low = 0;
  223. #endif
  224. /* Set maximum receive buffer size.
  225. */
  226. fecp->fec_r_buff_size = PKT_MAXBLR_SIZE;
  227. /*
  228. * Setup Buffers and Buffer Desriptors
  229. */
  230. rxIdx = 0;
  231. txIdx = 0;
  232. if (!rtx) {
  233. #ifdef CFG_ENET_BD_BASE
  234. rtx = (RTXBD *) CFG_ENET_BD_BASE;
  235. #else
  236. rtx = (RTXBD *) (CFG_MONITOR_BASE+gd->reloc_off -
  237. (((PKTBUFSRX+TX_BUF_CNT)*+sizeof(cbd_t)
  238. +0xFF)
  239. & ~0xFF)
  240. );
  241. debug("set ENET_DB_BASE to %lX\n",(long) rtx);
  242. #endif
  243. }
  244. /*
  245. * Setup Receiver Buffer Descriptors (13.14.24.18)
  246. * Settings:
  247. * Empty, Wrap
  248. */
  249. for (i = 0; i < PKTBUFSRX; i++) {
  250. rtx->rxbd[i].cbd_sc = BD_ENET_RX_EMPTY;
  251. rtx->rxbd[i].cbd_datlen = 0; /* Reset */
  252. rtx->rxbd[i].cbd_bufaddr = (uint) NetRxPackets[i];
  253. }
  254. rtx->rxbd[PKTBUFSRX - 1].cbd_sc |= BD_ENET_RX_WRAP;
  255. /*
  256. * Setup Ethernet Transmitter Buffer Descriptors (13.14.24.19)
  257. * Settings:
  258. * Last, Tx CRC
  259. */
  260. for (i = 0; i < TX_BUF_CNT; i++) {
  261. rtx->txbd[i].cbd_sc = BD_ENET_TX_LAST | BD_ENET_TX_TC;
  262. rtx->txbd[i].cbd_datlen = 0; /* Reset */
  263. rtx->txbd[i].cbd_bufaddr = (uint) (&txbuf[0]);
  264. }
  265. rtx->txbd[TX_BUF_CNT - 1].cbd_sc |= BD_ENET_TX_WRAP;
  266. /* Set receive and transmit descriptor base
  267. */
  268. fecp->fec_r_des_start = (unsigned int) (&rtx->rxbd[0]);
  269. fecp->fec_x_des_start = (unsigned int) (&rtx->txbd[0]);
  270. /* Enable MII mode
  271. */
  272. #if 0 /* Full duplex mode */
  273. fecp->fec_r_cntrl = FEC_RCNTRL_MII_MODE;
  274. fecp->fec_x_cntrl = FEC_TCNTRL_FDEN;
  275. #else /* Half duplex mode */
  276. fecp->fec_r_cntrl = (PKT_MAXBUF_SIZE << 16); /* set max frame length */
  277. fecp->fec_r_cntrl |= FEC_RCNTRL_MII_MODE | FEC_RCNTRL_DRT;
  278. fecp->fec_x_cntrl = 0;
  279. #endif
  280. /* Set MII speed */
  281. fecp->fec_mii_speed = (((CFG_CLK / 2) / (2500000 / 10)) + 5) / 10;
  282. fecp->fec_mii_speed *= 2;
  283. /* Configure port B for MII.
  284. */
  285. /* port initialization was already made in cpu_init_f() */
  286. /* Now enable the transmit and receive processing
  287. */
  288. fecp->fec_ecntrl = FEC_ECNTRL_ETHER_EN;
  289. #ifdef CFG_DISCOVER_PHY
  290. /* wait for the PHY to wake up after reset */
  291. mii_discover_phy ();
  292. #endif
  293. /* And last, try to fill Rx Buffer Descriptors */
  294. fecp->fec_r_des_active = 0x01000000; /* Descriptor polling active */
  295. return 1;
  296. }
  297. void eth_halt (void)
  298. {
  299. volatile fec_t *fecp = (fec_t *) FEC_ADDR;
  300. fecp->fec_ecntrl = 0;
  301. }
  302. #if defined(CFG_DISCOVER_PHY) || (CONFIG_COMMANDS & CFG_CMD_MII)
  303. static int phyaddr = -1; /* didn't find a PHY yet */
  304. static uint phytype;
  305. /* Make MII read/write commands for the FEC.
  306. */
  307. #define mk_mii_read(ADDR, REG) (0x60020000 | ((ADDR << 23) | \
  308. (REG & 0x1f) << 18))
  309. #define mk_mii_write(ADDR, REG, VAL) (0x50020000 | ((ADDR << 23) | \
  310. (REG & 0x1f) << 18) | \
  311. (VAL & 0xffff))
  312. /* Interrupt events/masks.
  313. */
  314. #define FEC_ENET_HBERR ((uint)0x80000000) /* Heartbeat error */
  315. #define FEC_ENET_BABR ((uint)0x40000000) /* Babbling receiver */
  316. #define FEC_ENET_BABT ((uint)0x20000000) /* Babbling transmitter */
  317. #define FEC_ENET_GRA ((uint)0x10000000) /* Graceful stop complete */
  318. #define FEC_ENET_TXF ((uint)0x08000000) /* Full frame transmitted */
  319. #define FEC_ENET_TXB ((uint)0x04000000) /* A buffer was transmitted */
  320. #define FEC_ENET_RXF ((uint)0x02000000) /* Full frame received */
  321. #define FEC_ENET_RXB ((uint)0x01000000) /* A buffer was received */
  322. #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */
  323. #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */
  324. /* PHY identification
  325. */
  326. #define PHY_ID_LXT970 0x78100000 /* LXT970 */
  327. #define PHY_ID_LXT971 0x001378e0 /* LXT971 and 972 */
  328. #define PHY_ID_82555 0x02a80150 /* Intel 82555 */
  329. #define PHY_ID_QS6612 0x01814400 /* QS6612 */
  330. #define PHY_ID_AMD79C784 0x00225610 /* AMD 79C784 */
  331. #define PHY_ID_LSI80225 0x0016f870 /* LSI 80225 */
  332. #define PHY_ID_LSI80225B 0x0016f880 /* LSI 80225/B */
  333. /* send command to phy using mii, wait for result */
  334. static uint mii_send (uint mii_cmd)
  335. {
  336. uint mii_reply;
  337. volatile fec_t *ep = (fec_t *) (FEC_ADDR);
  338. ep->fec_mii_data = mii_cmd; /* command to phy */
  339. /* wait for mii complete */
  340. while (!(ep->fec_ievent & FEC_ENET_MII)); /* spin until done */
  341. mii_reply = ep->fec_mii_data; /* result from phy */
  342. ep->fec_ievent = FEC_ENET_MII; /* clear MII complete */
  343. #ifdef ET_DEBUG
  344. printf ("%s[%d] %s: sent=0x%8.8x, reply=0x%8.8x\n",
  345. __FILE__, __LINE__, __FUNCTION__, mii_cmd, mii_reply);
  346. #endif
  347. return (mii_reply & 0xffff); /* data read from phy */
  348. }
  349. #endif /* CFG_DISCOVER_PHY || (CONFIG_COMMANDS & CFG_CMD_MII) */
  350. #if defined(CFG_DISCOVER_PHY)
  351. static void mii_discover_phy (void)
  352. {
  353. #define MAX_PHY_PASSES 11
  354. uint phyno;
  355. int pass;
  356. phyaddr = -1; /* didn't find a PHY yet */
  357. for (pass = 1; pass <= MAX_PHY_PASSES && phyaddr < 0; ++pass) {
  358. if (pass > 1) {
  359. /* PHY may need more time to recover from reset.
  360. * The LXT970 needs 50ms typical, no maximum is
  361. * specified, so wait 10ms before try again.
  362. * With 11 passes this gives it 100ms to wake up.
  363. */
  364. udelay (10000); /* wait 10ms */
  365. }
  366. for (phyno = 1; phyno < 32 && phyaddr < 0; ++phyno) {
  367. phytype = mii_send (mk_mii_read (phyno, PHY_PHYIDR1));
  368. #ifdef ET_DEBUG
  369. printf ("PHY type 0x%x pass %d type ", phytype, pass);
  370. #endif
  371. if (phytype != 0xffff) {
  372. phyaddr = phyno;
  373. phytype <<= 16;
  374. phytype |= mii_send (mk_mii_read (phyno,
  375. PHY_PHYIDR2));
  376. #ifdef ET_DEBUG
  377. printf ("PHY @ 0x%x pass %d type ", phyno,
  378. pass);
  379. switch (phytype & 0xfffffff0) {
  380. case PHY_ID_LXT970:
  381. printf ("LXT970\n");
  382. break;
  383. case PHY_ID_LXT971:
  384. printf ("LXT971\n");
  385. break;
  386. case PHY_ID_82555:
  387. printf ("82555\n");
  388. break;
  389. case PHY_ID_QS6612:
  390. printf ("QS6612\n");
  391. break;
  392. case PHY_ID_AMD79C784:
  393. printf ("AMD79C784\n");
  394. break;
  395. case PHY_ID_LSI80225B:
  396. printf ("LSI L80225/B\n");
  397. break;
  398. default:
  399. printf ("0x%08x\n", phytype);
  400. break;
  401. }
  402. #endif
  403. }
  404. }
  405. }
  406. if (phyaddr < 0) {
  407. printf ("No PHY device found.\n");
  408. }
  409. }
  410. #endif /* CFG_DISCOVER_PHY */
  411. #if (CONFIG_COMMANDS & CFG_CMD_MII) && !defined(CONFIG_BITBANGMII)
  412. static int mii_init_done = 0;
  413. /****************************************************************************
  414. * mii_init -- Initialize the MII for MII command without ethernet
  415. * This function is a subset of eth_init
  416. ****************************************************************************
  417. */
  418. void mii_init (void)
  419. {
  420. volatile fec_t *fecp = (fec_t *) (FEC_ADDR);
  421. int i;
  422. if (mii_init_done != 0) {
  423. return;
  424. }
  425. /* Whack a reset.
  426. * A delay is required between a reset of the FEC block and
  427. * initialization of other FEC registers because the reset takes
  428. * some time to complete. If you don't delay, subsequent writes
  429. * to FEC registers might get killed by the reset routine which is
  430. * still in progress.
  431. */
  432. fecp->fec_ecntrl = FEC_ECNTRL_RESET;
  433. for (i = 0;
  434. (fecp->fec_ecntrl & FEC_ECNTRL_RESET) && (i < FEC_RESET_DELAY);
  435. ++i) {
  436. udelay (1);
  437. }
  438. if (i == FEC_RESET_DELAY) {
  439. printf ("FEC_RESET_DELAY timeout\n");
  440. return;
  441. }
  442. /* We use strictly polling mode only
  443. */
  444. fecp->fec_imask = 0;
  445. /* Clear any pending interrupt
  446. */
  447. fecp->fec_ievent = 0xffffffff;
  448. /* Set MII speed */
  449. fecp->fec_mii_speed = 0x0e;
  450. /* Configure port B for MII.
  451. */
  452. /* port initialization was already made in cpu_init_f() */
  453. /* Now enable the transmit and receive processing */
  454. fecp->fec_ecntrl = FEC_ECNTRL_ETHER_EN;
  455. mii_init_done = 1;
  456. }
  457. /*****************************************************************************
  458. * Read and write a MII PHY register, routines used by MII Utilities
  459. *
  460. * FIXME: These routines are expected to return 0 on success, but mii_send
  461. * does _not_ return an error code. Maybe 0xFFFF means error, i.e.
  462. * no PHY connected...
  463. * For now always return 0.
  464. * FIXME: These routines only work after calling eth_init() at least once!
  465. * Otherwise they hang in mii_send() !!! Sorry!
  466. *****************************************************************************/
  467. int mcf52x2_miiphy_read (char *devname, unsigned char addr,
  468. unsigned char reg, unsigned short *value)
  469. {
  470. short rdreg; /* register working value */
  471. #ifdef MII_DEBUG
  472. printf ("miiphy_read(0x%x) @ 0x%x = ", reg, addr);
  473. #endif
  474. rdreg = mii_send (mk_mii_read (addr, reg));
  475. *value = rdreg;
  476. #ifdef MII_DEBUG
  477. printf ("0x%04x\n", *value);
  478. #endif
  479. return 0;
  480. }
  481. int mcf52x2_miiphy_write (char *devname, unsigned char addr,
  482. unsigned char reg, unsigned short value)
  483. {
  484. short rdreg; /* register working value */
  485. #ifdef MII_DEBUG
  486. printf ("miiphy_write(0x%x) @ 0x%x = ", reg, addr);
  487. #endif
  488. rdreg = mii_send (mk_mii_write (addr, reg, value));
  489. #ifdef MII_DEBUG
  490. printf ("0x%04x\n", value);
  491. #endif
  492. return 0;
  493. }
  494. #endif /* (CONFIG_COMMANDS & CFG_CMD_MII) && !defined(CONFIG_BITBANGMII) */
  495. #endif /* CFG_CMD_NET, FEC_ENET */
  496. int mcf52x2_miiphy_initialize(bd_t *bis)
  497. {
  498. #if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET)
  499. #if (CONFIG_COMMANDS & CFG_CMD_MII) && !defined(CONFIG_BITBANGMII)
  500. miiphy_register("mcf52x2phy", mcf52x2_miiphy_read, mcf52x2_miiphy_write);
  501. #endif
  502. #endif
  503. return 0;
  504. }