0058-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From: Sven Eckelmann <sven.eckelmann@open-mesh.com>
  2. Date: Wed, 16 Mar 2016 09:27:11 +0000
  3. Subject: ar71xx: Use PHY fixups for Open Mesh MR900
  4. The delays of PHY/MAC on the MR900 are done by u-boot and OpenWrt in
  5. different ways. u-boot only modifies the ETH_CFG of the QCA955x based on
  6. the link speed. But OpenWrt can only modify the PHY delays based on the
  7. link speed.
  8. This can lead to communication problems when u-boot initializes the ETH_CFG
  9. for a specific link speed (e.g. 10BASE-T) but then OpenWrt the sets the PHY
  10. delays to an incompatible value.
  11. Instead reset the ETH_CFG delay bits of the QCA955x to a specific value and
  12. only rely on the AT803x PHY settings.
  13. Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
  14. Backport of r49030
  15. Forwarded: https://patchwork.ozlabs.org/patch/624185/
  16. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c
  17. index 9c3164d..3634bf0 100644
  18. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c
  19. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c
  20. @@ -23,6 +23,7 @@
  21. #include <linux/ath9k_platform.h>
  22. #include <asm/mach-ath79/ar71xx_regs.h>
  23. +#include <linux/platform_data/phy-at803x.h>
  24. #include "common.h"
  25. #include "dev-ap9x-pci.h"
  26. @@ -94,15 +95,30 @@ static struct gpio_keys_button mr900_gpio_keys[] __initdata = {
  27. },
  28. };
  29. +static struct at803x_platform_data mr900_at803x_data = {
  30. + .disable_smarteee = 1,
  31. + .enable_rgmii_rx_delay = 1,
  32. + .enable_rgmii_tx_delay = 0,
  33. + .fixup_rgmii_tx_delay = 1,
  34. +};
  35. +
  36. +static struct mdio_board_info mr900_mdio0_info[] = {
  37. + {
  38. + .bus_id = "ag71xx-mdio.0",
  39. + .phy_addr = 5,
  40. + .platform_data = &mr900_at803x_data,
  41. + },
  42. +};
  43. +
  44. static void __init mr900_setup(void)
  45. {
  46. u8 *art = (u8 *)KSEG1ADDR(0x1fff0000);
  47. u8 mac[6], pcie_mac[6];
  48. struct ath9k_platform_data *pdata;
  49. - ath79_eth0_pll_data.pll_1000 = 0xbe000101;
  50. - ath79_eth0_pll_data.pll_100 = 0x80000101;
  51. - ath79_eth0_pll_data.pll_10 = 0x80001313;
  52. + ath79_eth0_pll_data.pll_1000 = 0xae000000;
  53. + ath79_eth0_pll_data.pll_100 = 0xa0000101;
  54. + ath79_eth0_pll_data.pll_10 = 0xa0001313;
  55. ath79_register_m25p80(NULL);
  56. @@ -126,6 +142,9 @@ static void __init mr900_setup(void)
  57. ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);
  58. ath79_register_mdio(0, 0x0);
  59. + mdiobus_register_board_info(mr900_mdio0_info,
  60. + ARRAY_SIZE(mr900_mdio0_info));
  61. +
  62. ath79_init_mac(ath79_eth0_data.mac_addr, art + MR900_MAC0_OFFSET, 0);
  63. /* GMAC0 is connected to the RMGII interface */