uec_phy.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /*
  2. * Copyright (C) 2005 Freescale Semiconductor, Inc.
  3. *
  4. * Author: Shlomi Gridish
  5. *
  6. * Description: UCC GETH Driver -- PHY handling
  7. * Driver for UEC on QE
  8. * Based on 8260_io/fcc_enet.c
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. *
  15. */
  16. #include "common.h"
  17. #include "net.h"
  18. #include "malloc.h"
  19. #include "asm/errno.h"
  20. #include "asm/immap_qe.h"
  21. #include "asm/io.h"
  22. #include "qe.h"
  23. #include "uccf.h"
  24. #include "uec.h"
  25. #include "uec_phy.h"
  26. #include "miiphy.h"
  27. #if defined(CONFIG_QE)
  28. #define UEC_VERBOSE_DEBUG
  29. #define ugphy_printk(format, arg...) \
  30. printf(format "\n", ## arg)
  31. #define ugphy_dbg(format, arg...) \
  32. ugphy_printk(format , ## arg)
  33. #define ugphy_err(format, arg...) \
  34. ugphy_printk(format , ## arg)
  35. #define ugphy_info(format, arg...) \
  36. ugphy_printk(format , ## arg)
  37. #define ugphy_warn(format, arg...) \
  38. ugphy_printk(format , ## arg)
  39. #ifdef UEC_VERBOSE_DEBUG
  40. #define ugphy_vdbg ugphy_dbg
  41. #else
  42. #define ugphy_vdbg(ugeth, fmt, args...) do { } while (0)
  43. #endif /* UEC_VERBOSE_DEBUG */
  44. static void config_genmii_advert (struct uec_mii_info *mii_info);
  45. static void genmii_setup_forced (struct uec_mii_info *mii_info);
  46. static void genmii_restart_aneg (struct uec_mii_info *mii_info);
  47. static int gbit_config_aneg (struct uec_mii_info *mii_info);
  48. static int genmii_config_aneg (struct uec_mii_info *mii_info);
  49. static int genmii_update_link (struct uec_mii_info *mii_info);
  50. static int genmii_read_status (struct uec_mii_info *mii_info);
  51. u16 phy_read (struct uec_mii_info *mii_info, u16 regnum);
  52. void phy_write (struct uec_mii_info *mii_info, u16 regnum, u16 val);
  53. /* Write value to the PHY for this device to the register at regnum, */
  54. /* waiting until the write is done before it returns. All PHY */
  55. /* configuration has to be done through the TSEC1 MIIM regs */
  56. void write_phy_reg (struct eth_device *dev, int mii_id, int regnum, int value)
  57. {
  58. uec_private_t *ugeth = (uec_private_t *) dev->priv;
  59. uec_t *ug_regs;
  60. enet_tbi_mii_reg_e mii_reg = (enet_tbi_mii_reg_e) regnum;
  61. u32 tmp_reg;
  62. ug_regs = ugeth->uec_regs;
  63. /* Stop the MII management read cycle */
  64. out_be32 (&ug_regs->miimcom, 0);
  65. /* Setting up the MII Mangement Address Register */
  66. tmp_reg = ((u32) mii_id << MIIMADD_PHY_ADDRESS_SHIFT) | mii_reg;
  67. out_be32 (&ug_regs->miimadd, tmp_reg);
  68. /* Setting up the MII Mangement Control Register with the value */
  69. out_be32 (&ug_regs->miimcon, (u32) value);
  70. /* Wait till MII management write is complete */
  71. while ((in_be32 (&ug_regs->miimind)) & MIIMIND_BUSY);
  72. udelay (100000);
  73. }
  74. /* Reads from register regnum in the PHY for device dev, */
  75. /* returning the value. Clears miimcom first. All PHY */
  76. /* configuration has to be done through the TSEC1 MIIM regs */
  77. int read_phy_reg (struct eth_device *dev, int mii_id, int regnum)
  78. {
  79. uec_private_t *ugeth = (uec_private_t *) dev->priv;
  80. uec_t *ug_regs;
  81. enet_tbi_mii_reg_e mii_reg = (enet_tbi_mii_reg_e) regnum;
  82. u32 tmp_reg;
  83. u16 value;
  84. ug_regs = ugeth->uec_regs;
  85. /* Setting up the MII Mangement Address Register */
  86. tmp_reg = ((u32) mii_id << MIIMADD_PHY_ADDRESS_SHIFT) | mii_reg;
  87. out_be32 (&ug_regs->miimadd, tmp_reg);
  88. /* Perform an MII management read cycle */
  89. out_be32 (&ug_regs->miimcom, 0);
  90. out_be32 (&ug_regs->miimcom, MIIMCOM_READ_CYCLE);
  91. /* Wait till MII management write is complete */
  92. while ((in_be32 (&ug_regs->miimind)) &
  93. (MIIMIND_NOT_VALID | MIIMIND_BUSY));
  94. udelay (100000);
  95. /* Read MII management status */
  96. value = (u16) in_be32 (&ug_regs->miimstat);
  97. if (value == 0xffff)
  98. ugphy_warn
  99. ("read wrong value : mii_id %d,mii_reg %d, base %08x",
  100. mii_id, mii_reg, (u32) & (ug_regs->miimcfg));
  101. return (value);
  102. }
  103. void mii_clear_phy_interrupt (struct uec_mii_info *mii_info)
  104. {
  105. if (mii_info->phyinfo->ack_interrupt)
  106. mii_info->phyinfo->ack_interrupt (mii_info);
  107. }
  108. void mii_configure_phy_interrupt (struct uec_mii_info *mii_info,
  109. u32 interrupts)
  110. {
  111. mii_info->interrupts = interrupts;
  112. if (mii_info->phyinfo->config_intr)
  113. mii_info->phyinfo->config_intr (mii_info);
  114. }
  115. /* Writes MII_ADVERTISE with the appropriate values, after
  116. * sanitizing advertise to make sure only supported features
  117. * are advertised
  118. */
  119. static void config_genmii_advert (struct uec_mii_info *mii_info)
  120. {
  121. u32 advertise;
  122. u16 adv;
  123. /* Only allow advertising what this PHY supports */
  124. mii_info->advertising &= mii_info->phyinfo->features;
  125. advertise = mii_info->advertising;
  126. /* Setup standard advertisement */
  127. adv = phy_read (mii_info, PHY_ANAR);
  128. adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
  129. if (advertise & ADVERTISED_10baseT_Half)
  130. adv |= ADVERTISE_10HALF;
  131. if (advertise & ADVERTISED_10baseT_Full)
  132. adv |= ADVERTISE_10FULL;
  133. if (advertise & ADVERTISED_100baseT_Half)
  134. adv |= ADVERTISE_100HALF;
  135. if (advertise & ADVERTISED_100baseT_Full)
  136. adv |= ADVERTISE_100FULL;
  137. phy_write (mii_info, PHY_ANAR, adv);
  138. }
  139. static void genmii_setup_forced (struct uec_mii_info *mii_info)
  140. {
  141. u16 ctrl;
  142. u32 features = mii_info->phyinfo->features;
  143. ctrl = phy_read (mii_info, PHY_BMCR);
  144. ctrl &= ~(PHY_BMCR_DPLX | PHY_BMCR_100_MBPS |
  145. PHY_BMCR_1000_MBPS | PHY_BMCR_AUTON);
  146. ctrl |= PHY_BMCR_RESET;
  147. switch (mii_info->speed) {
  148. case SPEED_1000:
  149. if (features & (SUPPORTED_1000baseT_Half
  150. | SUPPORTED_1000baseT_Full)) {
  151. ctrl |= PHY_BMCR_1000_MBPS;
  152. break;
  153. }
  154. mii_info->speed = SPEED_100;
  155. case SPEED_100:
  156. if (features & (SUPPORTED_100baseT_Half
  157. | SUPPORTED_100baseT_Full)) {
  158. ctrl |= PHY_BMCR_100_MBPS;
  159. break;
  160. }
  161. mii_info->speed = SPEED_10;
  162. case SPEED_10:
  163. if (features & (SUPPORTED_10baseT_Half
  164. | SUPPORTED_10baseT_Full))
  165. break;
  166. default: /* Unsupported speed! */
  167. ugphy_err ("%s: Bad speed!", mii_info->dev->name);
  168. break;
  169. }
  170. phy_write (mii_info, PHY_BMCR, ctrl);
  171. }
  172. /* Enable and Restart Autonegotiation */
  173. static void genmii_restart_aneg (struct uec_mii_info *mii_info)
  174. {
  175. u16 ctl;
  176. ctl = phy_read (mii_info, PHY_BMCR);
  177. ctl |= (PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
  178. phy_write (mii_info, PHY_BMCR, ctl);
  179. }
  180. static int gbit_config_aneg (struct uec_mii_info *mii_info)
  181. {
  182. u16 adv;
  183. u32 advertise;
  184. if (mii_info->autoneg) {
  185. /* Configure the ADVERTISE register */
  186. config_genmii_advert (mii_info);
  187. advertise = mii_info->advertising;
  188. adv = phy_read (mii_info, MII_1000BASETCONTROL);
  189. adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP |
  190. MII_1000BASETCONTROL_HALFDUPLEXCAP);
  191. if (advertise & SUPPORTED_1000baseT_Half)
  192. adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP;
  193. if (advertise & SUPPORTED_1000baseT_Full)
  194. adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP;
  195. phy_write (mii_info, MII_1000BASETCONTROL, adv);
  196. /* Start/Restart aneg */
  197. genmii_restart_aneg (mii_info);
  198. } else
  199. genmii_setup_forced (mii_info);
  200. return 0;
  201. }
  202. static int marvell_config_aneg (struct uec_mii_info *mii_info)
  203. {
  204. /* The Marvell PHY has an errata which requires
  205. * that certain registers get written in order
  206. * to restart autonegotiation */
  207. phy_write (mii_info, PHY_BMCR, PHY_BMCR_RESET);
  208. phy_write (mii_info, 0x1d, 0x1f);
  209. phy_write (mii_info, 0x1e, 0x200c);
  210. phy_write (mii_info, 0x1d, 0x5);
  211. phy_write (mii_info, 0x1e, 0);
  212. phy_write (mii_info, 0x1e, 0x100);
  213. gbit_config_aneg (mii_info);
  214. return 0;
  215. }
  216. static int genmii_config_aneg (struct uec_mii_info *mii_info)
  217. {
  218. if (mii_info->autoneg) {
  219. config_genmii_advert (mii_info);
  220. genmii_restart_aneg (mii_info);
  221. } else
  222. genmii_setup_forced (mii_info);
  223. return 0;
  224. }
  225. static int genmii_update_link (struct uec_mii_info *mii_info)
  226. {
  227. u16 status;
  228. /* Do a fake read */
  229. phy_read (mii_info, PHY_BMSR);
  230. /* Read link and autonegotiation status */
  231. status = phy_read (mii_info, PHY_BMSR);
  232. if ((status & PHY_BMSR_LS) == 0)
  233. mii_info->link = 0;
  234. else
  235. mii_info->link = 1;
  236. /* If we are autonegotiating, and not done,
  237. * return an error */
  238. if (mii_info->autoneg && !(status & PHY_BMSR_AUTN_COMP))
  239. return -EAGAIN;
  240. return 0;
  241. }
  242. static int genmii_read_status (struct uec_mii_info *mii_info)
  243. {
  244. u16 status;
  245. int err;
  246. /* Update the link, but return if there
  247. * was an error */
  248. err = genmii_update_link (mii_info);
  249. if (err)
  250. return err;
  251. if (mii_info->autoneg) {
  252. status = phy_read (mii_info, PHY_ANLPAR);
  253. if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD))
  254. mii_info->duplex = DUPLEX_FULL;
  255. else
  256. mii_info->duplex = DUPLEX_HALF;
  257. if (status & (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX))
  258. mii_info->speed = SPEED_100;
  259. else
  260. mii_info->speed = SPEED_10;
  261. mii_info->pause = 0;
  262. }
  263. /* On non-aneg, we assume what we put in BMCR is the speed,
  264. * though magic-aneg shouldn't prevent this case from occurring
  265. */
  266. return 0;
  267. }
  268. static int marvell_read_status (struct uec_mii_info *mii_info)
  269. {
  270. u16 status;
  271. int err;
  272. /* Update the link, but return if there
  273. * was an error */
  274. err = genmii_update_link (mii_info);
  275. if (err)
  276. return err;
  277. /* If the link is up, read the speed and duplex */
  278. /* If we aren't autonegotiating, assume speeds
  279. * are as set */
  280. if (mii_info->autoneg && mii_info->link) {
  281. int speed;
  282. status = phy_read (mii_info, MII_M1011_PHY_SPEC_STATUS);
  283. /* Get the duplexity */
  284. if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX)
  285. mii_info->duplex = DUPLEX_FULL;
  286. else
  287. mii_info->duplex = DUPLEX_HALF;
  288. /* Get the speed */
  289. speed = status & MII_M1011_PHY_SPEC_STATUS_SPD_MASK;
  290. switch (speed) {
  291. case MII_M1011_PHY_SPEC_STATUS_1000:
  292. mii_info->speed = SPEED_1000;
  293. break;
  294. case MII_M1011_PHY_SPEC_STATUS_100:
  295. mii_info->speed = SPEED_100;
  296. break;
  297. default:
  298. mii_info->speed = SPEED_10;
  299. break;
  300. }
  301. mii_info->pause = 0;
  302. }
  303. return 0;
  304. }
  305. static int marvell_ack_interrupt (struct uec_mii_info *mii_info)
  306. {
  307. /* Clear the interrupts by reading the reg */
  308. phy_read (mii_info, MII_M1011_IEVENT);
  309. return 0;
  310. }
  311. static int marvell_config_intr (struct uec_mii_info *mii_info)
  312. {
  313. if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
  314. phy_write (mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT);
  315. else
  316. phy_write (mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR);
  317. return 0;
  318. }
  319. static int dm9161_init (struct uec_mii_info *mii_info)
  320. {
  321. /* Reset the PHY */
  322. phy_write (mii_info, PHY_BMCR, phy_read (mii_info, PHY_BMCR) |
  323. PHY_BMCR_RESET);
  324. /* PHY and MAC connect */
  325. phy_write (mii_info, PHY_BMCR, phy_read (mii_info, PHY_BMCR) &
  326. ~PHY_BMCR_ISO);
  327. #ifdef CONFIG_RMII_MODE
  328. phy_write (mii_info, MII_DM9161_SCR, MII_DM9161_SCR_RMII_INIT);
  329. #else
  330. phy_write (mii_info, MII_DM9161_SCR, MII_DM9161_SCR_INIT);
  331. #endif
  332. config_genmii_advert (mii_info);
  333. /* Start/restart aneg */
  334. genmii_config_aneg (mii_info);
  335. /* Delay to wait the aneg compeleted */
  336. udelay (3000000);
  337. return 0;
  338. }
  339. static int dm9161_config_aneg (struct uec_mii_info *mii_info)
  340. {
  341. return 0;
  342. }
  343. static int dm9161_read_status (struct uec_mii_info *mii_info)
  344. {
  345. u16 status;
  346. int err;
  347. /* Update the link, but return if there was an error */
  348. err = genmii_update_link (mii_info);
  349. if (err)
  350. return err;
  351. /* If the link is up, read the speed and duplex
  352. If we aren't autonegotiating assume speeds are as set */
  353. if (mii_info->autoneg && mii_info->link) {
  354. status = phy_read (mii_info, MII_DM9161_SCSR);
  355. if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H))
  356. mii_info->speed = SPEED_100;
  357. else
  358. mii_info->speed = SPEED_10;
  359. if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_10F))
  360. mii_info->duplex = DUPLEX_FULL;
  361. else
  362. mii_info->duplex = DUPLEX_HALF;
  363. }
  364. return 0;
  365. }
  366. static int dm9161_ack_interrupt (struct uec_mii_info *mii_info)
  367. {
  368. /* Clear the interrupt by reading the reg */
  369. phy_read (mii_info, MII_DM9161_INTR);
  370. return 0;
  371. }
  372. static int dm9161_config_intr (struct uec_mii_info *mii_info)
  373. {
  374. if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
  375. phy_write (mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT);
  376. else
  377. phy_write (mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP);
  378. return 0;
  379. }
  380. static void dm9161_close (struct uec_mii_info *mii_info)
  381. {
  382. }
  383. static struct phy_info phy_info_dm9161 = {
  384. .phy_id = 0x0181b880,
  385. .phy_id_mask = 0x0ffffff0,
  386. .name = "Davicom DM9161E",
  387. .init = dm9161_init,
  388. .config_aneg = dm9161_config_aneg,
  389. .read_status = dm9161_read_status,
  390. .close = dm9161_close,
  391. };
  392. static struct phy_info phy_info_dm9161a = {
  393. .phy_id = 0x0181b8a0,
  394. .phy_id_mask = 0x0ffffff0,
  395. .name = "Davicom DM9161A",
  396. .features = MII_BASIC_FEATURES,
  397. .init = dm9161_init,
  398. .config_aneg = dm9161_config_aneg,
  399. .read_status = dm9161_read_status,
  400. .ack_interrupt = dm9161_ack_interrupt,
  401. .config_intr = dm9161_config_intr,
  402. .close = dm9161_close,
  403. };
  404. static struct phy_info phy_info_marvell = {
  405. .phy_id = 0x01410c00,
  406. .phy_id_mask = 0xffffff00,
  407. .name = "Marvell 88E11x1",
  408. .features = MII_GBIT_FEATURES,
  409. .config_aneg = &marvell_config_aneg,
  410. .read_status = &marvell_read_status,
  411. .ack_interrupt = &marvell_ack_interrupt,
  412. .config_intr = &marvell_config_intr,
  413. };
  414. static struct phy_info phy_info_genmii = {
  415. .phy_id = 0x00000000,
  416. .phy_id_mask = 0x00000000,
  417. .name = "Generic MII",
  418. .features = MII_BASIC_FEATURES,
  419. .config_aneg = genmii_config_aneg,
  420. .read_status = genmii_read_status,
  421. };
  422. static struct phy_info *phy_info[] = {
  423. &phy_info_dm9161,
  424. &phy_info_dm9161a,
  425. &phy_info_marvell,
  426. &phy_info_genmii,
  427. NULL
  428. };
  429. u16 phy_read (struct uec_mii_info *mii_info, u16 regnum)
  430. {
  431. return mii_info->mdio_read (mii_info->dev, mii_info->mii_id, regnum);
  432. }
  433. void phy_write (struct uec_mii_info *mii_info, u16 regnum, u16 val)
  434. {
  435. mii_info->mdio_write (mii_info->dev, mii_info->mii_id, regnum, val);
  436. }
  437. /* Use the PHY ID registers to determine what type of PHY is attached
  438. * to device dev. return a struct phy_info structure describing that PHY
  439. */
  440. struct phy_info *get_phy_info (struct uec_mii_info *mii_info)
  441. {
  442. u16 phy_reg;
  443. u32 phy_ID;
  444. int i;
  445. struct phy_info *theInfo = NULL;
  446. /* Grab the bits from PHYIR1, and put them in the upper half */
  447. phy_reg = phy_read (mii_info, PHY_PHYIDR1);
  448. phy_ID = (phy_reg & 0xffff) << 16;
  449. /* Grab the bits from PHYIR2, and put them in the lower half */
  450. phy_reg = phy_read (mii_info, PHY_PHYIDR2);
  451. phy_ID |= (phy_reg & 0xffff);
  452. /* loop through all the known PHY types, and find one that */
  453. /* matches the ID we read from the PHY. */
  454. for (i = 0; phy_info[i]; i++)
  455. if (phy_info[i]->phy_id ==
  456. (phy_ID & phy_info[i]->phy_id_mask)) {
  457. theInfo = phy_info[i];
  458. break;
  459. }
  460. /* This shouldn't happen, as we have generic PHY support */
  461. if (theInfo == NULL) {
  462. ugphy_info ("UEC: PHY id %x is not supported!", phy_ID);
  463. return NULL;
  464. } else {
  465. ugphy_info ("UEC: PHY is %s (%x)", theInfo->name, phy_ID);
  466. }
  467. return theInfo;
  468. }
  469. void marvell_phy_interface_mode (struct eth_device *dev,
  470. enet_interface_e mode)
  471. {
  472. uec_private_t *uec = (uec_private_t *) dev->priv;
  473. struct uec_mii_info *mii_info;
  474. if (!uec->mii_info) {
  475. printf ("%s: the PHY not intialized\n", __FUNCTION__);
  476. return;
  477. }
  478. mii_info = uec->mii_info;
  479. if (mode == ENET_100_RGMII) {
  480. phy_write (mii_info, 0x00, 0x9140);
  481. phy_write (mii_info, 0x1d, 0x001f);
  482. phy_write (mii_info, 0x1e, 0x200c);
  483. phy_write (mii_info, 0x1d, 0x0005);
  484. phy_write (mii_info, 0x1e, 0x0000);
  485. phy_write (mii_info, 0x1e, 0x0100);
  486. phy_write (mii_info, 0x09, 0x0e00);
  487. phy_write (mii_info, 0x04, 0x01e1);
  488. phy_write (mii_info, 0x00, 0x9140);
  489. phy_write (mii_info, 0x00, 0x1000);
  490. udelay (100000);
  491. phy_write (mii_info, 0x00, 0x2900);
  492. phy_write (mii_info, 0x14, 0x0cd2);
  493. phy_write (mii_info, 0x00, 0xa100);
  494. phy_write (mii_info, 0x09, 0x0000);
  495. phy_write (mii_info, 0x1b, 0x800b);
  496. phy_write (mii_info, 0x04, 0x05e1);
  497. phy_write (mii_info, 0x00, 0xa100);
  498. phy_write (mii_info, 0x00, 0x2100);
  499. udelay (1000000);
  500. } else if (mode == ENET_10_RGMII) {
  501. phy_write (mii_info, 0x14, 0x8e40);
  502. phy_write (mii_info, 0x1b, 0x800b);
  503. phy_write (mii_info, 0x14, 0x0c82);
  504. phy_write (mii_info, 0x00, 0x8100);
  505. udelay (1000000);
  506. }
  507. }
  508. void change_phy_interface_mode (struct eth_device *dev, enet_interface_e mode)
  509. {
  510. #ifdef CONFIG_PHY_MODE_NEED_CHANGE
  511. marvell_phy_interface_mode (dev, mode);
  512. #endif
  513. }
  514. #endif /* CONFIG_QE */