Skip to content

Commit e8f3f70

Browse files
committed
Merge branch 'netcp-K2G-SoC-support'
Murali Karicheri says: ==================== Add support for netcp driver on K2G SoC K2G SoC is another variant of Keystone family of SoCs. This patch series add support for NetCP driver on this SoC. The QMSS found on K2G SoC is a cut down version of the QMSS found on other keystone devices with less number of queues, internal link ram etc. The patch series has 2 patch sets that goes into the drivers/soc and the rest has to be applied to net sub system. Please review and merge if this looks good. K2G TRM is located at http://www.ti.com/lit/ug/spruhy8g/spruhy8g.pdf Thanks The boot logs on K2G ICE board (tftp boot over Ethernet and from mmc) https://pastebin.ubuntu.com/p/yvZ6drFhkW/ The boot logs on K2G GP board (tftp boot over Ethernet and from mmc) https://pastebin.ubuntu.com/p/QTr6K7s4Zp/ Also regressed boot on K2HK and K2L EVMs as we have modified GBE version detection logic (K2E uses same version of NetCP as in K2L. So regression on one of them is needed). Boot log on K2L and K2HK EVMs are at https://pastebin.ubuntu.com/p/N9DBdPjbvR/ This series applies to net-next master branch. Change history: v4 - ready for merge to net-next Folded the series "Add promiscous mode support in k2g network driver" into this. Fixed a typo in 5/11 (sgmii to rgmii) based on TI internal comment Reworked 4/11 and title changed to reflect additional changes to exclude sgmii configuration code for 2U cpsw. Use IS_SS_ID_2U() macro for customization. Added Reviewed-by from Rob Herring against 1/13 v3 - Addressed comments from Andrew Lunn and Grygorii Strashko against v2. v2 - Addressed following comments on initial version - split patch 3/5 to multiple patches from Andrew Lunn ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 0565de2 + 8585661 commit e8f3f70

File tree

9 files changed

+297
-53
lines changed

9 files changed

+297
-53
lines changed

Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ pool management.
1717

1818

1919
Required properties:
20-
- compatible : Must be "ti,keystone-navigator-qmss";
20+
- compatible : Must be "ti,keystone-navigator-qmss".
21+
: Must be "ti,66ak2g-navss-qm" for QMSS on K2G SoC.
2122
- clocks : phandle to the reference clock for this device.
2223
- queue-range : <start number> total range of queue numbers for the device.
2324
- linkram0 : <address size> for internal link ram, where size is the total
@@ -39,6 +40,12 @@ Required properties:
3940
- Descriptor memory setup region.
4041
- Queue Management/Queue Proxy region for queue Push.
4142
- Queue Management/Queue Proxy region for queue Pop.
43+
44+
For QMSS on K2G SoC, following QM reg indexes are used in that order
45+
- Queue Peek region.
46+
- Queue configuration region.
47+
- Queue Management/Queue Proxy region for queue Push/Pop.
48+
4249
- queue-pools : child node classifying the queue ranges into pools.
4350
Queue ranges are grouped into 3 type of pools:
4451
- qpend : pool of qpend(interruptible) queues

drivers/net/ethernet/ti/netcp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#define SGMII_LINK_MAC_MAC_FORCED 2
3434
#define SGMII_LINK_MAC_FIBER 3
3535
#define SGMII_LINK_MAC_PHY_NO_MDIO 4
36+
#define RGMII_LINK_MAC_PHY 5
37+
#define RGMII_LINK_MAC_PHY_NO_MDIO 7
3638
#define XGMII_LINK_MAC_PHY 10
3739
#define XGMII_LINK_MAC_MAC_FORCED 11
3840

@@ -212,6 +214,7 @@ struct netcp_module {
212214
int (*add_vid)(void *intf_priv, int vid);
213215
int (*del_vid)(void *intf_priv, int vid);
214216
int (*ioctl)(void *intf_priv, struct ifreq *req, int cmd);
217+
int (*set_rx_mode)(void *intf_priv, bool promisc);
215218

216219
/* used internally */
217220
struct list_head module_list;

drivers/net/ethernet/ti/netcp_core.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,24 @@ static void netcp_addr_sweep_add(struct netcp_intf *netcp)
15091509
}
15101510
}
15111511

1512+
static int netcp_set_promiscuous(struct netcp_intf *netcp, bool promisc)
1513+
{
1514+
struct netcp_intf_modpriv *priv;
1515+
struct netcp_module *module;
1516+
int error;
1517+
1518+
for_each_module(netcp, priv) {
1519+
module = priv->netcp_module;
1520+
if (!module->set_rx_mode)
1521+
continue;
1522+
1523+
error = module->set_rx_mode(priv->module_priv, promisc);
1524+
if (error)
1525+
return error;
1526+
}
1527+
return 0;
1528+
}
1529+
15121530
static void netcp_set_rx_mode(struct net_device *ndev)
15131531
{
15141532
struct netcp_intf *netcp = netdev_priv(ndev);
@@ -1538,6 +1556,7 @@ static void netcp_set_rx_mode(struct net_device *ndev)
15381556
/* finally sweep and callout into modules */
15391557
netcp_addr_sweep_del(netcp);
15401558
netcp_addr_sweep_add(netcp);
1559+
netcp_set_promiscuous(netcp, promisc);
15411560
spin_unlock(&netcp->lock);
15421561
}
15431562

@@ -2155,8 +2174,13 @@ static int netcp_probe(struct platform_device *pdev)
21552174
struct device_node *child, *interfaces;
21562175
struct netcp_device *netcp_device;
21572176
struct device *dev = &pdev->dev;
2177+
struct netcp_module *module;
21582178
int ret;
21592179

2180+
if (!knav_dma_device_ready() ||
2181+
!knav_qmss_device_ready())
2182+
return -EPROBE_DEFER;
2183+
21602184
if (!node) {
21612185
dev_err(dev, "could not find device info\n");
21622186
return -ENODEV;
@@ -2203,6 +2227,14 @@ static int netcp_probe(struct platform_device *pdev)
22032227
/* Add the device instance to the list */
22042228
list_add_tail(&netcp_device->device_list, &netcp_devices);
22052229

2230+
/* Probe & attach any modules already registered */
2231+
mutex_lock(&netcp_modules_lock);
2232+
for_each_netcp_module(module) {
2233+
ret = netcp_module_probe(netcp_device, module);
2234+
if (ret < 0)
2235+
dev_err(dev, "module(%s) probe failed\n", module->name);
2236+
}
2237+
mutex_unlock(&netcp_modules_lock);
22062238
return 0;
22072239

22082240
probe_quit_interface:

0 commit comments

Comments
 (0)