diff mbox

[LEDE-DEV] b53 cpu_port patch for cavium boards

Message ID 57401748.9010001@gmail.com
State Changes Requested
Headers show

Commit Message

Michał Osowiecki May 21, 2016, 8:07 a.m. UTC
Cisco RV042G is Cavium based router with BCM53125 switch and BCM54612E connected to port 8, and port 5 acts as cpu port. Probably Linksys LRT214 and LRT224 will be affected by this patch too (boards are identical).
I don't know if there are other Cavium boards with BCM53125. If so, this patch will need more work to detect them.

Signed-off-by: Michał Osowiecki <michal.osowiecki@gmail.com>

Comments

Hauke Mehrtens May 21, 2016, 12:44 p.m. UTC | #1
Hi,

On 05/21/2016 10:07 AM, Michał Osowiecki wrote:
> Cisco RV042G is Cavium based router with BCM53125 switch and BCM54612E
> connected to port 8, and port 5 acts as cpu port. Probably Linksys
> LRT214 and LRT224 will be affected by this patch too (boards are
> identical).
> I don't know if there are other Cavium boards with BCM53125. If so, this
> patch will need more work to detect them.
> 
> Signed-off-by: Michał Osowiecki <michal.osowiecki@gmail.com>
> 

Could you send the patch inside the text of the mail please that makes
review easier.

How is the switch connected to the main SoC? I do not like the #ifdef in
there, if it is not absolutely needed, would it be possible to extend
some platform_data structure or similar to add this?

Hauke
diff mbox

Patch

--- a/drivers/net/phy/b53/b53_common.c
+++ b/drivers/net/phy/b53/b53_common.c
@@ -1372,6 +1372,14 @@ 
 
 	/* cpu port is always last */
 	sw_dev->ports = sw_dev->cpu_port + 1;
+#ifdef CONFIG_CAVIUM_OCTEON_SOC
+	if (dev->chip_id == BCM53125_DEVICE_ID) {
+		/* CISCO RV042G */
+		sw_dev->cpu_port = 5;
+		sw_dev->ports = 9;
+		dev->enabled_ports = 0x11f;
+	}
+#endif
 	dev->enabled_ports |= BIT(sw_dev->cpu_port);
 
 	dev->ports = devm_kzalloc(dev->dev,