Re: [PATCH v2 1/5] net: add Hisilicon Network Subsystem support (config and documents)

2015-09-23 Thread huangdaode

On 2015/9/21 22:52, Rob Herring wrote:

On 09/17/2015 01:51 AM, huangdaode wrote:

The Hisilicon Network Subsystem is a long term evolution IP which is
supposed to be used in Hisilicon ICT SoC. The IP, which is called hns
for short, is a TCP/IP acceleration engine, which can directly decode
TCP/IP stream and distribute them to different ring buffers.

HNS can be configured to work on different mode for different scenario.
This patch make use only some of the mode to make it as standard
ethernet NIC. The other mode will be added soon.

The whole function has 4 kernel sub-modules:

hnae: the HNS acceleration engine framework. It provides a abstract
interface between the engine and the upper layers which make use of the
engine by ring buffer.

hns_enet_drv: a standard ethernet driver that base on the ring buffer.

hns_dsaf: one of the implementation of HNS acceleration engine, which is
applied on Hililicon hip05, Hi1610 and other later-on SoCs

hns_mdio: the mdio control to the PHY, used by acceleration engine

This submit add basic config and documents

Signed-off-by: huangdaode 
Signed-off-by: Kenneth Lee 
Signed-off-by: Yisen Zhuang 
---
  .../bindings/net/hisilicon-hip04-net.txt   |   4 +-
  .../devicetree/bindings/net/hisilicon-hns-dsaf.txt |  49 ++
  .../devicetree/bindings/net/hisilicon-hns-mdio.txt |  22 +++
  .../devicetree/bindings/net/hisilicon-hns-nic.txt  |  47 +
  arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi   | 193 +
  5 files changed, 313 insertions(+), 2 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
  create mode 100644 
Documentation/devicetree/bindings/net/hisilicon-hns-mdio.txt
  create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
  create mode 100644 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi

diff --git a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
index 988fc69..d1df8a0 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
@@ -32,13 +32,13 @@ Required properties:
  
  Required properties:
  
-- compatible: should be "hisilicon,hip04-mdio".

+- compatible: should be "hisilicon,mdio".

Why are you removing the old one? Please use more specific compatible
strings, not less specific.



we have unified the hip04_mdio.c and hip05_mdio.c  into hns_mdio.c, so 
we plan use
"hisilicon,mdio", "hisilicon,hns-mdio" "hisilicon,hns-mdio Vx", in this 
case, "hisilicon, mdio "
is more suitable for us, meanwhile, we will upstream hip04 dts file 
later, and will apply the

compatible property with "hisilicon,mdio".


  - Inherits from MDIO bus node binding [2]
  [2] Documentation/devicetree/bindings/net/phy.txt
  
  Example:

mdio {
-   compatible = "hisilicon,hip04-mdio";
+   compatible = "hisilicon,mdio";
reg = <0x28f1000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
new file mode 100644
index 000..80411b2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
@@ -0,0 +1,49 @@
+Hisilicon DSA Fabric device controller
+
+Required properties:
+- compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2".
+  "hisilicon,hns-dsaf-v1" is for hip05.
+  "hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612.
+- dsa-name: dsa fabric name who provide this interface.
+  should be "dsafX", X is the dsaf id.

What is this for? Find a different way to distinguish instances other
than an index.


our driver support multi dsaf, so X in dsafX is the dsaf id.
the enet driver interface use the dsa-name to match the dsaf engine, 
then get it's handle.
when there are 2 dsafs ,we use dsaf0 and dsaf1 to distinguish them. The 
default is dsaf0.



+- mode: dsa fabric mode string. only support one of dsaf modes like these:
+   "2port-64vf",
+   "6port-16rss",
+   "6port-16vf".
+- interrupt-parent: the interrupt parent of this device.
+- interrupts: should contain the DSA Fabric and rcb interrupt.
+- reg: specifies base physical address(es) and size of the device registers.
+  The first region is external interface control register base and size.
+  The second region is SerDes base register and size.
+  The third region is the PPE register base and size.
+  The fourth region is dsa fabric base register and size.
+  The fifth region is cpld base register and size, it is not required if do 
not use cpld.
+- phy-handle: phy handle of physicl port, 0 if not any phy device. see 
ethernet.txt [1].
+- buf-size: rx buffer size, should be 16-1024.

This is a h/w property?


yes. it's.


+- desc-num: number of description in TX and RX queue, should be 512, 

Re: [PATCH v2 1/5] net: add Hisilicon Network Subsystem support (config and documents)

2015-09-23 Thread huangdaode

On 2015/9/21 22:52, Rob Herring wrote:

On 09/17/2015 01:51 AM, huangdaode wrote:

The Hisilicon Network Subsystem is a long term evolution IP which is
supposed to be used in Hisilicon ICT SoC. The IP, which is called hns
for short, is a TCP/IP acceleration engine, which can directly decode
TCP/IP stream and distribute them to different ring buffers.

HNS can be configured to work on different mode for different scenario.
This patch make use only some of the mode to make it as standard
ethernet NIC. The other mode will be added soon.

The whole function has 4 kernel sub-modules:

hnae: the HNS acceleration engine framework. It provides a abstract
interface between the engine and the upper layers which make use of the
engine by ring buffer.

hns_enet_drv: a standard ethernet driver that base on the ring buffer.

hns_dsaf: one of the implementation of HNS acceleration engine, which is
applied on Hililicon hip05, Hi1610 and other later-on SoCs

hns_mdio: the mdio control to the PHY, used by acceleration engine

This submit add basic config and documents

Signed-off-by: huangdaode 
Signed-off-by: Kenneth Lee 
Signed-off-by: Yisen Zhuang 
---
  .../bindings/net/hisilicon-hip04-net.txt   |   4 +-
  .../devicetree/bindings/net/hisilicon-hns-dsaf.txt |  49 ++
  .../devicetree/bindings/net/hisilicon-hns-mdio.txt |  22 +++
  .../devicetree/bindings/net/hisilicon-hns-nic.txt  |  47 +
  arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi   | 193 +
  5 files changed, 313 insertions(+), 2 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
  create mode 100644 
Documentation/devicetree/bindings/net/hisilicon-hns-mdio.txt
  create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
  create mode 100644 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi

diff --git a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
index 988fc69..d1df8a0 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
@@ -32,13 +32,13 @@ Required properties:
  
  Required properties:
  
-- compatible: should be "hisilicon,hip04-mdio".

+- compatible: should be "hisilicon,mdio".

Why are you removing the old one? Please use more specific compatible
strings, not less specific.



we have unified the hip04_mdio.c and hip05_mdio.c  into hns_mdio.c, so 
we plan use
"hisilicon,mdio", "hisilicon,hns-mdio" "hisilicon,hns-mdio Vx", in this 
case, "hisilicon, mdio "
is more suitable for us, meanwhile, we will upstream hip04 dts file 
later, and will apply the

compatible property with "hisilicon,mdio".


  - Inherits from MDIO bus node binding [2]
  [2] Documentation/devicetree/bindings/net/phy.txt
  
  Example:

mdio {
-   compatible = "hisilicon,hip04-mdio";
+   compatible = "hisilicon,mdio";
reg = <0x28f1000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
new file mode 100644
index 000..80411b2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
@@ -0,0 +1,49 @@
+Hisilicon DSA Fabric device controller
+
+Required properties:
+- compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2".
+  "hisilicon,hns-dsaf-v1" is for hip05.
+  "hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612.
+- dsa-name: dsa fabric name who provide this interface.
+  should be "dsafX", X is the dsaf id.

What is this for? Find a different way to distinguish instances other
than an index.


our driver support multi dsaf, so X in dsafX is the dsaf id.
the enet driver interface use the dsa-name to match the dsaf engine, 
then get it's handle.
when there are 2 dsafs ,we use dsaf0 and dsaf1 to distinguish them. The 
default is dsaf0.



+- mode: dsa fabric mode string. only support one of dsaf modes like these:
+   "2port-64vf",
+   "6port-16rss",
+   "6port-16vf".
+- interrupt-parent: the interrupt parent of this device.
+- interrupts: should contain the DSA Fabric and rcb interrupt.
+- reg: specifies base physical address(es) and size of the device registers.
+  The first region is external interface control register base and size.
+  The second region is SerDes base register and size.
+  The third region is the PPE register base and size.
+  The fourth region is dsa fabric base register and size.
+  The fifth region is cpld base register and size, it is not required if do 
not use cpld.
+- phy-handle: phy handle of physicl port, 0 if not any phy device. see 
ethernet.txt [1].
+- buf-size: rx buffer size, should be 16-1024.

This is a h/w property?


yes. it's.


+- 

Re: [PATCH v2 1/5] net: add Hisilicon Network Subsystem support (config and documents)

2015-09-21 Thread Rob Herring
On 09/17/2015 01:51 AM, huangdaode wrote:
> The Hisilicon Network Subsystem is a long term evolution IP which is
> supposed to be used in Hisilicon ICT SoC. The IP, which is called hns
> for short, is a TCP/IP acceleration engine, which can directly decode
> TCP/IP stream and distribute them to different ring buffers.
> 
> HNS can be configured to work on different mode for different scenario.
> This patch make use only some of the mode to make it as standard
> ethernet NIC. The other mode will be added soon.
> 
> The whole function has 4 kernel sub-modules:
> 
> hnae: the HNS acceleration engine framework. It provides a abstract
> interface between the engine and the upper layers which make use of the
> engine by ring buffer.
> 
> hns_enet_drv: a standard ethernet driver that base on the ring buffer.
> 
> hns_dsaf: one of the implementation of HNS acceleration engine, which is
> applied on Hililicon hip05, Hi1610 and other later-on SoCs
> 
> hns_mdio: the mdio control to the PHY, used by acceleration engine
> 
> This submit add basic config and documents
> 
> Signed-off-by: huangdaode 
> Signed-off-by: Kenneth Lee 
> Signed-off-by: Yisen Zhuang 
> ---
>  .../bindings/net/hisilicon-hip04-net.txt   |   4 +-
>  .../devicetree/bindings/net/hisilicon-hns-dsaf.txt |  49 ++
>  .../devicetree/bindings/net/hisilicon-hns-mdio.txt |  22 +++
>  .../devicetree/bindings/net/hisilicon-hns-nic.txt  |  47 +
>  arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi   | 193 
> +
>  5 files changed, 313 insertions(+), 2 deletions(-)
>  create mode 100644 
> Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
>  create mode 100644 
> Documentation/devicetree/bindings/net/hisilicon-hns-mdio.txt
>  create mode 100644 
> Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi
> 
> diff --git a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt 
> b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
> index 988fc69..d1df8a0 100644
> --- a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
> +++ b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
> @@ -32,13 +32,13 @@ Required properties:
>  
>  Required properties:
>  
> -- compatible: should be "hisilicon,hip04-mdio".
> +- compatible: should be "hisilicon,mdio".

Why are you removing the old one? Please use more specific compatible
strings, not less specific.

>  - Inherits from MDIO bus node binding [2]
>  [2] Documentation/devicetree/bindings/net/phy.txt
>  
>  Example:
>   mdio {
> - compatible = "hisilicon,hip04-mdio";
> + compatible = "hisilicon,mdio";
>   reg = <0x28f1000 0x1000>;
>   #address-cells = <1>;
>   #size-cells = <0>;
> diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt 
> b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
> new file mode 100644
> index 000..80411b2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
> @@ -0,0 +1,49 @@
> +Hisilicon DSA Fabric device controller
> +
> +Required properties:
> +- compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2".
> +  "hisilicon,hns-dsaf-v1" is for hip05.
> +  "hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612.
> +- dsa-name: dsa fabric name who provide this interface.
> +  should be "dsafX", X is the dsaf id.

What is this for? Find a different way to distinguish instances other
than an index.

> +- mode: dsa fabric mode string. only support one of dsaf modes like these:
> + "2port-64vf",
> + "6port-16rss",
> + "6port-16vf".
> +- interrupt-parent: the interrupt parent of this device.
> +- interrupts: should contain the DSA Fabric and rcb interrupt.
> +- reg: specifies base physical address(es) and size of the device registers.
> +  The first region is external interface control register base and size.
> +  The second region is SerDes base register and size.
> +  The third region is the PPE register base and size.
> +  The fourth region is dsa fabric base register and size.
> +  The fifth region is cpld base register and size, it is not required if do 
> not use cpld.
> +- phy-handle: phy handle of physicl port, 0 if not any phy device. see 
> ethernet.txt [1].
> +- buf-size: rx buffer size, should be 16-1024.

This is a h/w property?

> +- desc-num: number of description in TX and RX queue, should be 512, 1024, 
> 2048 or 4096.

This is a h/w property?

> +
> +[1] Documentation/devicetree/bindings/net/phy.txt
> +
> +Example:
> +
> +dsa: dsa@c700 {
> + compatible = "hisilicon,hns-dsaf-v1";
> + dsa_name = "dsaf0";
> + mode = "6port-16rss";
> + interrupt-parent = <_dsa>;
> + reg = <0x0 0xC000 0x0 0x42
> +0x0 0xC200 0x0 0x30
> +0x0 0xc500 0x0 0x89
> +0x0 0xc700 0x0 0x6>;
> + 

Re: [PATCH v2 1/5] net: add Hisilicon Network Subsystem support (config and documents)

2015-09-21 Thread Rob Herring
On 09/17/2015 01:51 AM, huangdaode wrote:
> The Hisilicon Network Subsystem is a long term evolution IP which is
> supposed to be used in Hisilicon ICT SoC. The IP, which is called hns
> for short, is a TCP/IP acceleration engine, which can directly decode
> TCP/IP stream and distribute them to different ring buffers.
> 
> HNS can be configured to work on different mode for different scenario.
> This patch make use only some of the mode to make it as standard
> ethernet NIC. The other mode will be added soon.
> 
> The whole function has 4 kernel sub-modules:
> 
> hnae: the HNS acceleration engine framework. It provides a abstract
> interface between the engine and the upper layers which make use of the
> engine by ring buffer.
> 
> hns_enet_drv: a standard ethernet driver that base on the ring buffer.
> 
> hns_dsaf: one of the implementation of HNS acceleration engine, which is
> applied on Hililicon hip05, Hi1610 and other later-on SoCs
> 
> hns_mdio: the mdio control to the PHY, used by acceleration engine
> 
> This submit add basic config and documents
> 
> Signed-off-by: huangdaode 
> Signed-off-by: Kenneth Lee 
> Signed-off-by: Yisen Zhuang 
> ---
>  .../bindings/net/hisilicon-hip04-net.txt   |   4 +-
>  .../devicetree/bindings/net/hisilicon-hns-dsaf.txt |  49 ++
>  .../devicetree/bindings/net/hisilicon-hns-mdio.txt |  22 +++
>  .../devicetree/bindings/net/hisilicon-hns-nic.txt  |  47 +
>  arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi   | 193 
> +
>  5 files changed, 313 insertions(+), 2 deletions(-)
>  create mode 100644 
> Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
>  create mode 100644 
> Documentation/devicetree/bindings/net/hisilicon-hns-mdio.txt
>  create mode 100644 
> Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi
> 
> diff --git a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt 
> b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
> index 988fc69..d1df8a0 100644
> --- a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
> +++ b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
> @@ -32,13 +32,13 @@ Required properties:
>  
>  Required properties:
>  
> -- compatible: should be "hisilicon,hip04-mdio".
> +- compatible: should be "hisilicon,mdio".

Why are you removing the old one? Please use more specific compatible
strings, not less specific.

>  - Inherits from MDIO bus node binding [2]
>  [2] Documentation/devicetree/bindings/net/phy.txt
>  
>  Example:
>   mdio {
> - compatible = "hisilicon,hip04-mdio";
> + compatible = "hisilicon,mdio";
>   reg = <0x28f1000 0x1000>;
>   #address-cells = <1>;
>   #size-cells = <0>;
> diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt 
> b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
> new file mode 100644
> index 000..80411b2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
> @@ -0,0 +1,49 @@
> +Hisilicon DSA Fabric device controller
> +
> +Required properties:
> +- compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2".
> +  "hisilicon,hns-dsaf-v1" is for hip05.
> +  "hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612.
> +- dsa-name: dsa fabric name who provide this interface.
> +  should be "dsafX", X is the dsaf id.

What is this for? Find a different way to distinguish instances other
than an index.

> +- mode: dsa fabric mode string. only support one of dsaf modes like these:
> + "2port-64vf",
> + "6port-16rss",
> + "6port-16vf".
> +- interrupt-parent: the interrupt parent of this device.
> +- interrupts: should contain the DSA Fabric and rcb interrupt.
> +- reg: specifies base physical address(es) and size of the device registers.
> +  The first region is external interface control register base and size.
> +  The second region is SerDes base register and size.
> +  The third region is the PPE register base and size.
> +  The fourth region is dsa fabric base register and size.
> +  The fifth region is cpld base register and size, it is not required if do 
> not use cpld.
> +- phy-handle: phy handle of physicl port, 0 if not any phy device. see 
> ethernet.txt [1].
> +- buf-size: rx buffer size, should be 16-1024.

This is a h/w property?

> +- desc-num: number of description in TX and RX queue, should be 512, 1024, 
> 2048 or 4096.

This is a h/w property?

> +
> +[1] Documentation/devicetree/bindings/net/phy.txt
> +
> +Example:
> +
> +dsa: dsa@c700 {
> + compatible = "hisilicon,hns-dsaf-v1";
> + dsa_name = "dsaf0";
> + mode = "6port-16rss";
> + interrupt-parent = <_dsa>;
> + reg = <0x0 0xC000 0x0 0x42
> +0x0 0xC200 0x0 0x30
> +0x0 0xc500 

[PATCH v2 1/5] net: add Hisilicon Network Subsystem support (config and documents)

2015-09-17 Thread huangdaode
The Hisilicon Network Subsystem is a long term evolution IP which is
supposed to be used in Hisilicon ICT SoC. The IP, which is called hns
for short, is a TCP/IP acceleration engine, which can directly decode
TCP/IP stream and distribute them to different ring buffers.

HNS can be configured to work on different mode for different scenario.
This patch make use only some of the mode to make it as standard
ethernet NIC. The other mode will be added soon.

The whole function has 4 kernel sub-modules:

hnae: the HNS acceleration engine framework. It provides a abstract
interface between the engine and the upper layers which make use of the
engine by ring buffer.

hns_enet_drv: a standard ethernet driver that base on the ring buffer.

hns_dsaf: one of the implementation of HNS acceleration engine, which is
applied on Hililicon hip05, Hi1610 and other later-on SoCs

hns_mdio: the mdio control to the PHY, used by acceleration engine

This submit add basic config and documents

Signed-off-by: huangdaode 
Signed-off-by: Kenneth Lee 
Signed-off-by: Yisen Zhuang 
---
 .../bindings/net/hisilicon-hip04-net.txt   |   4 +-
 .../devicetree/bindings/net/hisilicon-hns-dsaf.txt |  49 ++
 .../devicetree/bindings/net/hisilicon-hns-mdio.txt |  22 +++
 .../devicetree/bindings/net/hisilicon-hns-nic.txt  |  47 +
 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi   | 193 +
 5 files changed, 313 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
 create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-mdio.txt
 create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
 create mode 100644 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi

diff --git a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
index 988fc69..d1df8a0 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
@@ -32,13 +32,13 @@ Required properties:
 
 Required properties:
 
-- compatible: should be "hisilicon,hip04-mdio".
+- compatible: should be "hisilicon,mdio".
 - Inherits from MDIO bus node binding [2]
 [2] Documentation/devicetree/bindings/net/phy.txt
 
 Example:
mdio {
-   compatible = "hisilicon,hip04-mdio";
+   compatible = "hisilicon,mdio";
reg = <0x28f1000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
new file mode 100644
index 000..80411b2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
@@ -0,0 +1,49 @@
+Hisilicon DSA Fabric device controller
+
+Required properties:
+- compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2".
+  "hisilicon,hns-dsaf-v1" is for hip05.
+  "hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612.
+- dsa-name: dsa fabric name who provide this interface.
+  should be "dsafX", X is the dsaf id.
+- mode: dsa fabric mode string. only support one of dsaf modes like these:
+   "2port-64vf",
+   "6port-16rss",
+   "6port-16vf".
+- interrupt-parent: the interrupt parent of this device.
+- interrupts: should contain the DSA Fabric and rcb interrupt.
+- reg: specifies base physical address(es) and size of the device registers.
+  The first region is external interface control register base and size.
+  The second region is SerDes base register and size.
+  The third region is the PPE register base and size.
+  The fourth region is dsa fabric base register and size.
+  The fifth region is cpld base register and size, it is not required if do 
not use cpld.
+- phy-handle: phy handle of physicl port, 0 if not any phy device. see 
ethernet.txt [1].
+- buf-size: rx buffer size, should be 16-1024.
+- desc-num: number of description in TX and RX queue, should be 512, 1024, 
2048 or 4096.
+
+[1] Documentation/devicetree/bindings/net/phy.txt
+
+Example:
+
+dsa: dsa@c700 {
+   compatible = "hisilicon,hns-dsaf-v1";
+   dsa_name = "dsaf0";
+   mode = "6port-16rss";
+   interrupt-parent = <_dsa>;
+   reg = <0x0 0xC000 0x0 0x42
+  0x0 0xC200 0x0 0x30
+  0x0 0xc500 0x0 0x89
+  0x0 0xc700 0x0 0x6>;
+   phy-handle = <0 0 0 0 _phy4 _phy5 0 0>;
+   interrupts = <131 4>,<132 4>, <133 4>,<134 4>,
+<135 4>,<136 4>, <137 4>,<138 4>,
+<139 4>,<140 4>, <141 4>,<142 4>,
+<143 4>,<144 4>, <145 4>,<146 4>,
+<147 4>,<148 4>, <384 1>,<385 1>,
+<386 1>,<387 1>, <388 1>,<389 1>,
+<390 1>,<391 1>,
+   buf-size = <4096>;
+   desc-num = <1024>;
+   

[PATCH v2 1/5] net: add Hisilicon Network Subsystem support (config and documents)

2015-09-17 Thread huangdaode
The Hisilicon Network Subsystem is a long term evolution IP which is
supposed to be used in Hisilicon ICT SoC. The IP, which is called hns
for short, is a TCP/IP acceleration engine, which can directly decode
TCP/IP stream and distribute them to different ring buffers.

HNS can be configured to work on different mode for different scenario.
This patch make use only some of the mode to make it as standard
ethernet NIC. The other mode will be added soon.

The whole function has 4 kernel sub-modules:

hnae: the HNS acceleration engine framework. It provides a abstract
interface between the engine and the upper layers which make use of the
engine by ring buffer.

hns_enet_drv: a standard ethernet driver that base on the ring buffer.

hns_dsaf: one of the implementation of HNS acceleration engine, which is
applied on Hililicon hip05, Hi1610 and other later-on SoCs

hns_mdio: the mdio control to the PHY, used by acceleration engine

This submit add basic config and documents

Signed-off-by: huangdaode 
Signed-off-by: Kenneth Lee 
Signed-off-by: Yisen Zhuang 
---
 .../bindings/net/hisilicon-hip04-net.txt   |   4 +-
 .../devicetree/bindings/net/hisilicon-hns-dsaf.txt |  49 ++
 .../devicetree/bindings/net/hisilicon-hns-mdio.txt |  22 +++
 .../devicetree/bindings/net/hisilicon-hns-nic.txt  |  47 +
 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi   | 193 +
 5 files changed, 313 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
 create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-mdio.txt
 create mode 100644 Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
 create mode 100644 arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi

diff --git a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
index 988fc69..d1df8a0 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-hip04-net.txt
@@ -32,13 +32,13 @@ Required properties:
 
 Required properties:
 
-- compatible: should be "hisilicon,hip04-mdio".
+- compatible: should be "hisilicon,mdio".
 - Inherits from MDIO bus node binding [2]
 [2] Documentation/devicetree/bindings/net/phy.txt
 
 Example:
mdio {
-   compatible = "hisilicon,hip04-mdio";
+   compatible = "hisilicon,mdio";
reg = <0x28f1000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt 
b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
new file mode 100644
index 000..80411b2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
@@ -0,0 +1,49 @@
+Hisilicon DSA Fabric device controller
+
+Required properties:
+- compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2".
+  "hisilicon,hns-dsaf-v1" is for hip05.
+  "hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612.
+- dsa-name: dsa fabric name who provide this interface.
+  should be "dsafX", X is the dsaf id.
+- mode: dsa fabric mode string. only support one of dsaf modes like these:
+   "2port-64vf",
+   "6port-16rss",
+   "6port-16vf".
+- interrupt-parent: the interrupt parent of this device.
+- interrupts: should contain the DSA Fabric and rcb interrupt.
+- reg: specifies base physical address(es) and size of the device registers.
+  The first region is external interface control register base and size.
+  The second region is SerDes base register and size.
+  The third region is the PPE register base and size.
+  The fourth region is dsa fabric base register and size.
+  The fifth region is cpld base register and size, it is not required if do 
not use cpld.
+- phy-handle: phy handle of physicl port, 0 if not any phy device. see 
ethernet.txt [1].
+- buf-size: rx buffer size, should be 16-1024.
+- desc-num: number of description in TX and RX queue, should be 512, 1024, 
2048 or 4096.
+
+[1] Documentation/devicetree/bindings/net/phy.txt
+
+Example:
+
+dsa: dsa@c700 {
+   compatible = "hisilicon,hns-dsaf-v1";
+   dsa_name = "dsaf0";
+   mode = "6port-16rss";
+   interrupt-parent = <_dsa>;
+   reg = <0x0 0xC000 0x0 0x42
+  0x0 0xC200 0x0 0x30
+  0x0 0xc500 0x0 0x89
+  0x0 0xc700 0x0 0x6>;
+   phy-handle = <0 0 0 0 _phy4 _phy5 0 0>;
+   interrupts = <131 4>,<132 4>, <133 4>,<134 4>,
+<135 4>,<136 4>, <137 4>,<138 4>,
+<139 4>,<140 4>, <141 4>,<142 4>,
+<143 4>,<144 4>, <145 4>,<146 4>,
+<147 4>,<148 4>, <384 1>,<385 1>,
+<386 1>,<387 1>, <388 1>,<389 1>,
+<390 1>,<391 1>,