]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: bcm_sf2: Unhardcode port numbers
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 23 Oct 2015 19:11:08 +0000 (12:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Oct 2015 01:23:59 +0000 (18:23 -0700)
commit8dbb615ed3b0ddc4e02085c501a39553d36c36c6
tree7d3c6de2409ac496165853b236a9ba6b757a6b68
parentb7c2c1f6c0d8dad95930641b04dad0c72c53507a
net: dsa: bcm_sf2: Unhardcode port numbers

While the current driver mostly supports BCM7445 which has a hardcoded
location for its MoCA port on port 7 and port 0 for its internal PHY,
this is not necessarily true for all other chips out there such as
BCM3390 for instance.

Walk the list of ports from Device Tree, get their port number ("reg"
property), and then parse the "phy-mode" property and initialize two
internal variables: moca_port and a bitmask of internal PHYs. Since we
use interrupts for the MoCA port, we introduce two helper functions to
enable/disable interrupts and do this at the appropriate bank (INTRL2_0
or INTRL2_1).

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/bcm_sf2.h