devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding
@ 2016-04-29 18:10 Iyappan Subramanian
  2016-04-29 18:10 ` [PATCH v2 1/3] drivers: net: xgene: " Iyappan Subramanian
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Iyappan Subramanian @ 2016-04-29 18:10 UTC (permalink / raw)
  To: davem, netdev, devicetree; +Cc: linux-arm-kernel, patches, Iyappan Subramanian

This patch set adds 'channel' property to get ethernet to CPU channel number,
thus decoupling the Linux driver from static resource selection.

v2: Address review comments from v1
- removed irq reference from Linux driver
- added 'channel' property to get ethernet to CPU channel number

v1:
- Initial version

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
---

Iyappan Subramanian (3):
  drivers: net: xgene: Get channel number from device binding
  Documentation: dtb: xgene: Add channel property
  dtb: xgene: Add channel property

 Documentation/devicetree/bindings/net/apm-xgene-enet.txt |  2 ++
 arch/arm64/boot/dts/apm/apm-shadowcat.dtsi               |  1 +
 arch/arm64/boot/dts/apm/apm-storm.dtsi                   |  1 +
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c         | 15 ++++++++++++++-
 4 files changed, 18 insertions(+), 1 deletion(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/3] drivers: net: xgene: Get channel number from device binding
  2016-04-29 18:10 [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding Iyappan Subramanian
@ 2016-04-29 18:10 ` Iyappan Subramanian
  2016-04-29 18:10 ` [PATCH v2 2/3] Documentation: dtb: xgene: Add channel property Iyappan Subramanian
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Iyappan Subramanian @ 2016-04-29 18:10 UTC (permalink / raw)
  To: davem, netdev, devicetree; +Cc: linux-arm-kernel, patches, Iyappan Subramanian

This patch gets ethernet to CPU channel (prefetch buffer number) from
the newly added 'channel' property, thus decoupling Linux driver from
resource management.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 8d4c1ad..409152b 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -973,6 +973,17 @@ static enum xgene_ring_owner xgene_derive_ring_owner(struct xgene_enet_pdata *p)
 	return owner;
 }
 
+static u8 xgene_start_cpu_bufnum(struct xgene_enet_pdata *pdata)
+{
+	struct device *dev = &pdata->pdev->dev;
+	u32 cpu_bufnum;
+	int ret;
+
+	ret = device_property_read_u32(dev, "channel", &cpu_bufnum);
+
+	return (!ret) ? cpu_bufnum : pdata->cpu_bufnum;
+}
+
 static int xgene_enet_create_desc_rings(struct net_device *ndev)
 {
 	struct xgene_enet_pdata *pdata = netdev_priv(ndev);
@@ -981,13 +992,15 @@ static int xgene_enet_create_desc_rings(struct net_device *ndev)
 	struct xgene_enet_desc_ring *buf_pool = NULL;
 	enum xgene_ring_owner owner;
 	dma_addr_t dma_exp_bufs;
-	u8 cpu_bufnum = pdata->cpu_bufnum;
+	u8 cpu_bufnum;
 	u8 eth_bufnum = pdata->eth_bufnum;
 	u8 bp_bufnum = pdata->bp_bufnum;
 	u16 ring_num = pdata->ring_num;
 	u16 ring_id;
 	int i, ret, size;
 
+	cpu_bufnum = xgene_start_cpu_bufnum(pdata);
+
 	for (i = 0; i < pdata->rxq_cnt; i++) {
 		/* allocate rx descriptor ring */
 		owner = xgene_derive_ring_owner(pdata);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] Documentation: dtb: xgene: Add channel property
  2016-04-29 18:10 [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding Iyappan Subramanian
  2016-04-29 18:10 ` [PATCH v2 1/3] drivers: net: xgene: " Iyappan Subramanian
@ 2016-04-29 18:10 ` Iyappan Subramanian
  2016-04-29 18:10 ` [PATCH v2 3/3] " Iyappan Subramanian
  2016-05-02 20:48 ` [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Iyappan Subramanian @ 2016-04-29 18:10 UTC (permalink / raw)
  To: davem, netdev, devicetree; +Cc: linux-arm-kernel, patches, Iyappan Subramanian

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
---
 Documentation/devicetree/bindings/net/apm-xgene-enet.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/apm-xgene-enet.txt b/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
index 078060a..05f705e3 100644
--- a/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
+++ b/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
@@ -18,6 +18,8 @@ Required properties for all the ethernet interfaces:
   - First is the Rx interrupt.  This irq is mandatory.
   - Second is the Tx completion interrupt.
     This is supported only on SGMII based 1GbE and 10GbE interfaces.
+- channel: Ethernet to CPU, start channel (prefetch buffer) number
+  - Must map to the first irq and irqs must be sequential
 - port-id: Port number (0 or 1)
 - clocks: Reference to the clock entry.
 - local-mac-address: MAC address assigned to this device
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] dtb: xgene: Add channel property
  2016-04-29 18:10 [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding Iyappan Subramanian
  2016-04-29 18:10 ` [PATCH v2 1/3] drivers: net: xgene: " Iyappan Subramanian
  2016-04-29 18:10 ` [PATCH v2 2/3] Documentation: dtb: xgene: Add channel property Iyappan Subramanian
@ 2016-04-29 18:10 ` Iyappan Subramanian
  2016-05-02 20:48 ` [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Iyappan Subramanian @ 2016-04-29 18:10 UTC (permalink / raw)
  To: davem, netdev, devicetree; +Cc: linux-arm-kernel, patches, Iyappan Subramanian

Added 'channel' property, describing ethernet to CPU channel number.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
---
 arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 1 +
 arch/arm64/boot/dts/apm/apm-storm.dtsi     | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
index a055a5d..ba04877 100644
--- a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
+++ b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
@@ -653,6 +653,7 @@
 				     <0 113 4>,
 				     <0 114 4>,
 				     <0 115 4>;
+			channel = <12>;
 			port-id = <1>;
 			dma-coherent;
 			clocks = <&xge1clk 0>;
diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi b/arch/arm64/boot/dts/apm/apm-storm.dtsi
index ae4a173..5147d76 100644
--- a/arch/arm64/boot/dts/apm/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi
@@ -993,6 +993,7 @@
 				     <0x0 0x65 0x4>,
 				     <0x0 0x66 0x4>,
 				     <0x0 0x67 0x4>;
+			channel = <0>;
 			dma-coherent;
 			clocks = <&xge0clk 0>;
 			/* mac address will be overwritten by the bootloader */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding
  2016-04-29 18:10 [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding Iyappan Subramanian
                   ` (2 preceding siblings ...)
  2016-04-29 18:10 ` [PATCH v2 3/3] " Iyappan Subramanian
@ 2016-05-02 20:48 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-05-02 20:48 UTC (permalink / raw)
  To: isubramanian; +Cc: netdev, devicetree, linux-arm-kernel, patches

From: Iyappan Subramanian <isubramanian@apm.com>
Date: Fri, 29 Apr 2016 11:10:12 -0700

> This patch set adds 'channel' property to get ethernet to CPU channel number,
> thus decoupling the Linux driver from static resource selection.
> 
> v2: Address review comments from v1
> - removed irq reference from Linux driver
> - added 'channel' property to get ethernet to CPU channel number
> 
> v1:
> - Initial version
> 
> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>

Series applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-02 20:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-29 18:10 [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding Iyappan Subramanian
2016-04-29 18:10 ` [PATCH v2 1/3] drivers: net: xgene: " Iyappan Subramanian
2016-04-29 18:10 ` [PATCH v2 2/3] Documentation: dtb: xgene: Add channel property Iyappan Subramanian
2016-04-29 18:10 ` [PATCH v2 3/3] " Iyappan Subramanian
2016-05-02 20:48 ` [PATCH v2 0/3] drivers: net: xgene: fix: Get channel number from device binding David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).