Skip to content

Commit

Permalink
Merge branch 'hix5hd2_gmac-txsg-reset-clock-control'
Browse files Browse the repository at this point in the history
Dongpo Li says:

====================
net: hix5hd2_gmac: add tx sg feature and reset/clock control signals

The "hix5hd2" is SoC name, add the generic ethernet driver compatible string.
The "hisi-gemac-v1" is the basic version and "hisi-gemac-v2" adds
the SG/TXCSUM/TSO/UFO features.
This patch set only adds the SG(scatter-gather) driver for transmitting,
the drivers of other features will be submitted later.

Add the MAC reset control signals and clock signals.
We make these signals optional to be backward compatible with
the hix5hd2 SoC.

Changes in v2:
- Make the compatible string changes be a separate patch and
the most specific string come first than the generic string
as advised by Rob.
- Make the MAC reset control signals and clock signals optional
to be backward compatible with the hix5hd2 SoC.
- Change the compatible string and give the clock a specific name
in hix5hd2 dts file.
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Dec 6, 2016
2 parents 2bfcfcd + 0855950 commit e466af6
Show file tree
Hide file tree
Showing 3 changed files with 352 additions and 33 deletions.
27 changes: 23 additions & 4 deletions Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
Hisilicon hix5hd2 gmac controller

Required properties:
- compatible: should be "hisilicon,hix5hd2-gmac".
- compatible: should contain one of the following SoC strings:
* "hisilicon,hix5hd2-gemac"
* "hisilicon,hi3798cv200-gemac"
and one of the following version string:
* "hisilicon,hisi-gemac-v1"
* "hisilicon,hisi-gemac-v2"
- 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.
Expand All @@ -12,6 +17,16 @@ Required properties:
- phy-handle: see ethernet.txt [1].
- mac-address: see ethernet.txt [1].
- clocks: clock phandle and specifier pair.
- clock-names: contain the clock name "mac_core"(required) and "mac_ifc"(optional).
- resets: should contain the phandle to the MAC core reset signal(optional),
the MAC interface reset signal(optional)
and the PHY reset signal(optional).
- reset-names: contain the reset signal name "mac_core"(optional),
"mac_ifc"(optional) and "phy"(optional).
- 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.

- PHY subnode: inherits from phy binding [2]

Expand All @@ -20,15 +35,19 @@ Required properties:

Example:
gmac0: ethernet@f9840000 {
compatible = "hisilicon,hix5hd2-gmac";
compatible = "hisilicon,hi3798cv200-gemac", "hisilicon,hisi-gemac-v2";
reg = <0xf9840000 0x1000>,<0xf984300c 0x4>;
interrupts = <0 71 4>;
#address-cells = <1>;
#size-cells = <0>;
phy-mode = "mii";
phy-mode = "rgmii";
phy-handle = <&phy2>;
mac-address = [00 00 00 00 00 00];
clocks = <&clock HIX5HD2_MAC0_CLK>;
clocks = <&crg HISTB_ETH0_MAC_CLK>, <&crg HISTB_ETH0_MACIF_CLK>;
clock-names = "mac_core", "mac_ifc";
resets = <&crg 0xcc 8>, <&crg 0xcc 10>, <&crg 0xcc 12>;
reset-names = "mac_core", "mac_ifc", "phy";
hisilicon,phy-reset-delays-us = <10000 10000 30000>;

phy2: ethernet-phy@2 {
reg = <2>;
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/boot/dts/hisi-x5hd2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -436,18 +436,20 @@
};

gmac0: ethernet@1840000 {
compatible = "hisilicon,hix5hd2-gmac";
compatible = "hisilicon,hix5hd2-gemac", "hisilicon,hisi-gemac-v1";
reg = <0x1840000 0x1000>,<0x184300c 0x4>;
interrupts = <0 71 4>;
clocks = <&clock HIX5HD2_MAC0_CLK>;
clock-names = "mac_core";
status = "disabled";
};

gmac1: ethernet@1841000 {
compatible = "hisilicon,hix5hd2-gmac";
compatible = "hisilicon,hix5hd2-gemac", "hisilicon,hisi-gemac-v1";
reg = <0x1841000 0x1000>,<0x1843010 0x4>;
interrupts = <0 72 4>;
clocks = <&clock HIX5HD2_MAC1_CLK>;
clock-names = "mac_core";
status = "disabled";
};

Expand Down
Loading

0 comments on commit e466af6

Please sign in to comment.