1
0

950-cpmac_titan.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --- a/drivers/net/ethernet/ti/cpmac.c
  2. +++ b/drivers/net/ethernet/ti/cpmac.c
  3. @@ -1124,6 +1124,8 @@ static int cpmac_probe(struct platform_d
  4. goto fail;
  5. }
  6. + ar7_device_reset(pdata->reset_bit);
  7. +
  8. dev->irq = platform_get_irq_byname(pdev, "irq");
  9. dev->netdev_ops = &cpmac_netdev_ops;
  10. @@ -1203,7 +1205,7 @@ int cpmac_init(void)
  11. cpmac_mii->write = cpmac_mdio_write;
  12. cpmac_mii->reset = cpmac_mdio_reset;
  13. - cpmac_mii->priv = ioremap(AR7_REGS_MDIO, 256);
  14. + cpmac_mii->priv = ioremap(ar7_is_titan() ? TITAN_REGS_MDIO : AR7_REGS_MDIO, 256);
  15. if (!cpmac_mii->priv) {
  16. pr_err("Can't ioremap mdio registers\n");
  17. @@ -1214,10 +1216,16 @@ int cpmac_init(void)
  18. /* FIXME: unhardcode gpio&reset bits */
  19. ar7_gpio_disable(26);
  20. ar7_gpio_disable(27);
  21. - ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
  22. - ar7_device_reset(AR7_RESET_BIT_CPMAC_HI);
  23. +
  24. + if (!ar7_is_titan()) {
  25. + ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
  26. + ar7_device_reset(AR7_RESET_BIT_CPMAC_HI);
  27. + }
  28. ar7_device_reset(AR7_RESET_BIT_EPHY);
  29. + if (ar7_is_titan())
  30. + ar7_device_reset(TITAN_RESET_BIT_EPHY1);
  31. +
  32. cpmac_mii->reset(cpmac_mii);
  33. for (i = 0; i < 300; i++) {
  34. @@ -1234,7 +1242,11 @@ int cpmac_init(void)
  35. mask = 0;
  36. }
  37. - cpmac_mii->phy_mask = ~(mask | 0x80000000);
  38. + if (ar7_is_titan())
  39. + cpmac_mii->phy_mask = ~(mask | 0x80000000 | 0x40000000);
  40. + else
  41. + cpmac_mii->phy_mask = ~(mask | 0x80000000);
  42. +
  43. snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "cpmac-1");
  44. res = mdiobus_register(cpmac_mii);