dt-bindings: net: Add bindings for National Instruments XGE netdev
Subsystems (3)
PATCH v5 1/2 dt-bindings: net: Add bindings for National Instruments XGE netdev
This adds bindings for the NI XGE 1G/10G network device.
---
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
Documentation/devicetree/bindings/net/nixge.txt new file +32 -0
@@ -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 = <ð1_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 = <ðernet_phy1>; + + ethernet_phy1: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <4>; + }; + };
Signature · 1 line
2.16.2
PATCH v5 2/2 net: ethernet: nixge: Add support for National Instruments XGE netdev
Add support for the National Instruments XGE 1/10G network device.
It uses the EEPROM on the board via NVMEM.
---
Changes from v4:
- Worked on consistency for constants
- Removed unused constants
- Removed unused includes
Changes from v3:
- Added NIXGE prefix to MDIO constants
- Removed NIXGE_MAX_PHY_ADDR (unused)
- Consistency for NIXGE_MDIO_CXX_READ constants
- Use devm_mdiobus_alloc()
- Fixed order of netdev_unregister() and mdio_bus_unregister()
- Addressed feedback w.r.t. disconnecting the PHY
- Removed now superfluous max_frm_size member
- Fix SPDX vs module license to be 'GPL v2'
SPDX-License-Identifier: GPL-2.0
Changes from v2:
- Implement recv side NAPI
- Improved error handling
- Implemented C45 writes
- Added ethtool callbacks & blink functionality
- Improved nixge_ctrl_poll_timeout() macro
- Removed dev_dbg() for mdio accesses
- Added businfo to ethtool drvinfo
Changes from v1:
- Added dependency on ARCH_ZYNQ (Kbuild)
- Removed unused variables
- Use of_phy_connect as suggested
- Removed masking of (un)supported modes
- Added #define for some constants
- Removed empty pm functions
- Reworked mac_address handling
- Made nixge_mdio_*() static (sparse)
- Removed driver version
- Addressed timeout loop
- Adressed return values on timeout
--- drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/ni/Kconfig | 27 + drivers/net/ethernet/ni/Makefile | 1 + drivers/net/ethernet/ni/nixge.c | 1309 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 1339 insertions(+) create mode 100644 drivers/net/ethernet/ni/Kconfig create mode 100644 drivers/net/ethernet/ni/Makefile create mode 100644 drivers/net/ethernet/ni/nixge.c
drivers/net/ethernet/Kconfig +1 -0
@@ -128,6 +128,7 @@ config FEALNX source "drivers/net/ethernet/natsemi/Kconfig" source "drivers/net/ethernet/netronome/Kconfig" +source "drivers/net/ethernet/ni/Kconfig" source "drivers/net/ethernet/8390/Kconfig" config NET_NETX
drivers/net/ethernet/Makefile +1 -0
@@ -60,6 +60,7 @@ obj-$(CONFIG_NET_VENDOR_MYRI) += myricom/ obj-$(CONFIG_FEALNX) += fealnx.o obj-$(CONFIG_NET_VENDOR_NATSEMI) += natsemi/ obj-$(CONFIG_NET_VENDOR_NETRONOME) += netronome/ +obj-$(CONFIG_NET_VENDOR_NI) += ni/ obj-$(CONFIG_NET_NETX) += netx-eth.o obj-$(CONFIG_NET_VENDOR_NUVOTON) += nuvoton/ obj-$(CONFIG_NET_VENDOR_NVIDIA) += nvidia/
drivers/net/ethernet/ni/Kconfig new file +27 -0
@@ -0,0 +1,27 @@ +# +# National Instuments network device configuration +# + +config NET_VENDOR_NI + bool "National Instruments Devices" + default y + ---help--- + If you have a network (Ethernet) device belonging to this class, say Y. + + Note that the answer to this question doesn't directly affect the + kernel: saying N will just cause the configurator to skip all + the questions about National Instrument devices. + If you say Y, you will be asked for your specific device in the + following questions. + +if NET_VENDOR_NI + +config NI_XGE_MANAGEMENT_ENET + tristate "National Instruments XGE management enet support" + depends on ARCH_ZYNQ + select PHYLIB + ---help--- + Simple LAN device for debug or management purposes. Can + support either 10G or 1G PHYs via SFP+ ports. + +endif
drivers/net/ethernet/ni/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_NI_XGE_MANAGEMENT_ENET) += nixge.o
drivers/net/ethernet/ni/nixge.c new file +1309 -0
1,309 lines not on this page · raw message
Signature · 1 line
2.16.2
David Miller
maintainerRe: [PATCH v5 2/2] net: ethernet: nixge: Add support for National Instruments XGE netdev
From: Moritz Fischer <[email protected]>
Date: Fri, 23 Mar 2018 13:41:28 -0700
drivers/net/ethernet/ni/nixge.c line 206
Quoted 4 lines
drivers/net/ethernet/ni/nixge.c new file +4
-0+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).
drivers/net/ethernet/ni/nixge.c line 236
Quoted 6 lines
drivers/net/ethernet/ni/nixge.c new file +6
-0+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.
drivers/net/ethernet/ni/nixge.c line 347
Quoted 9 lines
drivers/net/ethernet/ni/nixge.c new file +9
-0+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.
Re: [PATCH v5 2/2] net: ethernet: nixge: Add support for National Instruments XGE netdev
Hi David,
Quoted 10 lines · David Miller
From: Moritz Fischer <[email protected]>
Date: Fri, 23 Mar 2018 13:41:28 -0700drivers/net/ethernet/ni/nixge.c line 206
Quoted 4 lines
drivers/net/ethernet/ni/nixge.c new file +4
-0+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.
Quoted 9 lines
drivers/net/ethernet/ni/nixge.c line 236
Quoted 7 lines
drivers/net/ethernet/ni/nixge.c new file +6
-0+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.
Quoted 13 lines
drivers/net/ethernet/ni/nixge.c line 347
Quoted 10 lines
drivers/net/ethernet/ni/nixge.c new file +9
-0+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