Skip to contentSkip to conversation

ethernet/arc/arc_emac - Add new driver

PATCH Applied Alexey Brodkin 3 participants 4 messages Jun 24, 2013 – Jun 26, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 ethernet/arc/arc_emac - Add new driver

Driver for non-standard on-chip ethernet device ARC EMAC 10/100, instantiated in some legacy ARC (Synopsys) FPGA Boards such as ARCAngel4/ML50x.

Cc Andy Shevchenko <[email protected]>
Cc Francois Romieu <[email protected]>
Cc Joe Perches <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Mischa Jonker <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Grant Likely <[email protected]>
Cc Rob Herring <[email protected]>
Cc Paul Gortmaker <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc David Laight <[email protected]>

---
Hi all,

please take a look at 8th re-spin of the patch.

Changes compared to v7:
1. Declare BD's "data" field as "dma_addr_t" to make driver 64-bit clean.
2. Fix misspelling in comment.

---
 Documentation/devicetree/bindings/net/arc_emac.txt |   38 +
 drivers/net/ethernet/Kconfig                       |    1 +
 drivers/net/ethernet/Makefile                      |    1 +
 drivers/net/ethernet/arc/Kconfig                   |   31 +
 drivers/net/ethernet/arc/Makefile                  |    6 +
 drivers/net/ethernet/arc/emac.h                    |  214 ++++++
 drivers/net/ethernet/arc/emac_main.c               |  806 ++++++++++++++++++++
 drivers/net/ethernet/arc/emac_mdio.c               |  152 ++++
 8 files changed, 1249 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/arc_emac.txt
 create mode 100644 drivers/net/ethernet/arc/Kconfig
 create mode 100644 drivers/net/ethernet/arc/Makefile
 create mode 100644 drivers/net/ethernet/arc/emac.h
 create mode 100644 drivers/net/ethernet/arc/emac_main.c
 create mode 100644 drivers/net/ethernet/arc/emac_mdio.c
Documentation/devicetree/bindings/net/arc_emac.txt new file +38 -0
new file mode 100644
index 0000000..bcbc3f0
@@ -0,0 +1,38 @@
+* Synopsys ARC EMAC 10/100 Ethernet driver (EMAC)
+
+Required properties:
+- compatible: Should be "snps,arc-emac"
+- reg: Address and length of the register set for the device
+- interrupts: Should contain the EMAC interrupts
+- clock-frequency: CPU frequency. It is needed to calculate and set polling
+period of EMAC.
+- max-speed: Maximum supported data-rate in Mbit/s. In some HW configurations
+bandwidth of external memory controller might be a limiting factor. That's why
+it's required to specify which data-rate is supported on current SoC or FPGA.
+For example if only 10 Mbit/s is supported (10BASE-T) set "10". If 100 Mbit/s is
+supported (100BASE-TX) set "100".
+- phy: PHY device attached to the EMAC via MDIO bus
+
+Child nodes of the driver are the individual PHY devices connected to the
+MDIO bus. They must have a "reg" property given the PHY address on the MDIO bus.
+
+Optional properties:
+- mac-address: 6 bytes, mac address
+
+Examples:
+
+	ethernet@c0fc2000 {
+		compatible = "snps,arc-emac";
+		reg = <0xc0fc2000 0x3c>;
+		interrupts = <6>;
+		mac-address = [ 00 11 22 33 44 55 ];
+		clock-frequency = <80000000>;
+		max-speed = <100>;
+		phy = <&phy0>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+		phy0: ethernet-phy@0 {
+			reg = <1>;
+		};
+	};
drivers/net/ethernet/Kconfig +1 -0
index 4bedae2..98eec48 100644
@@ -23,6 +23,7 @@ source "drivers/net/ethernet/aeroflex/Kconfig"
 source "drivers/net/ethernet/alteon/Kconfig"
 source "drivers/net/ethernet/amd/Kconfig"
 source "drivers/net/ethernet/apple/Kconfig"
+source "drivers/net/ethernet/arc/Kconfig"
 source "drivers/net/ethernet/atheros/Kconfig"
 source "drivers/net/ethernet/cadence/Kconfig"
 source "drivers/net/ethernet/adi/Kconfig"
drivers/net/ethernet/Makefile +1 -0
index 183e3f4..b764c73 100644
@@ -9,6 +9,7 @@ obj-$(CONFIG_GRETH) += aeroflex/
 obj-$(CONFIG_NET_VENDOR_ALTEON) += alteon/
 obj-$(CONFIG_NET_VENDOR_AMD) += amd/
 obj-$(CONFIG_NET_VENDOR_APPLE) += apple/
+obj-$(CONFIG_NET_VENDOR_ARC) += arc/
 obj-$(CONFIG_NET_VENDOR_ATHEROS) += atheros/
 obj-$(CONFIG_NET_CADENCE) += cadence/
 obj-$(CONFIG_NET_BFIN) += adi/
drivers/net/ethernet/arc/Kconfig new file +31 -0
new file mode 100644
index 0000000..514c57f
@@ -0,0 +1,31 @@
+#
+# ARC EMAC network device configuration
+#
+
+config NET_VENDOR_ARC
+	bool "ARC devices"
+	default y
+	---help---
+	  If you have a network (Ethernet) card belonging to this class, say Y
+	  and read the Ethernet-HOWTO, available from
+	  <http://www.tldp.org/docs.html#howto>.
+
+	  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 ARC cards. If you say Y, you will be asked for
+	  your specific card in the following questions.
+
+if NET_VENDOR_ARC
+
+config ARC_EMAC
+	tristate "ARC EMAC support"
+	select MII
+	select PHYLIB
+	depends on OF_IRQ
+	depends on OF_NET
+	---help---
+	  On some legacy ARC (Synopsys) FPGA boards such as ARCAngel4/ML50x
+	  non-standard on-chip ethernet device ARC EMAC 10/100 is used.
+	  Say Y here if you have such a board.  If unsure, say N.
+
+endif # NET_VENDOR_ARC
drivers/net/ethernet/arc/Makefile new file +6 -0
new file mode 100644
index 0000000..00c8657
@@ -0,0 +1,6 @@
+#
+# Makefile for the ARC network device drivers.
+#
+
+arc_emac-objs := emac_main.o emac_mdio.o
+obj-$(CONFIG_ARC_EMAC) += arc_emac.o
drivers/net/ethernet/arc/emac.h new file +214 -0

214 lines not on this page · raw message

drivers/net/ethernet/arc/emac_main.c new file +806 -0

806 lines not on this page · raw message

drivers/net/ethernet/arc/emac_mdio.c new file +152 -0

152 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 3 lines · Alexey Brodkin

Driver for non-standard on-chip ethernet device ARC EMAC 10/100, instantiated in some legacy ARC (Synopsys) FPGA Boards such as ARCAngel4/ML50x.

Any comments on this patch?

If not please consider applying.

Regards,
Alexey

#3 lore raw
Quoted 9 lines · David Miller

From: Alexey Brodkin <[email protected]>
Date: Mon, 24 Jun 2013 09:54:27 +0400

Quoted 5 lines

Driver for non-standard on-chip ethernet device ARC EMAC 10/100, instantiated in some legacy ARC (Synopsys) FPGA Boards such as ARCAngel4/ML50x.

Applied to net-next, thanks.

Alexey, can you please send the DT updates for arch/arc to instantiate this as well

-Vineet