Skip to content

Commit

Permalink
net: hisilicon: Add Fast Ethernet MAC driver
Browse files Browse the repository at this point in the history
This patch adds the Hisilicon Fast Ethernet MAC(FEMAC) driver.
The FEMAC supports max speed 100Mbps and has been used in many
Hisilicon SoC.

Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>
Reviewed-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dongpo Li authored and David S. Miller committed Jul 17, 2016
1 parent b786241 commit 542ae60
Show file tree
Hide file tree
Showing 4 changed files with 1,059 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Documentation/devicetree/bindings/net/hisilicon-femac.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Hisilicon Fast Ethernet MAC controller

Required properties:
- compatible: should contain one of the following version strings:
* "hisilicon,hisi-femac-v1"
* "hisilicon,hisi-femac-v2"
and the soc string "hisilicon,hi3516cv300-femac".
- reg: specifies base physical address(s) and size of the device registers.
The first region is the MAC core register base and size.
The second region is the global MAC control register.
- interrupts: should contain the MAC interrupt.
- clocks: A phandle to the MAC main clock.
- resets: should contain the phandle to the MAC reset signal(required) and
the PHY reset signal(optional).
- reset-names: should contain the reset signal name "mac"(required)
and "phy"(optional).
- mac-address: see ethernet.txt [1].
- phy-mode: see ethernet.txt [1].
- phy-handle: see ethernet.txt [1].
- hisilicon,phy-reset-delays-us: triplet of delays if PHY reset signal given.
The 1st cell is reset pre-delay in micro seconds.
The 2nd cell is reset pulse in micro seconds.
The 3rd cell is reset post-delay in micro seconds.

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

Example:
hisi_femac: ethernet@10090000 {
compatible = "hisilicon,hi3516cv300-femac","hisilicon,hisi-femac-v2";
reg = <0x10090000 0x1000>,<0x10091300 0x200>;
interrupts = <12>;
clocks = <&crg HI3518EV200_ETH_CLK>;
resets = <&crg 0xec 0>,<&crg 0xec 3>;
reset-names = "mac","phy";
mac-address = [00 00 00 00 00 00];
phy-mode = "mii";
phy-handle = <&phy0>;
hisilicon,phy-reset-delays-us = <10000 20000 20000>;
};
12 changes: 12 additions & 0 deletions drivers/net/ethernet/hisilicon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ config HIX5HD2_GMAC
help
This selects the hix5hd2 mac family network device.

config HISI_FEMAC
tristate "Hisilicon Fast Ethernet MAC device support"
depends on HAS_IOMEM
select PHYLIB
select RESET_CONTROLLER
help
This selects the Hisilicon Fast Ethernet MAC device(FEMAC).
The FEMAC receives and transmits data over Ethernet
ports at 10/100 Mbps in full-duplex or half-duplex mode.
The FEMAC exchanges data with the CPU, and supports
the energy efficient Ethernet (EEE).

config HIP04_ETH
tristate "HISILICON P04 Ethernet support"
depends on HAS_IOMEM # For MFD_SYSCON
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/hisilicon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ obj-$(CONFIG_HIX5HD2_GMAC) += hix5hd2_gmac.o
obj-$(CONFIG_HIP04_ETH) += hip04_eth.o
obj-$(CONFIG_HNS_MDIO) += hns_mdio.o
obj-$(CONFIG_HNS) += hns/
obj-$(CONFIG_HISI_FEMAC) += hisi_femac.o
Loading

0 comments on commit 542ae60

Please sign in to comment.