Skip to content

Commit

Permalink
net: Add EMAC ethernet driver found on Allwinner A10 SoC's
Browse files Browse the repository at this point in the history
The Allwinner A10 has an ethernet controller that seem to be developped
internally by them.

The exact feature set of this controller is unknown, since there is no
public documentation for this IP, and this driver is mostly the one
published by Allwinner that has been heavily cleaned up.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stefan Roese authored and David S. Miller committed Jun 1, 2013
1 parent 2cc70ba commit 4922050
Show file tree
Hide file tree
Showing 7 changed files with 1,133 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/net/allwinner,sun4i-emac.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
* Allwinner EMAC ethernet controller

Required properties:
- compatible: should be "allwinner,sun4i-emac".
- reg: address and length of the register set for the device.
- interrupts: interrupt for the device
- phy: A phandle to a phy node defining the PHY address (as the reg
property, a single integer).
- clocks: A phandle to the reference clock for this device

Optional properties:
- (local-)mac-address: mac address to be used by this driver

Example:

emac: ethernet@01c0b000 {
compatible = "allwinner,sun4i-emac";
reg = <0x01c0b000 0x1000>;
interrupts = <55>;
clocks = <&ahb_gates 17>;
phy = <&phy0>;
};
1 change: 1 addition & 0 deletions drivers/net/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ config SUNGEM_PHY
source "drivers/net/ethernet/3com/Kconfig"
source "drivers/net/ethernet/adaptec/Kconfig"
source "drivers/net/ethernet/aeroflex/Kconfig"
source "drivers/net/ethernet/allwinner/Kconfig"
source "drivers/net/ethernet/alteon/Kconfig"
source "drivers/net/ethernet/amd/Kconfig"
source "drivers/net/ethernet/apple/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ obj-$(CONFIG_NET_VENDOR_3COM) += 3com/
obj-$(CONFIG_NET_VENDOR_8390) += 8390/
obj-$(CONFIG_NET_VENDOR_ADAPTEC) += adaptec/
obj-$(CONFIG_GRETH) += aeroflex/
obj-$(CONFIG_NET_VENDOR_ALLWINNER) += allwinner/
obj-$(CONFIG_NET_VENDOR_ALTEON) += alteon/
obj-$(CONFIG_NET_VENDOR_AMD) += amd/
obj-$(CONFIG_NET_VENDOR_APPLE) += apple/
Expand Down
36 changes: 36 additions & 0 deletions drivers/net/ethernet/allwinner/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Allwinner device configuration
#

config NET_VENDOR_ALLWINNER
bool "Allwinner devices"
default y
depends on ARCH_SUNXI
---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 Allwinner cards. If you say Y,
you will be asked for your specific card in the following
questions.

if NET_VENDOR_ALLWINNER

config SUN4I_EMAC
tristate "Allwinner A10 EMAC support"
depends on ARCH_SUNXI
depends on OF
select CRC32
select NET_CORE
select MII
select PHYLIB
---help---
Support for Allwinner A10 EMAC ethernet driver.

To compile this driver as a module, choose M here. The module
will be called sun4i-emac.

endif # NET_VENDOR_ALLWINNER
5 changes: 5 additions & 0 deletions drivers/net/ethernet/allwinner/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Makefile for the Allwinner device drivers.
#

obj-$(CONFIG_SUN4I_EMAC) += sun4i-emac.o
Loading

0 comments on commit 4922050

Please sign in to comment.