0051-ar71xx-fix-lan-ports-on-archer-C59-and-C60.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. From: Henryk Heisig <hyniu@o2.pl>
  2. Date: Thu, 16 Feb 2017 15:22:49 +0100
  3. Subject: ar71xx: fix lan ports on archer C59 and C60
  4. Signed-off-by: Henryk Heisig <hyniu@o2.pl>
  5. diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
  6. index 8552cde564b3fbed9425f42d5331f95fe5c3aaa8..5c6b47d0249c979934d61078e16759fc22aa41c7 100755
  7. --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
  8. +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
  9. @@ -64,8 +64,8 @@ archer-c25-v1)
  10. ;;
  11. archer-c59-v1|\
  12. archer-c60-v1)
  13. - ucidef_set_led_switch "lan" "LAN" "$board:green:lan" "switch0" "0x3C"
  14. - ucidef_set_led_switch "wan" "WAN" "$board:green:wan" "switch0" "0x02"
  15. + ucidef_set_led_switch "lan" "LAN" "$board:green:lan" "switch0" "0x1E"
  16. + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
  17. ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
  18. ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
  19. diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
  20. index 3abe1114ee31c79abb125b85119876c3d75bb7c0..933ed22815ee076c98a83173aad143c010c9a131 100755
  21. --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
  22. +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
  23. @@ -206,9 +206,15 @@ ar71xx_setup_interfaces()
  24. "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
  25. ;;
  26. archer-c59-v1|\
  27. + rb-450g)
  28. + ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
  29. + ucidef_add_switch "switch0" \
  30. + "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
  31. + ;;
  32. archer-c60-v1)
  33. + ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
  34. ucidef_add_switch "switch0" \
  35. - "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan"
  36. + "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
  37. ;;
  38. arduino-yun|\
  39. dir-505-a1|\
  40. @@ -370,11 +376,6 @@ ar71xx_setup_interfaces()
  41. ucidef_add_switch "switch0" \
  42. "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
  43. ;;
  44. - rb-450g)
  45. - ucidef_set_interfaces_lan_wan "eth1" "eth0"
  46. - ucidef_add_switch "switch0" \
  47. - "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
  48. - ;;
  49. routerstation-pro)
  50. ucidef_set_interfaces_lan_wan "eth1" "eth0"
  51. ucidef_add_switch "switch0" \
  52. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c
  53. index 28353aa77b05078b895ab48cf6b1ae53abe98ce2..d55f9b9f75b38159ed7209aa5acd73ff31088b51 100644
  54. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c
  55. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c
  56. @@ -194,19 +194,33 @@ static void __init archer_c59_v1_setup(void)
  57. ARRAY_SIZE(archer_c59_v1_gpio_keys),
  58. archer_c59_v1_gpio_keys);
  59. + ath79_setup_qca956x_eth_cfg(QCA956X_ETH_CFG_SW_PHY_SWAP |
  60. + QCA956X_ETH_CFG_SW_PHY_ADDR_SWAP);
  61. +
  62. + ath79_register_mdio(0, 0x0);
  63. ath79_register_mdio(1, 0x0);
  64. - ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
  65. + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
  66. ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
  67. +
  68. + /* WAN port */
  69. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
  70. + ath79_eth0_data.speed = SPEED_100;
  71. + ath79_eth0_data.duplex = DUPLEX_FULL;
  72. + ath79_eth0_data.phy_mask = BIT(0);
  73. + ath79_register_eth(0);
  74. +
  75. + /* LAN ports */
  76. + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
  77. ath79_eth1_data.speed = SPEED_1000;
  78. ath79_eth1_data.duplex = DUPLEX_FULL;
  79. - ath79_eth1_data.phy_mask = BIT(4);
  80. + ath79_switch_data.phy_poll_mask |= BIT(4);
  81. + ath79_switch_data.phy4_mii_en = 1;
  82. ath79_register_eth(1);
  83. ath79_register_wmac(art + ARCHER_C59_V1_WMAC_CALDATA_OFFSET, mac);
  84. ap91_pci_init(art + ARCHER_C59_V1_PCI_CALDATA_OFFSET, NULL);
  85. -
  86. ath79_register_usb();
  87. gpio_request_one(ARCHER_C59_V1_GPIO_USB_POWER,
  88. GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
  89. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c60-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c60-v1.c
  90. index 78186f02cda0a231afda4e53a1d6ff696ecb6b4a..4d83fa737b9650935b4f7f985d58f471c38cd9da 100644
  91. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c60-v1.c
  92. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c60-v1.c
  93. @@ -116,15 +116,25 @@ static void __init archer_c60_v1_setup(void)
  94. ARRAY_SIZE(archer_c60_v1_gpio_keys),
  95. archer_c60_v1_gpio_keys);
  96. - ath79_setup_qca956x_eth_cfg(QCA956X_ETH_CFG_SW_PHY_SWAP |
  97. - QCA956X_ETH_CFG_SW_PHY_ADDR_SWAP);
  98. + ath79_register_mdio(0, 0x0);
  99. ath79_register_mdio(1, 0x0);
  100. - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
  101. + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
  102. + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
  103. + /* WAN port */
  104. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
  105. + ath79_eth0_data.speed = SPEED_100;
  106. + ath79_eth0_data.duplex = DUPLEX_FULL;
  107. + ath79_eth0_data.phy_mask = BIT(4);
  108. + ath79_register_eth(0);
  109. +
  110. + /* LAN ports */
  111. ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
  112. ath79_eth1_data.speed = SPEED_1000;
  113. ath79_eth1_data.duplex = DUPLEX_FULL;
  114. + ath79_switch_data.phy_poll_mask |= BIT(4);
  115. + ath79_switch_data.phy4_mii_en = 1;
  116. ath79_register_eth(1);
  117. ath79_register_wmac(art + ARCHER_C60_V1_WMAC_CALDATA_OFFSET, mac);