keystone-netcp.txt 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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) subsystem 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. - cpts: sub-node time synchronization (CPTS) submodule configuration
  94. -- clocks: CPTS reference clock. Should point on cpts-refclk-mux clock.
  95. -- clock-names: should be "cpts"
  96. -- cpts-refclk-mux: multiplexer clock definition sub-node for CPTS reference (RFTCLK) clock
  97. --- #clock-cells: should be 0
  98. --- clocks: list of CPTS reference (RFTCLK) clock's parents as defined in Data manual
  99. --- ti,mux-tbl: array of multiplexer indexes as defined in Data manual
  100. --- assigned-clocks: should point on cpts-refclk-mux clock
  101. --- assigned-clock-parents: should point on required RFTCLK clock parent to be selected
  102. -- cpts_clock_mult: (optional) Numerator to convert input clock ticks
  103. into nanoseconds
  104. -- cpts_clock_shift: (optional) Denominator to convert input clock ticks into
  105. nanoseconds.
  106. Mult and shift will be calculated basing on CPTS
  107. rftclk frequency if both cpts_clock_shift and
  108. cpts_clock_mult properties are not provided.
  109. Optional properties:
  110. - enable-ale: NetCP driver keeps the address learning feature in the ethernet
  111. switch module disabled. This attribute is to enable the address
  112. learning.
  113. - secondary-slave-ports: specification for each of the switch port not be
  114. registered as a network interface. NetCP driver
  115. will only initialize these ports and attach PHY
  116. driver to them if needed.
  117. NetCP interface properties: Interface specification for NetCP sub-modules.
  118. Required properties:
  119. - rx-channel: the navigator packet dma channel name for rx.
  120. - rx-queue: the navigator queue number associated with rx dma channel.
  121. - rx-pool: specifies the number of descriptors to be used & the region-id
  122. for creating the rx descriptor pool.
  123. - tx-pool: specifies the number of descriptors to be used & the region-id
  124. for creating the tx descriptor pool.
  125. - rx-queue-depth: number of descriptors in each of the free descriptor
  126. queue (FDQ) for the pktdma Rx flow. There can be at
  127. present a maximum of 4 queues per Rx flow.
  128. - rx-buffer-size: the buffer size for each of the Rx flow FDQ.
  129. - tx-completion-queue: the navigator queue number where the descriptors are
  130. recycled after Tx DMA completion.
  131. Optional properties:
  132. - efuse-mac: If this is 1, then the MAC address for the interface is
  133. obtained from the device efuse mac address register.
  134. If this is 2, the two DWORDs occupied by the MAC address
  135. are swapped. The netcp driver will swap the two DWORDs
  136. back to the proper order when this property is set to 2
  137. when it obtains the mac address from efuse.
  138. - "netcp-device label": phandle to the device specification for each of NetCP
  139. sub-module attached to this interface.
  140. The MAC address will be determined using the optional properties defined in
  141. ethernet.txt and only if efuse-mac is set to 0. If all of the optional MAC
  142. address properties are not present, then the driver will use a random MAC
  143. address.
  144. Example binding:
  145. netcp: netcp@2000000 {
  146. reg = <0x2620110 0x8>;
  147. reg-names = "efuse";
  148. compatible = "ti,netcp-1.0";
  149. #address-cells = <1>;
  150. #size-cells = <1>;
  151. ranges = <0 0x2000000 0xfffff>;
  152. clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
  153. dma-coherent;
  154. /* big-endian; */
  155. dma-id = <0>;
  156. netcp-devices {
  157. #address-cells = <1>;
  158. #size-cells = <1>;
  159. ranges;
  160. gbe@90000 {
  161. label = "netcp-gbe";
  162. reg = <0x90000 0x300>, <0x90400 0x400>, <0x90800 0x700>;
  163. /* enable-ale; */
  164. tx-queue = <648>;
  165. tx-channel = <8>;
  166. cpts {
  167. clocks = <&cpts_refclk_mux>;
  168. clock-names = "cpts";
  169. cpts_refclk_mux: cpts-refclk-mux {
  170. #clock-cells = <0>;
  171. clocks = <&chipclk12>, <&chipclk13>,
  172. <&timi0>, <&timi1>,
  173. <&tsipclka>, <&tsrefclk>,
  174. <&tsipclkb>;
  175. ti,mux-tbl = <0x0>, <0x1>, <0x2>,
  176. <0x3>, <0x4>, <0x8>, <0xC>;
  177. assigned-clocks = <&cpts_refclk_mux>;
  178. assigned-clock-parents = <&chipclk12>;
  179. };
  180. };
  181. interfaces {
  182. gbe0: interface-0 {
  183. slave-port = <0>;
  184. link-interface = <4>;
  185. };
  186. gbe1: interface-1 {
  187. slave-port = <1>;
  188. link-interface = <4>;
  189. };
  190. };
  191. secondary-slave-ports {
  192. port-2 {
  193. slave-port = <2>;
  194. link-interface = <2>;
  195. };
  196. port-3 {
  197. slave-port = <3>;
  198. link-interface = <2>;
  199. };
  200. };
  201. };
  202. };
  203. netcp-interfaces {
  204. interface-0 {
  205. rx-channel = <22>;
  206. rx-pool = <1024 12>;
  207. tx-pool = <1024 12>;
  208. rx-queue-depth = <128 128 0 0>;
  209. rx-buffer-size = <1518 4096 0 0>;
  210. rx-queue = <8704>;
  211. tx-completion-queue = <8706>;
  212. efuse-mac = <1>;
  213. netcp-gbe = <&gbe0>;
  214. };
  215. interface-1 {
  216. rx-channel = <23>;
  217. rx-pool = <1024 12>;
  218. tx-pool = <1024 12>;
  219. rx-queue-depth = <128 128 0 0>;
  220. rx-buffer-size = <1518 4096 0 0>;
  221. rx-queue = <8705>;
  222. tx-completion-queue = <8707>;
  223. efuse-mac = <0>;
  224. local-mac-address = [02 18 31 7e 3e 6f];
  225. netcp-gbe = <&gbe1>;
  226. };
  227. };
  228. };
  229. CPTS board configuration - select external CPTS RFTCLK:
  230. &tsrefclk{
  231. clock-frequency = <500000000>;
  232. };
  233. &cpts_refclk_mux {
  234. assigned-clock-parents = <&tsrefclk>;
  235. };