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

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. @@ -1313,6 +1314,20 @@ static int b53_switch_init(struct b53_de
  22. sw_dev->cpu_port = 5;
  23. }
  24. + if (of_machine_is_compatible("asus,rt-ac87u"))
  25. + sw_dev->cpu_port = 7;
  26. + else if (of_machine_is_compatible("netgear,r8000"))
  27. + sw_dev->cpu_port = 8;
  28. + else if (of_machine_is_compatible("netgear,r8500"))
  29. + sw_dev->cpu_port = 8;
  30. +
  31. + /*
  32. + * Workaround for devices using port 8 (connected to the 3rd iface).
  33. + * For some reason it doesn't work (no packets on eth2).
  34. + */
  35. + if (of_machine_is_compatible("netgear,r8000"))
  36. + sw_dev->cpu_port = 5;
  37. +
  38. /* cpu port is always last */
  39. sw_dev->ports = sw_dev->cpu_port + 1;
  40. dev->enabled_ports |= BIT(sw_dev->cpu_port);