710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 4abdde3ad6bc0b3b157c4bf6ec0bf139d11d07e8 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
  3. Date: Wed, 13 May 2015 14:13:28 +0200
  4. Subject: [PATCH] b53: add hacky CPU port fixes for devices not using port 5
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  9. ---
  10. drivers/net/phy/b53/b53_common.c | 6 ++++++
  11. 1 file changed, 6 insertions(+)
  12. --- a/drivers/net/phy/b53/b53_common.c
  13. +++ b/drivers/net/phy/b53/b53_common.c
  14. @@ -25,6 +25,7 @@
  15. #include <linux/module.h>
  16. #include <linux/switch.h>
  17. #include <linux/platform_data/b53.h>
  18. +#include <linux/of.h>
  19. #include "b53_regs.h"
  20. #include "b53_priv.h"
  21. @@ -1383,6 +1384,28 @@ static int b53_switch_init(struct b53_de
  22. sw_dev->cpu_port = 5;
  23. }
  24. + /* Set correct CPU port */
  25. + if (of_machine_is_compatible("asus,rt-ac87u"))
  26. + sw_dev->cpu_port = 7;
  27. + else if (of_machine_is_compatible("netgear,r7900"))
  28. + sw_dev->cpu_port = 8;
  29. + else if (of_machine_is_compatible("netgear,r8000"))
  30. + sw_dev->cpu_port = 8;
  31. + else if (of_machine_is_compatible("netgear,r8500"))
  32. + sw_dev->cpu_port = 8;
  33. +
  34. + /* Enable extra ports */
  35. + if (of_machine_is_compatible("tenda,ac9"))
  36. + dev->enabled_ports |= BIT(5);
  37. +
  38. + /*
  39. + * Workaround for devices using port 8 (connected to the 3rd iface).
  40. + * For some reason it doesn't work (no packets on eth2).
  41. + */
  42. + if (of_machine_is_compatible("netgear,r7900") ||
  43. + of_machine_is_compatible("netgear,r8000"))
  44. + sw_dev->cpu_port = 5;
  45. +
  46. dev->enabled_ports |= BIT(sw_dev->cpu_port);
  47. sw_dev->ports = fls(dev->enabled_ports);