|
| 1 | + Altera Triple-Speed Ethernet MAC driver |
| 2 | + |
| 3 | +Copyright (C) 2008-2014 Altera Corporation |
| 4 | + |
| 5 | +This is the driver for the Altera Triple-Speed Ethernet (TSE) controllers |
| 6 | +using the SGDMA and MSGDMA components. The driver uses the platform bus to |
| 7 | +obtain component resources. The designs used to test this driver were built for |
| 8 | +a Cyclone(R) V SOC FPGA board, a Cyclone(R) V FPGA board, and tested with ARM |
| 9 | +and NIOS processor hosts seperately. The anticipated use cases are simple |
| 10 | +communications between an embedded system and an external peer for status and |
| 11 | +simple configuration of the embedded system. |
| 12 | + |
| 13 | +For more information visit www.altera.com and www.rocketboards.org. Support |
| 14 | +forums for the driver may be found on www.rocketboards.org, and a design used |
| 15 | +to test this driver may be found there as well. Support is also available from |
| 16 | +the maintainer of this driver, found in MAINTAINERS. |
| 17 | + |
| 18 | +The Triple-Speed Ethernet, SGDMA, and MSGDMA components are all soft IP |
| 19 | +components that can be assembled and built into an FPGA using the Altera |
| 20 | +Quartus toolchain. Quartus 13.1 and 14.0 were used to build the design that |
| 21 | +this driver was tested against. |
| 22 | + |
| 23 | +The driver probe function examines the device tree and determines if the |
| 24 | +Triple-Speed Ethernet instance is using an SGDMA or MSGDMA component. The |
| 25 | +probe function then installs the appropriate set of DMA routines to |
| 26 | +initialize, setup transmits, receives, and interrupt handling primitives for |
| 27 | +the respective configurations. |
| 28 | + |
| 29 | +The SGDMA component is to be deprecated in the near future (over the next 1-2 |
| 30 | +years as of this writing in early 2014) in favor of the MSGDMA component. |
| 31 | +SGDMA support is included for existing designs and reference in case a |
| 32 | +developer wishes to support their own soft DMA logic and driver support. Any |
| 33 | +new designs should not use the SGDMA. |
| 34 | + |
| 35 | +The SGDMA supports only a single transmit or receive operation at a time, and |
| 36 | +therefore will not perform as well compared to the MSGDMA soft IP. Please |
| 37 | +visit www.altera.com for known, documented SGDMA errata. |
| 38 | + |
| 39 | +Scatter-gather DMA is not supported by the SGDMA or MSGDMA at this time. |
| 40 | +Scatter-gather DMA will be added to a future maintenance update to this |
| 41 | +driver. |
| 42 | + |
| 43 | +Jumbo frames are not supported at this time. |
| 44 | + |
| 45 | +The driver limits PHY operations to 10/100Mbps, and has not yet been fully |
| 46 | +tested for 1Gbps. This support will be added in a future maintenance update. |
| 47 | + |
| 48 | +1) Kernel Configuration |
| 49 | +The kernel configuration option is ALTERA_TSE: |
| 50 | + Device Drivers ---> Network device support ---> Ethernet driver support ---> |
| 51 | + Altera Triple-Speed Ethernet MAC support (ALTERA_TSE) |
| 52 | + |
| 53 | +2) Driver parameters list: |
| 54 | + debug: message level (0: no output, 16: all); |
| 55 | + dma_rx_num: Number of descriptors in the RX list (default is 64); |
| 56 | + dma_tx_num: Number of descriptors in the TX list (default is 64). |
| 57 | + |
| 58 | +3) Command line options |
| 59 | +Driver parameters can be also passed in command line by using: |
| 60 | + altera_tse=dma_rx_num:128,dma_tx_num:512 |
| 61 | + |
| 62 | +4) Driver information and notes |
| 63 | + |
| 64 | +4.1) Transmit process |
| 65 | +When the driver's transmit routine is called by the kernel, it sets up a |
| 66 | +transmit descriptor by calling the underlying DMA transmit routine (SGDMA or |
| 67 | +MSGDMA), and initites a transmit operation. Once the transmit is complete, an |
| 68 | +interrupt is driven by the transmit DMA logic. The driver handles the transmit |
| 69 | +completion in the context of the interrupt handling chain by recycling |
| 70 | +resource required to send and track the requested transmit operation. |
| 71 | + |
| 72 | +4.2) Receive process |
| 73 | +The driver will post receive buffers to the receive DMA logic during driver |
| 74 | +intialization. Receive buffers may or may not be queued depending upon the |
| 75 | +underlying DMA logic (MSGDMA is able queue receive buffers, SGDMA is not able |
| 76 | +to queue receive buffers to the SGDMA receive logic). When a packet is |
| 77 | +received, the DMA logic generates an interrupt. The driver handles a receive |
| 78 | +interrupt by obtaining the DMA receive logic status, reaping receive |
| 79 | +completions until no more receive completions are available. |
| 80 | + |
| 81 | +4.3) Interrupt Mitigation |
| 82 | +The driver is able to mitigate the number of its DMA interrupts |
| 83 | +using NAPI for receive operations. Interrupt mitigation is not yet supported |
| 84 | +for transmit operations, but will be added in a future maintenance release. |
| 85 | + |
| 86 | +4.4) Ethtool support |
| 87 | +Ethtool is supported. Driver statistics and internal errors can be taken using: |
| 88 | +ethtool -S ethX command. It is possible to dump registers etc. |
| 89 | + |
| 90 | +4.5) PHY Support |
| 91 | +The driver is compatible with PAL to work with PHY and GPHY devices. |
| 92 | + |
| 93 | +4.7) List of source files: |
| 94 | + o Kconfig |
| 95 | + o Makefile |
| 96 | + o altera_tse_main.c: main network device driver |
| 97 | + o altera_tse_ethtool.c: ethtool support |
| 98 | + o altera_tse.h: private driver structure and common definitions |
| 99 | + o altera_msgdma.h: MSGDMA implementation function definitions |
| 100 | + o altera_sgdma.h: SGDMA implementation function definitions |
| 101 | + o altera_msgdma.c: MSGDMA implementation |
| 102 | + o altera_sgdma.c: SGDMA implementation |
| 103 | + o altera_sgdmahw.h: SGDMA register and descriptor definitions |
| 104 | + o altera_msgdmahw.h: MSGDMA register and descriptor definitions |
| 105 | + o altera_utils.c: Driver utility functions |
| 106 | + o altera_utils.h: Driver utility function definitions |
| 107 | + |
| 108 | +5) Debug Information |
| 109 | + |
| 110 | +The driver exports debug information such as internal statistics, |
| 111 | +debug information, MAC and DMA registers etc. |
| 112 | + |
| 113 | +A user may use the ethtool support to get statistics: |
| 114 | +e.g. using: ethtool -S ethX (that shows the statistics counters) |
| 115 | +or sees the MAC registers: e.g. using: ethtool -d ethX |
| 116 | + |
| 117 | +The developer can also use the "debug" module parameter to get |
| 118 | +further debug information. |
0 commit comments