uec_phy.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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)) & (MIIMIND_NOT_VALID | MIIMIND_BUSY));
  93. udelay(100000);
  94. /* Read MII management status */
  95. value = (u16)in_be32(&ug_regs->miimstat);
  96. if(value == 0xffff)
  97. ugphy_warn("read wrong value : mii_id %d,mii_reg %d, base %08x",
  98. mii_id, mii_reg, (u32) &(ug_regs->miimcfg));
  99. return (value);
  100. }
  101. void mii_clear_phy_interrupt(struct uec_mii_info *mii_info)
  102. {
  103. if(mii_info->phyinfo->ack_interrupt)
  104. mii_info->phyinfo->ack_interrupt(mii_info);
  105. }
  106. void mii_configure_phy_interrupt(struct uec_mii_info *mii_info, u32 interrupts)
  107. {
  108. mii_info->interrupts = interrupts;
  109. if(mii_info->phyinfo->config_intr)
  110. mii_info->phyinfo->config_intr(mii_info);
  111. }
  112. /* Writes MII_ADVERTISE with the appropriate values, after
  113. * sanitizing advertise to make sure only supported features
  114. * are advertised
  115. */
  116. static void config_genmii_advert(struct uec_mii_info *mii_info)
  117. {
  118. u32 advertise;
  119. u16 adv;
  120. /* Only allow advertising what this PHY supports */
  121. mii_info->advertising &= mii_info->phyinfo->features;
  122. advertise = mii_info->advertising;
  123. /* Setup standard advertisement */
  124. adv = phy_read(mii_info, PHY_ANAR);
  125. adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
  126. if (advertise & ADVERTISED_10baseT_Half)
  127. adv |= ADVERTISE_10HALF;
  128. if (advertise & ADVERTISED_10baseT_Full)
  129. adv |= ADVERTISE_10FULL;
  130. if (advertise & ADVERTISED_100baseT_Half)
  131. adv |= ADVERTISE_100HALF;
  132. if (advertise & ADVERTISED_100baseT_Full)
  133. adv |= ADVERTISE_100FULL;
  134. phy_write(mii_info, PHY_ANAR, adv);
  135. }
  136. static void genmii_setup_forced(struct uec_mii_info *mii_info)
  137. {
  138. u16 ctrl;
  139. u32 features = mii_info->phyinfo->features;
  140. ctrl = phy_read(mii_info, PHY_BMCR);
  141. ctrl &= ~(PHY_BMCR_DPLX|PHY_BMCR_100_MBPS|
  142. PHY_BMCR_1000_MBPS|PHY_BMCR_AUTON);
  143. ctrl |= PHY_BMCR_RESET;
  144. switch(mii_info->speed) {
  145. case SPEED_1000:
  146. if(features & (SUPPORTED_1000baseT_Half
  147. | SUPPORTED_1000baseT_Full)) {
  148. ctrl |= PHY_BMCR_1000_MBPS;
  149. break;
  150. }
  151. mii_info->speed = SPEED_100;
  152. case SPEED_100:
  153. if (features & (SUPPORTED_100baseT_Half
  154. | SUPPORTED_100baseT_Full)) {
  155. ctrl |= PHY_BMCR_100_MBPS;
  156. break;
  157. }
  158. mii_info->speed = SPEED_10;
  159. case SPEED_10:
  160. if (features & (SUPPORTED_10baseT_Half
  161. | SUPPORTED_10baseT_Full))
  162. break;
  163. default: /* Unsupported speed! */
  164. ugphy_err("%s: Bad speed!", mii_info->dev->name);
  165. break;
  166. }
  167. phy_write(mii_info, PHY_BMCR, ctrl);
  168. }
  169. /* Enable and Restart Autonegotiation */
  170. static void genmii_restart_aneg(struct uec_mii_info *mii_info)
  171. {
  172. u16 ctl;
  173. ctl = phy_read(mii_info, PHY_BMCR);
  174. ctl |= (PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
  175. phy_write(mii_info, PHY_BMCR, ctl);
  176. }
  177. static int gbit_config_aneg(struct uec_mii_info *mii_info)
  178. {
  179. u16 adv;
  180. u32 advertise;
  181. if(mii_info->autoneg) {
  182. /* Configure the ADVERTISE register */
  183. config_genmii_advert(mii_info);
  184. advertise = mii_info->advertising;
  185. adv = phy_read(mii_info, MII_1000BASETCONTROL);
  186. adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP |
  187. MII_1000BASETCONTROL_HALFDUPLEXCAP);
  188. if (advertise & SUPPORTED_1000baseT_Half)
  189. adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP;
  190. if (advertise & SUPPORTED_1000baseT_Full)
  191. adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP;
  192. phy_write(mii_info, MII_1000BASETCONTROL, adv);
  193. /* Start/Restart aneg */
  194. genmii_restart_aneg(mii_info);
  195. } else
  196. genmii_setup_forced(mii_info);
  197. return 0;
  198. }
  199. static int marvell_config_aneg(struct uec_mii_info *mii_info)
  200. {
  201. /* The Marvell PHY has an errata which requires
  202. * that certain registers get written in order
  203. * to restart autonegotiation */
  204. phy_write(mii_info, PHY_BMCR, PHY_BMCR_RESET);
  205. phy_write(mii_info, 0x1d, 0x1f);
  206. phy_write(mii_info, 0x1e, 0x200c);
  207. phy_write(mii_info, 0x1d, 0x5);
  208. phy_write(mii_info, 0x1e, 0);
  209. phy_write(mii_info, 0x1e, 0x100);
  210. gbit_config_aneg(mii_info);
  211. return 0;
  212. }
  213. static int genmii_config_aneg(struct uec_mii_info *mii_info)
  214. {
  215. if (mii_info->autoneg) {
  216. config_genmii_advert(mii_info);
  217. genmii_restart_aneg(mii_info);
  218. } else
  219. genmii_setup_forced(mii_info);
  220. return 0;
  221. }
  222. static int genmii_update_link(struct uec_mii_info *mii_info)
  223. {
  224. u16 status;
  225. /* Do a fake read */
  226. phy_read(mii_info, PHY_BMSR);
  227. /* Read link and autonegotiation status */
  228. status = phy_read(mii_info, PHY_BMSR);
  229. if ((status & PHY_BMSR_LS) == 0)
  230. mii_info->link = 0;
  231. else
  232. mii_info->link = 1;
  233. /* If we are autonegotiating, and not done,
  234. * return an error */
  235. if (mii_info->autoneg && !(status & PHY_BMSR_AUTN_COMP))
  236. return -EAGAIN;
  237. return 0;
  238. }
  239. static int genmii_read_status(struct uec_mii_info *mii_info)
  240. {
  241. u16 status;
  242. int err;
  243. /* Update the link, but return if there
  244. * was an error */
  245. err = genmii_update_link(mii_info);
  246. if (err)
  247. return err;
  248. if (mii_info->autoneg) {
  249. status = phy_read(mii_info, PHY_ANLPAR);
  250. if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD))
  251. mii_info->duplex = DUPLEX_FULL;
  252. else
  253. mii_info->duplex = DUPLEX_HALF;
  254. if (status & (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX))
  255. mii_info->speed = SPEED_100;
  256. else
  257. mii_info->speed = SPEED_10;
  258. mii_info->pause = 0;
  259. }
  260. /* On non-aneg, we assume what we put in BMCR is the speed,
  261. * though magic-aneg shouldn't prevent this case from occurring
  262. */
  263. return 0;
  264. }
  265. static int marvell_read_status(struct uec_mii_info *mii_info)
  266. {
  267. u16 status;
  268. int err;
  269. /* Update the link, but return if there
  270. * was an error */
  271. err = genmii_update_link(mii_info);
  272. if (err)
  273. return err;
  274. /* If the link is up, read the speed and duplex */
  275. /* If we aren't autonegotiating, assume speeds
  276. * are as set */
  277. if (mii_info->autoneg && mii_info->link) {
  278. int speed;
  279. status = phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS);
  280. /* Get the duplexity */
  281. if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX)
  282. mii_info->duplex = DUPLEX_FULL;
  283. else
  284. mii_info->duplex = DUPLEX_HALF;
  285. /* Get the speed */
  286. speed = status & MII_M1011_PHY_SPEC_STATUS_SPD_MASK;
  287. switch(speed) {
  288. case MII_M1011_PHY_SPEC_STATUS_1000:
  289. mii_info->speed = SPEED_1000;
  290. break;
  291. case MII_M1011_PHY_SPEC_STATUS_100:
  292. mii_info->speed = SPEED_100;
  293. break;
  294. default:
  295. mii_info->speed = SPEED_10;
  296. break;
  297. }
  298. mii_info->pause = 0;
  299. }
  300. return 0;
  301. }
  302. static int marvell_ack_interrupt(struct uec_mii_info *mii_info)
  303. {
  304. /* Clear the interrupts by reading the reg */
  305. phy_read(mii_info, MII_M1011_IEVENT);
  306. return 0;
  307. }
  308. static int marvell_config_intr(struct uec_mii_info *mii_info)
  309. {
  310. if(mii_info->interrupts == MII_INTERRUPT_ENABLED)
  311. phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT);
  312. else
  313. phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR);
  314. return 0;
  315. }
  316. static int dm9161_init(struct uec_mii_info *mii_info)
  317. {
  318. /* Reset the PHY */
  319. phy_write(mii_info, PHY_BMCR, phy_read(mii_info, PHY_BMCR) |
  320. PHY_BMCR_RESET);
  321. /* PHY and MAC connect*/
  322. phy_write(mii_info, PHY_BMCR, phy_read(mii_info, PHY_BMCR) &
  323. ~PHY_BMCR_ISO);
  324. #ifdef CONFIG_RMII_MODE
  325. phy_write(mii_info, MII_DM9161_SCR, MII_DM9161_SCR_RMII_INIT);
  326. #else
  327. phy_write(mii_info, MII_DM9161_SCR, MII_DM9161_SCR_INIT);
  328. #endif
  329. config_genmii_advert(mii_info);
  330. /* Start/restart aneg */
  331. genmii_config_aneg(mii_info);
  332. /* Delay to wait the aneg compeleted */
  333. udelay(3000000);
  334. return 0;
  335. }
  336. static int dm9161_config_aneg(struct uec_mii_info *mii_info)
  337. {
  338. return 0;
  339. }
  340. static int dm9161_read_status(struct uec_mii_info *mii_info)
  341. {
  342. u16 status;
  343. int err;
  344. /* Update the link, but return if there was an error*/
  345. err = genmii_update_link(mii_info);
  346. if (err)
  347. return err;
  348. /* If the link is up, read the speed and duplex
  349. If we aren't autonegotiating assume speeds are as set */
  350. if (mii_info->autoneg && mii_info->link) {
  351. status = phy_read(mii_info, MII_DM9161_SCSR);
  352. if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H))
  353. mii_info->speed = SPEED_100;
  354. else
  355. mii_info->speed = SPEED_10;
  356. if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_10F))
  357. mii_info->duplex = DUPLEX_FULL;
  358. else
  359. mii_info->duplex = DUPLEX_HALF;
  360. }
  361. return 0;
  362. }
  363. static int dm9161_ack_interrupt(struct uec_mii_info *mii_info)
  364. {
  365. /* Clear the interrupt by reading the reg */
  366. phy_read(mii_info, MII_DM9161_INTR);
  367. return 0;
  368. }
  369. static int dm9161_config_intr(struct uec_mii_info *mii_info)
  370. {
  371. if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
  372. phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT);
  373. else
  374. phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP);
  375. return 0;
  376. }
  377. static void dm9161_close(struct uec_mii_info *mii_info)
  378. {
  379. }
  380. static struct phy_info phy_info_dm9161 = {
  381. .phy_id = 0x0181b880,
  382. .phy_id_mask = 0x0ffffff0,
  383. .name = "Davicom DM9161E",
  384. .init = dm9161_init,
  385. .config_aneg = dm9161_config_aneg,
  386. .read_status = dm9161_read_status,
  387. .close = dm9161_close,
  388. };
  389. static struct phy_info phy_info_dm9161a = {
  390. .phy_id = 0x0181b8a0,
  391. .phy_id_mask = 0x0ffffff0,
  392. .name = "Davicom DM9161A",
  393. .features = MII_BASIC_FEATURES,
  394. .init = dm9161_init,
  395. .config_aneg = dm9161_config_aneg,
  396. .read_status = dm9161_read_status,
  397. .ack_interrupt = dm9161_ack_interrupt,
  398. .config_intr = dm9161_config_intr,
  399. .close = dm9161_close,
  400. };
  401. static struct phy_info phy_info_marvell = {
  402. .phy_id = 0x01410c00,
  403. .phy_id_mask = 0xffffff00,
  404. .name = "Marvell 88E11x1",
  405. .features = MII_GBIT_FEATURES,
  406. .config_aneg = &marvell_config_aneg,
  407. .read_status = &marvell_read_status,
  408. .ack_interrupt = &marvell_ack_interrupt,
  409. .config_intr = &marvell_config_intr,
  410. };
  411. static struct phy_info phy_info_genmii= {
  412. .phy_id = 0x00000000,
  413. .phy_id_mask = 0x00000000,
  414. .name = "Generic MII",
  415. .features = MII_BASIC_FEATURES,
  416. .config_aneg = genmii_config_aneg,
  417. .read_status = genmii_read_status,
  418. };
  419. static struct phy_info *phy_info[] = {
  420. &phy_info_dm9161,
  421. &phy_info_dm9161a,
  422. &phy_info_marvell,
  423. &phy_info_genmii,
  424. NULL
  425. };
  426. u16 phy_read(struct uec_mii_info *mii_info, u16 regnum)
  427. {
  428. return mii_info->mdio_read(mii_info->dev, mii_info->mii_id, regnum);
  429. }
  430. void phy_write(struct uec_mii_info *mii_info, u16 regnum, u16 val)
  431. {
  432. mii_info->mdio_write(mii_info->dev,
  433. mii_info->mii_id,
  434. regnum, val);
  435. }
  436. /* Use the PHY ID registers to determine what type of PHY is attached
  437. * to device dev. return a struct phy_info structure describing that PHY
  438. */
  439. struct phy_info * get_phy_info(struct uec_mii_info *mii_info)
  440. {
  441. u16 phy_reg;
  442. u32 phy_ID;
  443. int i;
  444. struct phy_info *theInfo = NULL;
  445. /* Grab the bits from PHYIR1, and put them in the upper half */
  446. phy_reg = phy_read(mii_info, PHY_PHYIDR1);
  447. phy_ID = (phy_reg & 0xffff) << 16;
  448. /* Grab the bits from PHYIR2, and put them in the lower half */
  449. phy_reg = phy_read(mii_info, PHY_PHYIDR2);
  450. phy_ID |= (phy_reg & 0xffff);
  451. /* loop through all the known PHY types, and find one that */
  452. /* matches the ID we read from the PHY. */
  453. for (i = 0; phy_info[i]; i++)
  454. if (phy_info[i]->phy_id ==
  455. (phy_ID & phy_info[i]->phy_id_mask)) {
  456. theInfo = phy_info[i];
  457. break;
  458. }
  459. /* This shouldn't happen, as we have generic PHY support */
  460. if (theInfo == NULL) {
  461. ugphy_info("UEC: PHY id %x is not supported!", phy_ID);
  462. return NULL;
  463. } else {
  464. ugphy_info("UEC: PHY is %s (%x)", theInfo->name, phy_ID);
  465. }
  466. return theInfo;
  467. }
  468. void marvell_phy_interface_mode(struct eth_device *dev, enet_interface_e mode)
  469. {
  470. uec_private_t *uec = (uec_private_t *)dev->priv;
  471. struct uec_mii_info *mii_info;
  472. if (!uec->mii_info) {
  473. printf("%s: the PHY not intialized\n", __FUNCTION__);
  474. return;
  475. }
  476. mii_info = uec->mii_info;
  477. if (mode == ENET_100_RGMII) {
  478. phy_write(mii_info, 0x00, 0x9140);
  479. phy_write(mii_info, 0x1d, 0x001f);
  480. phy_write(mii_info, 0x1e, 0x200c);
  481. phy_write(mii_info, 0x1d, 0x0005);
  482. phy_write(mii_info, 0x1e, 0x0000);
  483. phy_write(mii_info, 0x1e, 0x0100);
  484. phy_write(mii_info, 0x09, 0x0e00);
  485. phy_write(mii_info, 0x04, 0x01e1);
  486. phy_write(mii_info, 0x00, 0x9140);
  487. phy_write(mii_info, 0x00, 0x1000);
  488. udelay(100000);
  489. phy_write(mii_info, 0x00, 0x2900);
  490. phy_write(mii_info, 0x14, 0x0cd2);
  491. phy_write(mii_info, 0x00, 0xa100);
  492. phy_write(mii_info, 0x09, 0x0000);
  493. phy_write(mii_info, 0x1b, 0x800b);
  494. phy_write(mii_info, 0x04, 0x05e1);
  495. phy_write(mii_info, 0x00, 0xa100);
  496. phy_write(mii_info, 0x00, 0x2100);
  497. udelay(1000000);
  498. } else if (mode == ENET_10_RGMII) {
  499. phy_write(mii_info, 0x14, 0x8e40);
  500. phy_write(mii_info, 0x1b, 0x800b);
  501. phy_write(mii_info, 0x14, 0x0c82);
  502. phy_write(mii_info, 0x00, 0x8100);
  503. udelay(1000000);
  504. }
  505. }
  506. void change_phy_interface_mode(struct eth_device *dev, enet_interface_e mode)
  507. {
  508. #ifdef CONFIG_PHY_MODE_NEED_CHANGE
  509. marvell_phy_interface_mode(dev, mode);
  510. #endif
  511. }
  512. #endif /* CONFIG_QE */