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

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. @@ -1370,6 +1371,18 @@ 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. +
  29. + /*
  30. + * Workaround for devices using port 8 (connected to the 3rd iface).
  31. + * For some reason it doesn't work (no packets on eth2).
  32. + */
  33. + if (of_machine_is_compatible("netgear,r8000"))
  34. + sw_dev->cpu_port = 5;
  35. +
  36. /* cpu port is always last */
  37. sw_dev->ports = sw_dev->cpu_port + 1;
  38. dev->enabled_ports |= BIT(sw_dev->cpu_port);