keystone-netcp.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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. ===================================================================
  58. Required properties:
  59. - label: Must be "netcp-gbe" for 1Gb & "netcp-xgbe" for 10Gb.
  60. - compatible: Must be one of below:-
  61. "ti,netcp-gbe" for 1GbE on NetCP 1.4
  62. "ti,netcp-gbe-5" for 1GbE N NetCP 1.5 (N=5)
  63. "ti,netcp-gbe-9" for 1GbE N NetCP 1.5 (N=9)
  64. "ti,netcp-gbe-2" for 1GbE N NetCP 1.5 (N=2)
  65. "ti,netcp-xgbe" for 10 GbE
  66. - syscon-subsys: phandle to syscon node of the switch
  67. subsystem registers.
  68. - syscon-pcsr: (10gbe only) phandle to syscon node of the
  69. switch PCSR registers.
  70. - reg: register location and the size for the following register
  71. regions in the specified order.
  72. - switch subsystem registers
  73. - sgmii module registers
  74. - sgmii port3/4 module registers (only for NetCP 1.4)
  75. - switch module registers
  76. NetCP 1.4 ethss, here is the order
  77. index #0 - sgmii module registers
  78. index #1 - sgmii port3/4 module registers
  79. index #2 - switch module registers
  80. NetCP 1.5 ethss 9 port, 5 port and 2 port
  81. index #0 - sgmii module registers
  82. index #1 - switch module registers
  83. - tx-channel: the navigator packet dma channel name for tx.
  84. - tx-queue: the navigator queue number associated with the tx dma channel.
  85. - interfaces: specification for each of the switch port to be registered as a
  86. network interface in the stack.
  87. -- slave-port: Switch port number, 0 based numbering.
  88. -- link-interface: type of link interface, supported options are
  89. - mac<->mac auto negotiate mode: 0
  90. - mac<->phy mode: 1
  91. - mac<->mac forced mode: 2
  92. - mac<->fiber mode: 3
  93. - mac<->phy mode with no mdio: 4
  94. - 10Gb mac<->phy mode : 10
  95. - 10Gb mac<->mac forced mode : 11
  96. ----phy-handle: phandle to PHY device
  97. ----phys: phandles to serdes PHY devices
  98. see Documentation/devicetree/bindings/phy/ti-phy.txt
  99. for Keystone SerDes device specificcations.
  100. Optional properties:
  101. - enable-ale: NetCP driver keeps the address learning feature in the ethernet
  102. switch module disabled. This attribute is to enable the address
  103. learning.
  104. - secondary-slave-ports: specification for each of the switch port not be
  105. registered as a network interface. NetCP driver
  106. will only initialize these ports and attach PHY
  107. driver to them if needed.
  108. Properties related to cpts configurations.
  109. - cpts-rftclk-sel: selects one of up to 32 clocks for time sync
  110. reference. Default = 0.
  111. - cpts_clock_mult/cpts_clock_shift:
  112. used for converting time counter cycles to ns as in
  113. ns = (cycles * clock_mult) >> _shift
  114. Defaults: clock_mult, clock_shift = calculated from
  115. CPTS refclk
  116. - cpts-ext-ts-inputs:
  117. The number of external time stamp channels.
  118. The different CPTS versions might support up 8
  119. external time stamp channels. if absent - unsupported.
  120. NetCP interface properties: Interface specification for NetCP sub-modules.
  121. Required properties:
  122. - rx-channel: the navigator packet dma channel name for rx.
  123. - rx-queue: the navigator queue number associated with rx dma channel.
  124. - rx-pool: specifies the number of descriptors to be used & the region-id
  125. for creating the rx descriptor pool.
  126. - tx-pool: specifies the number of descriptors to be used & the region-id
  127. for creating the tx descriptor pool.
  128. - rx-queue-depth: number of descriptors in each of the free descriptor
  129. queue (FDQ) for the pktdma Rx flow. There can be at
  130. present a maximum of 4 queues per Rx flow.
  131. - rx-buffer-size: the buffer size for each of the Rx flow FDQ.
  132. - tx-completion-queue: the navigator queue number where the descriptors are
  133. recycled after Tx DMA completion.
  134. Optional properties:
  135. - efuse-mac: If this is 1, then the MAC address for the interface is
  136. obtained from the device efuse mac address register.
  137. If this is 2, the two DWORDs occupied by the MAC address
  138. are swapped. The netcp driver will swap the two DWORDs
  139. back to the proper order when this property is set to 2
  140. when it obtains the mac address from efuse.
  141. - local-mac-address: the driver is designed to use the of_get_mac_address api
  142. only if efuse-mac is 0. When efuse-mac is 0, the MAC
  143. address is obtained from local-mac-address. If this
  144. attribute is not present, then the driver will use a
  145. random MAC address.
  146. - "netcp-device label": phandle to the device specification for each of NetCP
  147. sub-module attached to this interface.
  148. Example binding:
  149. gbe_subsys: subsys@2090000 {
  150. compatible = "syscon";
  151. reg = <0x02090000 0x100>;
  152. };
  153. gbe_serdes: phy@232a000 {
  154. #address-cells = <1>;
  155. #size-cells = <0>;
  156. compatible = "ti,keystone-serdes-gbe";
  157. reg = <0x0232a000 0x2000>;
  158. status = "ok";
  159. link-rate-kbps = <1250000>;
  160. num-lanes = <4>;
  161. serdes_lane0: lane@0 {
  162. #phy-cells = <0>;
  163. reg = <0>;
  164. status = "ok";
  165. control-rate = <2>;
  166. rx-start = <7 5>;
  167. rx-force = <1 1>;
  168. tx-coeff = <0 0 0 12 4>;
  169. };
  170. serdes_lane1: lane@1 {
  171. #phy-cells = <0>;
  172. reg = <1>;
  173. status = "ok";
  174. control-rate = <2>;
  175. rx-start = <7 5>;
  176. rx-force = <1 1>;
  177. tx-coeff = <0 0 0 12 4>;
  178. };
  179. serdes_lane2: lane@2 {
  180. #phy-cells = <0>;
  181. reg = <2>;
  182. status = "disabled";
  183. control-rate = <2>;
  184. rx-start = <7 5>;
  185. rx-force = <1 1>;
  186. tx-coeff = <0 0 0 12 4>;
  187. };
  188. serdes_lane3: lane@3 {
  189. #phy-cells = <0>;
  190. reg = <3>;
  191. status = "disabled";
  192. control-rate = <2>;
  193. rx-start = <7 5>;
  194. rx-force = <1 1>;
  195. tx-coeff = <0 0 0 12 4>;
  196. };
  197. };
  198. netcp: netcp@2000000 {
  199. reg = <0x2620110 0x8>;
  200. reg-names = "efuse";
  201. compatible = "ti,netcp-1.0";
  202. #address-cells = <1>;
  203. #size-cells = <1>;
  204. ranges = <0 0x2000000 0xfffff>;
  205. clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
  206. dma-coherent;
  207. dma-id = <0>;
  208. netcp-devices {
  209. #address-cells = <1>;
  210. #size-cells = <1>;
  211. ranges;
  212. gbe@90000 {
  213. label = "netcp-gbe";
  214. syscon-subsys = <&gbe_subsys>;
  215. reg = <0x90100 0x200>, <0x90400 0x200>, <0x90800 0x700>;
  216. tx-queue = <648>;
  217. tx-channel = <8>;
  218. interfaces {
  219. gbe0: interface-0 {
  220. phys = <&serdes_lane0>;
  221. slave-port = <0>;
  222. link-interface = <4>;
  223. };
  224. gbe1: interface-1 {
  225. phys = <&serdes_lane1>;
  226. slave-port = <1>;
  227. link-interface = <4>;
  228. };
  229. };
  230. secondary-slave-ports {
  231. port-2 {
  232. phys = <&serdes_lane2>;
  233. slave-port = <2>;
  234. link-interface = <2>;
  235. };
  236. port-3 {
  237. phys = <&serdes_lane3>;
  238. slave-port = <3>;
  239. link-interface = <2>;
  240. };
  241. };
  242. };
  243. };
  244. netcp-interfaces {
  245. interface-0 {
  246. rx-channel = <22>;
  247. rx-pool = <1024 12>;
  248. tx-pool = <1024 12>;
  249. rx-queue-depth = <128 128 0 0>;
  250. rx-buffer-size = <1518 4096 0 0>;
  251. rx-queue = <8704>;
  252. tx-completion-queue = <8706>;
  253. efuse-mac = <1>;
  254. netcp-gbe = <&gbe0>;
  255. };
  256. interface-1 {
  257. rx-channel = <23>;
  258. rx-pool = <1024 12>;
  259. tx-pool = <1024 12>;
  260. rx-queue-depth = <128 128 0 0>;
  261. rx-buffer-size = <1518 4096 0 0>;
  262. rx-queue = <8705>;
  263. tx-completion-queue = <8707>;
  264. efuse-mac = <0>;
  265. local-mac-address = [02 18 31 7e 3e 6f];
  266. netcp-gbe = <&gbe1>;
  267. };
  268. };
  269. };
  270. Example bindings (10gbe):
  271. xgbe_subsys: subsys@2f00000 {
  272. status = "disabled";
  273. compatible = "syscon";
  274. reg = <0x02f00000 0x100>;
  275. };
  276. xgbe_pcsr: pcsr@2f00600 {
  277. status = "disabled";
  278. compatible = "syscon";
  279. reg = <0x02f00600 0x100>;
  280. };
  281. xgbe_serdes: phy@231e000 {
  282. #address-cells = <1>;
  283. #size-cells = <0>;
  284. compatible = "ti,keystone-serdes-xgbe";
  285. reg = <0x0231e000 0x2000>;
  286. status = "disabled";
  287. link-rate-kbps = <10312500>;
  288. num-lanes = <2>;
  289. syscon-peripheral = <&xgbe_subsys>;
  290. syscon-link = <&xgbe_pcsr>;
  291. xserdes_lane0: lane@0 {
  292. #phy-cells = <0>;
  293. reg = <0>;
  294. status = "ok";
  295. control-rate = <0>;
  296. rx-start = <7 5>;
  297. rx-force = <1 1>;
  298. tx-coeff = <2 0 0 12 4>;
  299. };
  300. xserdes_lane1: lane@1 {
  301. #phy-cells = <0>;
  302. reg = <1>;
  303. status = "ok";
  304. control-rate = <0>;
  305. rx-start = <7 5>;
  306. rx-force = <1 1>;
  307. tx-coeff = <2 0 0 12 4>;
  308. };
  309. };
  310. netcpx: netcpx@2f00000 {
  311. status = "disabled";
  312. compatible = "ti,netcp-1.0";
  313. #address-cells = <1>;
  314. #size-cells = <1>;
  315. ranges;
  316. clocks = <&clkxge>;
  317. clock-names = "clk_xge";
  318. dma-coherent;
  319. ti,navigator-dmas = <&dma_xgbe 0>,
  320. <&dma_xgbe 8>,
  321. <&dma_xgbe 0>;
  322. ti,navigator-dma-names = "xnetrx0", "xnetrx1", "xnettx";
  323. netcp-devices {
  324. #address-cells = <1>;
  325. #size-cells = <1>;
  326. ranges;
  327. xgbe@2f00000 {
  328. label = "netcp-xgbe";
  329. compatible = "ti,netcp-xgbe";
  330. syscon-subsys = <&xgbe_subsys>;
  331. syscon-pcsr = <&xgbe_pcsr>;
  332. reg = <0x02f00100 0x200>, <0x02f01000 0xb00>;
  333. tx-queue = <692>;
  334. tx-channel = "xnettx";
  335. interfaces {
  336. xgbe0: interface-0 {
  337. phys = <&xserdes_lane0>;
  338. slave-port = <0>;
  339. link-interface = <11>;
  340. };
  341. xgbe1: interface-1 {
  342. phys = <&xserdes_lane1>;
  343. slave-port = <1>;
  344. link-interface = <11>;
  345. };
  346. };
  347. };
  348. };
  349. netcp-interfaces {
  350. interface-0 {
  351. rx-channel = "xnetrx0";
  352. rx-pool = <2048 12>;
  353. tx-pool = <1024 12>;
  354. rx-queue-depth = <1024 1024 0 0>;
  355. rx-buffer-size = <1536 4096 0 0>;
  356. rx-queue = <532>;
  357. tx-completion-queue = <534>;
  358. efuse-mac = <0>;
  359. netcp-xgbe = <&xgbe0>;
  360. };
  361. interface-1 {
  362. rx-channel = "xnetrx1";
  363. rx-pool = <2048 12>;
  364. tx-pool = <1024 12>;
  365. rx-queue-depth = <1024 1024 0 0>;
  366. rx-buffer-size = <1536 4096 0 0>;
  367. rx-queue = <533>;
  368. tx-completion-queue = <535>;
  369. efuse-mac = <0>;
  370. netcp-xgbe = <&xgbe1>;
  371. };
  372. };
  373. };
  374. Packet Accelarator sub-module specifications.
  375. =============================================
  376. Note: The bindings are experimental and may change while feature development
  377. is in progress. However attempt will be made to make changes backward
  378. compatible if possible.
  379. Required properties:
  380. - label: Must be "netcp-pa" for PA on K2H/K SoC
  381. Must be "netcp-pa2" for PA2 on K2L/E SoCs
  382. - compatible: Must be one of below:-
  383. "ti,netcp-pa" for PA
  384. "ti,netcp-pa2" for PA2
  385. - reg: register location and the size for the following register
  386. regions in the specified order.
  387. Packet Accelarator (PA)
  388. - Mailbox
  389. - Packet ID
  390. - LUT2
  391. - streaming switch
  392. - Control
  393. - Timers
  394. - Statistics
  395. - IRAM
  396. - SRAM
  397. Packet Accelarator 2 (PA2)
  398. - Mailbox
  399. - RA bridge
  400. - Thread mapper
  401. - RA
  402. - Statistics regs
  403. - Statistics block
  404. - cluster memory
  405. - clusters: Contain cluster specific configuration
  406. reg: cluster ID
  407. tx-queue: Queue for sending commands/data to a cluster
  408. tx-channel: knav Tx channel associated with the queue
  409. - tx-cmd-pool: specifies the number of descriptors to be used & the region-id
  410. for creating the tx descriptor pool for tx channnels.
  411. - rx-cmd-rsp-chan: rx channel name for receiving responses from
  412. PDSPs
  413. - rx-cmd-rsp-pool: specifies the number of descriptors to be used
  414. & the region-id for creating the rx descriptor
  415. pool for rx rsp channel.
  416. - rx-cmd-rsp-queue-depth: number of descriptors in each of the free
  417. descriptor queue (FDQ) for the pktdma Rx flow.
  418. There can be at present a maximum of 4 queues
  419. per Rx flow.
  420. - rx-cmd-rsp-buffer-size: Size of the buffers allocated for the desc
  421. in each rx response FDQs.
  422. - mac-lut-ranges: LUT range of index used by PA device for MAC
  423. rules. LUT is shared across different software
  424. components in the system and this range is
  425. reserved for PA device.
  426. - rx-route: Rx Queue / Flow base used by PA. They should
  427. match with rx-channel queue / flow for netcp
  428. ethernet interface when PA is in the rx path.
  429. - netcp-interfaces: interface specific configuration for PA.
  430. slave-port cpsw slave port number for the interface
  431. Optional properties:-
  432. - ip-lut-ranges: LUT range of index reserved for PA device.
  433. Used for rx checksum handling.
  434. - netcp-interfaces: interface specific configuration for PA.
  435. rx-channel: rx channel name for ethernet interface when PA
  436. is in the rx path for data. Uses a different
  437. flow id when PA is added to the rx path.
  438. - disable-hw-timestamp: Disable hw timestamp feature.
  439. Example:
  440. PA is a netcp device and appears under netcp-devices node. Example bindings for
  441. PA device is provided below.
  442. netcp-devices {
  443. <other netcp devices>
  444. pa@0 {
  445. #address-cells = <1>;
  446. #size-cells = <1>;
  447. label = "netcp-pa";
  448. compatible = "ti,netcp-pa";
  449. reg = <0 0x60>,
  450. <0x400 0x10>,
  451. <0x500 0x40>,
  452. <0x604 0x4>,
  453. <0x1000 0x600>,
  454. <0x3000 0x600>,
  455. <0x6000 0x100>,
  456. <0x10000 0x30000>,
  457. <0x40000 0x8000>;
  458. mac-lut-ranges = <0 43 56 63>;
  459. ip-lut-ranges = <61 63>;
  460. rx-route = <8704 22>;
  461. tx-cmd-pool = <256 12>;
  462. rx-cmd-rsp-pool = <256 12>;
  463. rx-cmd-rsp-chan = "pa-cmd-rsp";
  464. rx-cmd-rsp-queue-depth = <128 32 0 0>;
  465. rx-cmd-rsp-buffer-size = <128 512 0 0>;
  466. clusters {
  467. #address-cells = <1>;
  468. #size-cells = <0>;
  469. cluster@0 {
  470. reg = <0>;
  471. tx-queue = <640>;
  472. tx-channel = "pa-cl0";
  473. };
  474. cluster@1 {
  475. reg = <1>;
  476. tx-queue = <641>;
  477. tx-channel = "pa-cl1";
  478. };
  479. cluster@5 {
  480. reg = <5>;
  481. tx-queue = <645>;
  482. tx-channel = "pa-cl5";
  483. };
  484. };
  485. };
  486. };