keystone-netcp.txt 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. This document describes the device tree bindings associated with the
  2. keystone network coprocessor(NetCP) driver support.
  3. The network coprocessor (NetCP) is a hardware accelerator that processes
  4. Ethernet packets. NetCP has a gigabit Ethernet (GbE) subsytem with a ethernet
  5. switch sub-module to send and receive packets. NetCP also includes a packet
  6. accelerator (PA) module to perform packet classification operations such as
  7. header matching, and packet modification operations such as checksum
  8. generation. NetCP can also optionally include a Security Accelerator (SA)
  9. capable of performing IPSec operations on ingress/egress packets.
  10. Keystone II SoC's also have a 10 Gigabit Ethernet Subsystem (XGbE) which
  11. includes a 3-port Ethernet switch sub-module capable of 10Gb/s and 1Gb/s rates
  12. per Ethernet port.
  13. Keystone NetCP driver has a plug-in module architecture where each of the NetCP
  14. sub-modules exist as a loadable kernel module which plug in to the netcp core.
  15. These sub-modules are represented as "netcp-devices" in the dts bindings. It is
  16. mandatory to have the ethernet switch sub-module for the ethernet interface to
  17. be operational. Any other sub-module like the PA is optional.
  18. NetCP Ethernet SubSystem Layout:
  19. -----------------------------
  20. NetCP subsystem(10G or 1G)
  21. -----------------------------
  22. |
  23. |-> NetCP Devices -> |
  24. | |-> GBE/XGBE Switch
  25. | |
  26. | |-> Packet Accelerator
  27. | |
  28. | |-> Security Accelerator
  29. |
  30. |
  31. |
  32. |-> NetCP Interfaces -> |
  33. |-> Ethernet Port 0
  34. |
  35. |-> Ethernet Port 1
  36. |
  37. |-> Ethernet Port 2
  38. |
  39. |-> Ethernet Port 3
  40. NetCP subsystem properties:
  41. Required properties:
  42. - compatible: Should be "ti,netcp-1.0"
  43. - clocks: phandle to the reference clocks for the subsystem.
  44. - dma-id: Navigator packet dma instance id.
  45. - ranges: address range of NetCP (includes, Ethernet SS, PA and SA)
  46. Optional properties:
  47. - reg: register location and the size for the following register
  48. regions in the specified order.
  49. - Efuse MAC address register
  50. - dma-coherent: Present if dma operations are coherent
  51. - big-endian: Keystone devices can be operated in a mode where the DSP is in
  52. the big endian mode. In such cases enable this option. This
  53. option should also be enabled if the ARM is operated in
  54. big endian mode with the DSP in little endian.
  55. NetCP device properties: Device specification for NetCP sub-modules.
  56. 1Gb/10Gb (gbe/xgbe) ethernet switch sub-module specifications.
  57. Required properties:
  58. - label: Must be "netcp-gbe" for 1Gb & "netcp-xgbe" for 10Gb.
  59. - compatible: Must be one of below:-
  60. "ti,netcp-gbe" for 1GbE on NetCP 1.4
  61. "ti,netcp-gbe-5" for 1GbE N NetCP 1.5 (N=5)
  62. "ti,netcp-gbe-9" for 1GbE N NetCP 1.5 (N=9)
  63. "ti,netcp-gbe-2" for 1GbE N NetCP 1.5 (N=2)
  64. "ti,netcp-xgbe" for 10 GbE
  65. - reg: register location and the size for the following register
  66. regions in the specified order.
  67. - switch subsystem registers
  68. - sgmii port3/4 module registers (only for NetCP 1.4)
  69. - switch module registers
  70. - serdes registers (only for 10G)
  71. NetCP 1.4 ethss, here is the order
  72. index #0 - switch subsystem registers
  73. index #1 - sgmii port3/4 module registers
  74. index #2 - switch module registers
  75. NetCP 1.5 ethss 9 port, 5 port and 2 port
  76. index #0 - switch subsystem registers
  77. index #1 - switch module registers
  78. index #2 - serdes registers
  79. - tx-channel: the navigator packet dma channel name for tx.
  80. - tx-queue: the navigator queue number associated with the tx dma channel.
  81. - interfaces: specification for each of the switch port to be registered as a
  82. network interface in the stack.
  83. -- slave-port: Switch port number, 0 based numbering.
  84. -- link-interface: type of link interface, supported options are
  85. - mac<->mac auto negotiate mode: 0
  86. - mac<->phy mode: 1
  87. - mac<->mac forced mode: 2
  88. - mac<->fiber mode: 3
  89. - mac<->phy mode with no mdio: 4
  90. - 10Gb mac<->phy mode : 10
  91. - 10Gb mac<->mac forced mode : 11
  92. ----phy-handle: phandle to PHY device
  93. Optional properties:
  94. - enable-ale: NetCP driver keeps the address learning feature in the ethernet
  95. switch module disabled. This attribute is to enable the address
  96. learning.
  97. - secondary-slave-ports: specification for each of the switch port not be
  98. registered as a network interface. NetCP driver
  99. will only initialize these ports and attach PHY
  100. driver to them if needed.
  101. NetCP interface properties: Interface specification for NetCP sub-modules.
  102. Required properties:
  103. - rx-channel: the navigator packet dma channel name for rx.
  104. - rx-queue: the navigator queue number associated with rx dma channel.
  105. - rx-pool: specifies the number of descriptors to be used & the region-id
  106. for creating the rx descriptor pool.
  107. - tx-pool: specifies the number of descriptors to be used & the region-id
  108. for creating the tx descriptor pool.
  109. - rx-queue-depth: number of descriptors in each of the free descriptor
  110. queue (FDQ) for the pktdma Rx flow. There can be at
  111. present a maximum of 4 queues per Rx flow.
  112. - rx-buffer-size: the buffer size for each of the Rx flow FDQ.
  113. - tx-completion-queue: the navigator queue number where the descriptors are
  114. recycled after Tx DMA completion.
  115. Optional properties:
  116. - efuse-mac: If this is 1, then the MAC address for the interface is
  117. obtained from the device efuse mac address register.
  118. If this is 2, the two DWORDs occupied by the MAC address
  119. are swapped. The netcp driver will swap the two DWORDs
  120. back to the proper order when this property is set to 2
  121. when it obtains the mac address from efuse.
  122. - local-mac-address: the driver is designed to use the of_get_mac_address api
  123. only if efuse-mac is 0. When efuse-mac is 0, the MAC
  124. address is obtained from local-mac-address. If this
  125. attribute is not present, then the driver will use a
  126. random MAC address.
  127. - "netcp-device label": phandle to the device specification for each of NetCP
  128. sub-module attached to this interface.
  129. Example binding:
  130. netcp: netcp@2000000 {
  131. reg = <0x2620110 0x8>;
  132. reg-names = "efuse";
  133. compatible = "ti,netcp-1.0";
  134. #address-cells = <1>;
  135. #size-cells = <1>;
  136. ranges = <0 0x2000000 0xfffff>;
  137. clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
  138. dma-coherent;
  139. /* big-endian; */
  140. dma-id = <0>;
  141. netcp-devices {
  142. #address-cells = <1>;
  143. #size-cells = <1>;
  144. ranges;
  145. gbe@90000 {
  146. label = "netcp-gbe";
  147. reg = <0x90000 0x300>, <0x90400 0x400>, <0x90800 0x700>;
  148. /* enable-ale; */
  149. tx-queue = <648>;
  150. tx-channel = <8>;
  151. interfaces {
  152. gbe0: interface-0 {
  153. slave-port = <0>;
  154. link-interface = <4>;
  155. };
  156. gbe1: interface-1 {
  157. slave-port = <1>;
  158. link-interface = <4>;
  159. };
  160. };
  161. secondary-slave-ports {
  162. port-2 {
  163. slave-port = <2>;
  164. link-interface = <2>;
  165. };
  166. port-3 {
  167. slave-port = <3>;
  168. link-interface = <2>;
  169. };
  170. };
  171. };
  172. };
  173. netcp-interfaces {
  174. interface-0 {
  175. rx-channel = <22>;
  176. rx-pool = <1024 12>;
  177. tx-pool = <1024 12>;
  178. rx-queue-depth = <128 128 0 0>;
  179. rx-buffer-size = <1518 4096 0 0>;
  180. rx-queue = <8704>;
  181. tx-completion-queue = <8706>;
  182. efuse-mac = <1>;
  183. netcp-gbe = <&gbe0>;
  184. };
  185. interface-1 {
  186. rx-channel = <23>;
  187. rx-pool = <1024 12>;
  188. tx-pool = <1024 12>;
  189. rx-queue-depth = <128 128 0 0>;
  190. rx-buffer-size = <1518 4096 0 0>;
  191. rx-queue = <8705>;
  192. tx-completion-queue = <8707>;
  193. efuse-mac = <0>;
  194. local-mac-address = [02 18 31 7e 3e 6f];
  195. netcp-gbe = <&gbe1>;
  196. };
  197. };
  198. };