diff mbox series

[v5,1/2] dt-bindings: net: Add bindings for National Instruments XGE netdev

Message ID 20180323204128.29783-1-mdf@kernel.org
State Not Applicable, archived
Headers show
Series [v5,1/2] dt-bindings: net: Add bindings for National Instruments XGE netdev | expand

Commit Message

Moritz Fischer March 23, 2018, 8:41 p.m. UTC
This adds bindings for the NI XGE 1G/10G network device.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
---
Changes from v4:
- None

Changes from v3:
- Added Rob's Reviewed-by

Changes from v2:
- Addressed Rob's comments w.r.t to IRQ names and typo

Changes from v1:
- Corrected from nixge -> nixge.txt

---
 Documentation/devicetree/bindings/net/nixge.txt | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/nixge.txt

Comments

David Miller March 26, 2018, 3:38 p.m. UTC | #1
From: Moritz Fischer <mdf@kernel.org>
Date: Fri, 23 Mar 2018 13:41:28 -0700

> +static void nixge_hw_dma_bd_release(struct net_device *ndev)
> +{
> +	int i;
> +	struct nixge_priv *priv = netdev_priv(ndev);

Please order local variables from longest to shortest line (ie. reverse
christmas tree layout).

> +static int nixge_hw_dma_bd_init(struct net_device *ndev)
> +{
> +	u32 cr;
> +	int i;
> +	struct sk_buff *skb;
> +	struct nixge_priv *priv = netdev_priv(ndev);

Likewise.

> +static void __nixge_device_reset(struct nixge_priv *priv, off_t offset)
> +{
> +	u32 status;
> +	int err;
> +	/* Reset Axi DMA. This would reset NIXGE Ethernet core as well.
> +	 * The reset process of Axi DMA takes a while to complete as all
> +	 * pending commands/transfers will be flushed or completed during
> +	 * this reset process.
> +	 */

Please put an empty line between the local variable declarations
and this comment.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Moritz Fischer March 26, 2018, 3:56 p.m. UTC | #2
Hi David,

On Mon, Mar 26, 2018 at 11:38:30AM -0400, David Miller wrote:
> From: Moritz Fischer <mdf@kernel.org>
> Date: Fri, 23 Mar 2018 13:41:28 -0700
> 
> > +static void nixge_hw_dma_bd_release(struct net_device *ndev)
> > +{
> > +	int i;
> > +	struct nixge_priv *priv = netdev_priv(ndev);
> 
> Please order local variables from longest to shortest line (ie. reverse
> christmas tree layout).

Sure.
> 
> > +static int nixge_hw_dma_bd_init(struct net_device *ndev)
> > +{
> > +	u32 cr;
> > +	int i;
> > +	struct sk_buff *skb;
> > +	struct nixge_priv *priv = netdev_priv(ndev);
> 
> Likewise.

Sure.
> 
> > +static void __nixge_device_reset(struct nixge_priv *priv, off_t offset)
> > +{
> > +	u32 status;
> > +	int err;
> > +	/* Reset Axi DMA. This would reset NIXGE Ethernet core as well.
> > +	 * The reset process of Axi DMA takes a while to complete as all
> > +	 * pending commands/transfers will be flushed or completed during
> > +	 * this reset process.
> > +	 */
> 
> Please put an empty line between the local variable declarations
> and this comment.

Will do in v6

Thanks for your review!

Cheers Moritz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/nixge.txt b/Documentation/devicetree/bindings/net/nixge.txt
new file mode 100644
index 000000000000..e55af7f0881a
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/nixge.txt
@@ -0,0 +1,32 @@ 
+* NI XGE Ethernet controller
+
+Required properties:
+- compatible: Should be "ni,xge-enet-2.00"
+- reg: Address and length of the register set for the device
+- interrupts: Should contain tx and rx interrupt
+- interrupt-names: Should be "rx" and "tx"
+- phy-mode: See ethernet.txt file in the same directory.
+- phy-handle: See ethernet.txt file in the same directory.
+- nvmem-cells: Phandle of nvmem cell containing the MAC address
+- nvmem-cell-names: Should be "address"
+
+Examples (10G generic PHY):
+	nixge0: ethernet@40000000 {
+		compatible = "ni,xge-enet-2.00";
+		reg = <0x40000000 0x6000>;
+
+		nvmem-cells = <&eth1_addr>;
+		nvmem-cell-names = "address";
+
+		interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>, <0 30 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "rx", "tx";
+		interrupt-parent = <&intc>;
+
+		phy-mode = "xgmii";
+		phy-handle = <&ethernet_phy1>;
+
+		ethernet_phy1: ethernet-phy@4 {
+			compatible = "ethernet-phy-ieee802.3-c45";
+			reg = <4>;
+		};
+	};