huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 1 | Hisilicon DSA Fabric device controller |
| 2 | |
| 3 | Required properties: |
| 4 | - compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2". |
| 5 | "hisilicon,hns-dsaf-v1" is for hip05. |
| 6 | "hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612. |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 7 | - mode: dsa fabric mode string. only support one of dsaf modes like these: |
| 8 | "2port-64vf", |
| 9 | "6port-16rss", |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 10 | "6port-16vf", |
| 11 | "single-port". |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 12 | - interrupt-parent: the interrupt parent of this device. |
| 13 | - interrupts: should contain the DSA Fabric and rcb interrupt. |
| 14 | - reg: specifies base physical address(es) and size of the device registers. |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 15 | The first region is external interface control register base and size(optional, |
Yisen.Zhuang\(Zhuangyuzeng\) | a1ecde2 | 2016-04-28 15:09:03 +0800 | [diff] [blame^] | 16 | only used when subctrl-syscon does not exist). It is recommended using |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 17 | subctrl-syscon rather than this address. |
Yisen.Zhuang\(Zhuangyuzeng\) | a1ecde2 | 2016-04-28 15:09:03 +0800 | [diff] [blame^] | 18 | The second region is SerDes base register and size(optional, only used when |
| 19 | serdes-syscon in port node does not exist). It is recommended using |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 20 | serdes-syscon rather than this address. |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 21 | The third region is the PPE register base and size. |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 22 | The fourth region is dsa fabric base register and size. It is not required for |
| 23 | single-port mode. |
| 24 | - reg-names: may be ppe-base and(or) dsaf-base. It is used to find the |
| 25 | corresponding reg's index. |
| 26 | |
Yisen.Zhuang\(Zhuangyuzeng\) | a1ecde2 | 2016-04-28 15:09:03 +0800 | [diff] [blame^] | 27 | - phy-handle: phy handle of physical port, 0 if not any phy device. It is optional |
| 28 | attribute. If port node exists, phy-handle in each port node will be used. |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 29 | see ethernet.txt [1]. |
| 30 | - subctrl-syscon: is syscon handle for external interface control register. |
| 31 | - reset-field-offset: is offset of reset field. Its value depends on the hardware |
| 32 | user manual. |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 33 | - buf-size: rx buffer size, should be 16-1024. |
| 34 | - desc-num: number of description in TX and RX queue, should be 512, 1024, 2048 or 4096. |
| 35 | |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 36 | - port: subnodes of dsaf. A dsaf node may contain several port nodes(Depending |
| 37 | on mode of dsaf). Port node contain some attributes listed below: |
Yisen.Zhuang\(Zhuangyuzeng\) | a1ecde2 | 2016-04-28 15:09:03 +0800 | [diff] [blame^] | 38 | - reg: is physical port index in one dsaf. |
| 39 | - phy-handle: phy handle of physical port. It is not required if there isn't |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 40 | phy device. see ethernet.txt [1]. |
| 41 | - serdes-syscon: is syscon handle for SerDes register. |
Yisen.Zhuang\(Zhuangyuzeng\) | a1ecde2 | 2016-04-28 15:09:03 +0800 | [diff] [blame^] | 42 | - cpld-syscon: is syscon handle + register offset pair for cpld register. It is |
| 43 | not required if there isn't cpld device. |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 44 | - port-rst-offset: is offset of reset field for each port in dsaf. Its value |
| 45 | depends on the hardware user manual. |
| 46 | - port-mode-offset: is offset of port mode field for each port in dsaf. Its |
| 47 | value depends on the hardware user manual. |
| 48 | |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 49 | [1] Documentation/devicetree/bindings/net/phy.txt |
| 50 | |
| 51 | Example: |
| 52 | |
yankejian | 48189d6 | 2016-01-20 16:00:19 +0800 | [diff] [blame] | 53 | dsaf0: dsa@c7000000 { |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 54 | compatible = "hisilicon,hns-dsaf-v1"; |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 55 | mode = "6port-16rss"; |
| 56 | interrupt-parent = <&mbigen_dsa>; |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 57 | reg = <0x0 0xc5000000 0x0 0x890000 |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 58 | 0x0 0xc7000000 0x0 0x60000>; |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 59 | reg-names = "ppe-base", "dsaf-base"; |
| 60 | subctrl-syscon = <&subctrl>; |
| 61 | reset-field-offset = 0; |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 62 | interrupts = <131 4>,<132 4>, <133 4>,<134 4>, |
| 63 | <135 4>,<136 4>, <137 4>,<138 4>, |
| 64 | <139 4>,<140 4>, <141 4>,<142 4>, |
| 65 | <143 4>,<144 4>, <145 4>,<146 4>, |
| 66 | <147 4>,<148 4>, <384 1>,<385 1>, |
| 67 | <386 1>,<387 1>, <388 1>,<389 1>, |
| 68 | <390 1>,<391 1>, |
| 69 | buf-size = <4096>; |
| 70 | desc-num = <1024>; |
| 71 | dma-coherent; |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 72 | |
Yisen.Zhuang\(Zhuangyuzeng\) | a1ecde2 | 2016-04-28 15:09:03 +0800 | [diff] [blame^] | 73 | port@0 { |
| 74 | reg = 0; |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 75 | phy-handle = <&phy0>; |
| 76 | serdes-syscon = <&serdes>; |
| 77 | }; |
| 78 | |
Yisen.Zhuang\(Zhuangyuzeng\) | a1ecde2 | 2016-04-28 15:09:03 +0800 | [diff] [blame^] | 79 | port@1 { |
| 80 | reg = 1; |
Yisen.Zhuang\(Zhuangyuzeng\) | 2fc695a | 2016-04-23 17:05:15 +0800 | [diff] [blame] | 81 | serdes-syscon = <&serdes>; |
| 82 | }; |
huangdaode | fc7e37c | 2015-09-17 14:51:46 +0800 | [diff] [blame] | 83 | }; |