Skip to content

Commit

Permalink
Merge branch 'hsilicon'
Browse files Browse the repository at this point in the history
Zhangfei Gao says:

====================
add hix5hd2 mac driver

v4:
Update indent
Use usleep_range instead of udelay

v3:
Remove .ndo_get_stats as mentioned by Tobias
Add __le32 conversion pointed by Mark

v2:
Update binding accoring to Sergei comments
Update descriptor as Arnd's suggestion
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 3, 2014
2 parents 014b201 + 57c5bc9 commit 75348fc
Show file tree
Hide file tree
Showing 6 changed files with 1,136 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Hisilicon hix5hd2 gmac controller

Required properties:
- compatible: should be "hisilicon,hix5hd2-gmac".
- reg: specifies base physical address(s) and size of the device registers.
The first region is the MAC register base and size.
The second region is external interface control register.
- interrupts: should contain the MAC interrupt.
- #address-cells: must be <1>.
- #size-cells: must be <0>.
- phy-mode: see ethernet.txt [1].
- phy-handle: see ethernet.txt [1].
- mac-address: see ethernet.txt [1].
- clocks: clock phandle and specifier pair.

- PHY subnode: inherits from phy binding [2]

[1] Documentation/devicetree/bindings/net/ethernet.txt
[2] Documentation/devicetree/bindings/net/phy.txt

Example:
gmac0: ethernet@f9840000 {
compatible = "hisilicon,hix5hd2-gmac";
reg = <0xf9840000 0x1000>,<0xf984300c 0x4>;
interrupts = <0 71 4>;
#address-cells = <1>;
#size-cells = <0>;
phy-mode = "mii";
phy-handle = <&phy2>;
mac-address = [00 00 00 00 00 00];
clocks = <&clock HIX5HD2_MAC0_CLK>;

phy2: ethernet-phy@2 {
reg = <2>;
};
};
1 change: 1 addition & 0 deletions drivers/net/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ source "drivers/net/ethernet/neterion/Kconfig"
source "drivers/net/ethernet/faraday/Kconfig"
source "drivers/net/ethernet/freescale/Kconfig"
source "drivers/net/ethernet/fujitsu/Kconfig"
source "drivers/net/ethernet/hisilicon/Kconfig"
source "drivers/net/ethernet/hp/Kconfig"
source "drivers/net/ethernet/ibm/Kconfig"
source "drivers/net/ethernet/intel/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 @@ -31,6 +31,7 @@ obj-$(CONFIG_NET_VENDOR_EXAR) += neterion/
obj-$(CONFIG_NET_VENDOR_FARADAY) += faraday/
obj-$(CONFIG_NET_VENDOR_FREESCALE) += freescale/
obj-$(CONFIG_NET_VENDOR_FUJITSU) += fujitsu/
obj-$(CONFIG_NET_VENDOR_HISILICON) += hisilicon/
obj-$(CONFIG_NET_VENDOR_HP) += hp/
obj-$(CONFIG_NET_VENDOR_IBM) += ibm/
obj-$(CONFIG_NET_VENDOR_INTEL) += intel/
Expand Down
27 changes: 27 additions & 0 deletions drivers/net/ethernet/hisilicon/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# HISILICON device configuration
#

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

if NET_VENDOR_HISILICON

config HIX5HD2_GMAC
tristate "Hisilicon HIX5HD2 Family Network Device Support"
select PHYLIB
help
This selects the hix5hd2 mac family network device.

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

obj-$(CONFIG_HIX5HD2_GMAC) += hix5hd2_gmac.o
Loading

0 comments on commit 75348fc

Please sign in to comment.