- Jul 24, 2020
-
-
Grygorii Strashko authored
Fix build warning: k3-udma-glue.c: In function ‘k3_udma_glue_cfg_rx_flow’: k3-udma-glue.c:662:1: warning: label ‘err_ringrx_free’ defined but not used err_ringrx_free: ^~~~~~~~~~~~~~~ Fixes: 6a42ce8a ("dmaengine: ti: k3-udma: Switch to k3_ringacc_request_rings_pair") Signed-off-by:
Grygorii Strashko <grygorii.strashko@ti.com>
-
Grygorii Strashko authored
commit 172d59ec upstream. The mutex_unlock() is missed on error path of psil_get_ep_config() which causes deadlock. Add missed mutex_unlock(). Fixes: 8c6bb62f ("dmaengine: ti: k3 PSI-L remote endpoint configuration") Signed-off-by:
Grygorii Strashko <grygorii.strashko@ti.com> Acked-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
- Jul 21, 2020
-
-
Peter Ujfalusi authored
Instead of separate of_machine_is_compatible() it is better to use soc_device_match() and soc_device_attribute struct to get the PSI-L map for the booted device. By using soc_device_match() it is easier to add support for new devices. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
We only request ring pairs via K3 DMA driver, switch to use the new k3_ringacc_request_rings_pair() to simplify the code. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by:
Grygorii Strashko <grygorii.strashko@ti.com>
-
Grygorii Strashko authored
In preparation of adding AM64 SoC support separate soc specific initialization and and OF mach data. Signed-off-by:
Grygorii Strashko <grygorii.strashko@ti.com>
-
Grygorii Strashko authored
Add new API k3_ringacc_request_rings_pair() to request pair of rings at once, as in the most case Rings are used with DMA channels which required to request pair of rings - one to feed DMA with descriptors (TX/RX FDQ) and one to receive completions (RX/TX CQ). This will allow to simplify Ringacc API users. Signed-off-by:
Grygorii Strashko <grygorii.strashko@ti.com>
-
Grygorii Strashko authored
Add struct k3_ring *ring->flags to the ring dump. Signed-off-by:
Grygorii Strashko <grygorii.strashko@ti.com>
-
Peter Ujfalusi authored
Move the free, occ, windex and rinfex under a struct. We can use memset to zero them and it will allow a cleaner way to extend the variables for duplex rings. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Grygorii Strashko authored
Convert the K3 NavigatorSS Ring Accelerator bindings documentation to json-schema. Cc: Rob Herring <robh+dt@kernel.org> Signed-off-by:
Grygorii Strashko <grygorii.strashko@ti.com>
-
Peter Ujfalusi authored
The CAP3 register contains information about the number of HCHAN (High Capacity) and UCHAN (Ultra High Capacity) channels in UDMAP. Based on this information the start indexes of the levels can be calculated without a need of a table in the match data. On am654 the CAP3 does not contain information about the number different channels. Set up the tpl information beased on the available documentation. This change will allow to use the same compatible for different SoCs where the only difference is the number of channel types. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
Add defines for the CAP register fields to make the code self explaining. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
Move the uc->tchan/rchan checks to the IO wrappers itself instead of calling the functions with tchan/rchan directly. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
Instead of using higher level wrappers (udma_rchanrt/tchanrt read/write), use the underlying register access functions directly. This will allow changes in the higher level wrappers within the DMAengine driver. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
The register offsets and functions are the same among TCHAN and RCHAN. Use generic, common names for them. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
The ring_get_occ is redundant as the k3_ringacc_ring_pop() is also checking the occ of the ring. With removing the ring_get_occ, the function can be simplified as well. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
The descriptors are allocated via wither dma_pool or dma_alloc_coherent. There is no need for the dma_sync_singel_* calls. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
commit 5a9377cc upstream. Some of the earlier errors should be sent to the error cleanup path to make sure that the uchan struct is reset, the dma_pool (if allocated) is released and memcpy channel pairs are released in a correct way. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
commit b5b0180c upstream. In the unlikely case when the channel is running (RT enabled) during alloc_chan_resources then we should use udma_reset_chan() and not udma_stop() as the later is trying to initiate a teardown on the channel, which is not valid at this point. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com>
-
Peter Ujfalusi authored
commit 7ae6d7bd upstream. In udma_alloc_chan_resources() if the channel is not willing to stop then the function should return with error code. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200512134519.5642-1-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit 6fea8735 upstream. The in_ring_cnt is not used for anything, it can be removed. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200512134611.6015-1-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit 5bbeea34 upstream. The TR mode rx flush descriptor did not had a dma_sync_single_for_device() call to make sure that the DMA see the correct information. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200512134544.5839-1-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit 26cf132d upstream. Create a placeholder directory for each registered DMA device. DMA drivers can use the dmaengine_get_debugfs_root() call to get their debugfs root and can populate with custom files to aim debugging. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200306142839.17910-4-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit db8d9b4c upstream. With the custom dbg_summary_show the driver can show useful information about the used channels. dma0 (285c0000.dma-controller): number of channels: 24 dma1 (31150000.dma-controller): number of channels: 84 dma1chan0 | 2b00000.mcasp:tx (MEM_TO_DEV, tchan16 [0x1010 -> 0xc400], PDMA[ ACC32 BURST ], TR mode) dma1chan1 | 2b00000.mcasp:rx (DEV_TO_MEM, rchan16 [0x4400 -> 0x9010], PDMA[ ACC32 BURST ], TR mode) dma1chan2 | 2ba0000.mcasp:tx (MEM_TO_DEV, tchan17 [0x1011 -> 0xc507], PDMA[ ACC32 BURST ], TR mode) dma1chan3 | 2ba0000.mcasp:rx (DEV_TO_MEM, rchan17 [0x4507 -> 0x9011], PDMA[ ACC32 BURST ], TR mode) dma1chan4 | in-use (MEM_TO_MEM, chan0 pair [0x1000 -> 0x9000], PSI-L Native, TR mode) dma1chan5 | in-use (MEM_TO_MEM, chan1 pair [0x1001 -> 0x9001], PSI-L Native, TR mode) dma1chan6 | in-use (MEM_TO_MEM, chan4 pair [0x1004 -> 0x9004], PSI-L Native, TR mode) dma1chan7 | in-use (MEM_TO_MEM, chan5 pair [0x1005 -> 0x9005], PSI-L Native, TR mode) Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200306142839.17910-3-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit e937cc1d upstream. Via the /sys/kernel/debug/dmaengine/summary users can get information about the DMA devices and the used channels. Example output on am654-evm with audio using two channels and after running dmatest on 4 channels: dma0 (285c0000.dma-controller): number of channels: 96 dma1 (31150000.dma-controller): number of channels: 267 dma1chan0 | 2b00000.mcasp:tx dma1chan1 | 2b00000.mcasp:rx dma1chan2 | in-use dma1chan3 | in-use dma1chan4 | in-use dma1chan5 | in-use For slave channels we can show the device and the channel name a given channel is requested. For non slave devices the only information we know is that the channel is in use. DMA drivers can implement the optional dbg_summary_show callback to provide controller specific information instead of the generic one. It is easy to extend the generic dmaengine_summary_show() to print additional information about the used channels. I have taken the idea from gpiolib and clk subsystems. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200306142839.17910-2-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Peter Ujfalusi authored
commit bad83565 upstream. No need to use goto to jump over the return chan ? chan : ERR_PTR(-EPROBE_DEFER); We can just revert the check and return right there. Do not fail the channel request if the chan->name allocation fails, but print a warning about it. Change the dev_err to dev_warn if sysfs_create_link() fails as it is not fatal. Only attempt to remove the DMA_SLAVE_NAME symlink if it is created - or it was attempted to be created. Signed-off-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20200131093859.3311-2-peter.ujfalusi@ti.com Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Marek Szyprowski authored
commit 474809a2 upstream. Commit 71723a96 ("dmaengine: Create symlinks between DMA channels and slaves") changed the dma_request_chan() function flow in such a way that it always returns EPROBE_DEFER in case of channels that cannot be found. This break the operation of the devices which have optional DMA channels as it puts their drivers in endless deferred probe loop. Fix this by propagating the proper error value. Fixes: 71723a96 ("dmaengine: Create symlinks between DMA channels and slaves") Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20200130070834.17537-1-m.szyprowski@samsung.com [vkoul: fix typo in patch title] Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Geert Uytterhoeven authored
commit 71723a96 upstream. Currently it is not easy to find out which DMA channels are in use, and which slave devices are using which channels. Fix this by creating two symlinks between the DMA channel and the actual slave device when a channel is requested: 1. A "slave" symlink from DMA channel to slave device, 2. A "dma:<name>" symlink slave device to DMA channel. When the channel is released, the symlinks are removed again. The latter requires keeping track of the slave device and the channel name in the dma_chan structure. Note that this is limited to channel request functions for requesting an exclusive slave channel that take a device pointer (dma_request_chan() and dma_request_slave_channel*()). Signed-off-by:
Geert Uytterhoeven <geert+renesas@glider.be> Tested-by:
Niklas Söderlund <niklas.soderlund@ragnatech.se> Link: https://lore.kernel.org/r/20200117153056.31363-1-geert+renesas@glider.be Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
Christophe JAILLET authored
commit 018af9be upstream. All but one error handling paths in the 'k3_udma_glue_cfg_rx_flow()' function 'goto err' and call 'k3_udma_glue_release_rx_flow()'. This not correct because this function has a 'channel->flows_ready--;' at the end, but 'flows_ready' has not been incremented here, when we branch to the error handling path. In order to keep a correct value in 'flows_ready', un-roll 'k3_udma_glue_release_rx_flow()', simplify it, add some labels and branch at the correct places when an error is detected. Doing so, we also NULLify 'flow->udma_rflow' in a path that was lacking it. Fixes: d7024191 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine user") Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by:
Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200318191209.1267-1-christophe.jaillet@wanadoo.fr Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
- Jul 14, 2020
-
-
LCPD Auto Merger authored
TI-Feature: connectivity TI-Branch: connectivity-ti-linux-5.4.y * 'connectivity-ti-linux-5.4.y' of ssh://bitbucket.itg.ti.com/lcpdpublicdom/connectivity : (37 commits) net: ti: prueth_core: hsr/prp: VLAN filter to receive tagged SV frames net: ti: prueth_core: hsr/prp: add Multicast filtering net: ti: prueth_core: hsr/prp: add VLAN filtering net: ti: prueth_core: hsr/prp: update for ethtool stats support net: ti: prueth_core: add helper functions to support lre offload ARM: dts: am335x-icev2: add interrupts for HSR/PRP queue interrupts ARM: dts: am437x: add interrupts for HSR/PRP queue interrupts ARM: dts: am57x: add interrupts for hsr/prp queue interrupts net: ti: prueth_core: hsr/prp: add NSP support net: ti: prueth_core: hsr/prp: add ethtool command to switch Ethenet type net: ti: prueth_core: add HSR/PRP driver dt-bindings: net: ti-prueth: Add interrupt properties for HSR/PRP net: ti: prueth_core: add HSR/PRP firmware specific init functions net: ti: prueth_core: hsr/prp: set mux_sel and Min/Max frame sizes net: ti: prueth_core: move timer utility functions to prueth_core net: ti: prueth_core: move prueth_hostinit() to inside ndo_open() ARM: dts: am437x-idk : remove firmware-name from DTS ARM: dts: am335x-icev2 : remove firmware-name from DTS ARM: dts: k2g-ice : remove firmware-name from DTS ARM: dts: am57xx-idk : remove firmware-name from DTS ... Signed-off-by:
LCPD Auto Merger <lcpd_integration@list.ti.com>
-
- Jul 10, 2020
-
-
Murali Karicheri authored
HSR/PRP networks may use VLAN for management messages such as that for sending and receiving tagged supervision frames. So implement lredev_set_sv_vlan_id() ops of the LRE offloaded device to add VLAN filter entry for receiving these tagged frames. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Similar to Dual EMAC firmware, HSR/PRP (LRE) firmware also supports a hashed Multicast filter table of 256 entries. This patch extends the MC filtering support to HSR/PRP Ethernet types. This is a shared table for LRE. So protect access using a spinlock. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This patch add VLAN filtering support for LRE offload. VLAN table has 512 entries with 8 VIDs supported per entry. It is a shared table. So use a spinlock to protect access. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This patch adds Link Redundancy Entity (LRE) stats through ethtool command. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
Firmware requires node table entries to be inserted by driver to save PRU cycles for packet processing. Node table provides a view of remote nodes in the network. The nodes send supervision frames periodically with its own mac address and the same is processed by firmware. First firmware lookup the source MAC address. If not found, it indicates a flag in the descriptor which driver uses to insert the MAC address in the node table. The rx packet processing code kicks a worker thread to insert the mac address. This patch adds the required function to do the insert function and also clear the table on demand. Firmware also requires driver to run a timer for 10 msec to update check flags in dram for firmware to do periodic table maintenance functions for LRE offload. So change basic timer period to 10 msec and use a counter to track the NSP timer which needs to be done every 100 msec. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This adds interrupts property for HSR/PRP priority queue interrupts for the supported platforms. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This adds interrupts property for HSR/PRP priority queue interrupts for the supported platforms. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
This adds interrupts property for hsr/prp priority queue interrupts for the supported platforms. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
For HSR/PRP the timer has to be run at 10 msec due to requirement to support offload function in firmware. So run the basic timer at 10 msec when Ethernet type is HSR/PRP and use a counter to count 100 msec for NSP timer. Keep the basic timer at 100 msec when in Dual EMAC mode to reduce CPU cycle usage. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
PRUETH driver now supports Dual EMAC/HSR/PRP/SWITCH Ethernet types. The user requires to switch between these Ethernet types at run time without rebooting the device. This patch introduces Ethtool -K option to switch the Ethernet types between Dual EMAC/HSR/PRP Ethernet types. User first bring down the interface and then set the HSR or PRP offload flag in the Ethernet device using ethtool -K option. Then bring up the Ethernet interfaces and setup the HSR/PRP interface using ip link command. For example to Switch from Dual EMAC to HSR, user do ifconfig eth2 down ifconfig eth3 down ifconfig eth2 hw ether <MAC Addr> ifconfig eth3 hw ether <MAC Addr> ethtool -K eth2 hsr-rx-offload on ethtool -K eth3 hsr-rx-offload on Now ready to create hsr interface as ip link add name hsr0 type hsr slave1 eth2 slave2 eth3 supervision 45 version 1 Similarly to switch from Dual EMAC to prp user do similar steps ifconfig eth2 down ifconfig eth3 down ifconfig eth2 hw ether <MAC Addr> ifconfig eth3 hw ether <MAC Addr> ethtool -K eth2 prp-rx-offload on ethtool -K eth3 prp-rx-offload on ip link add name prp0 type hsr slave1 eth2 slave2 eth3 supervision 45 proto 1 To switch back to Dual EMAC, user clear the respective flags through ethtool command and bring up the interface. Switching between HSR and PRP is done in a similar way. First needs to reset the existing flag and then set the new flag before creating the hsr/prp interface. User is not allowed to switch between Switch and HSR/PRP. To switch, user first needs to change to Dual EMAC eth type and then do the switching of ethtype. Driver continues to support the existing method for switching between Dual EMAC and Switch eth types. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-
Murali Karicheri authored
HSR/PRP is a industrial Ethernet protocol defined by IEC 62439 standard. Both use 6 bytes of protocol bytes to implement redundancy. This consists of 2 bytes of sequence number, 1 byte of Ethernet type identifying the protocol and LSDU length and pathid/network id bits. Link Redundancy Entity (LRE) implements 1) duplication of Ethernet frames at Egress and 2) discard of duplicates at the ingress and 3) processing of Supervision frames to build the Node Table information. Node table contains the health status of remote nodes in the network. HSR/PRP driver offload part of LRE function. In the current version of the firmware 2 & 3 are offloaded to PRU firmware. 1) is still performed by upper HSR/PRP driver under net/hsr. This patch initialize the firmware based on the Ethernet type. HSR/PRP firmware uses same memory map as Switch firmware. So all places in the driver that initializes the basic Switch firmware is re-used for HSR/PRP as well using the !PRUETH_IS_EMAC() macro. Any HSR/PRP specific function is initialized under PRUETH_IS_LRE() macro. This update support both v1.0 and v2.1 of the ICSS firmware by using fw offsets that are assigned at probe based on platform. A list of firmware names are also picked at probe and then based on ethtype appropriate firmware is picked to load on the PRUs. For Packet handling, NAPI is used at at Ingress. There are two pair of Queues at the Ingress for each port. Low priority and High priority. A NAPI instance is added for each of the priority queue. An interrupt is raised by firmware when packets are en-queued to one of the priority queue. red_emac_rx_packets() ensures that packets are scanned from both queues at a specific priority and sends them to network stack based on timestamp associated with the packet. At the egress, packets are en-queued based on pcp bits. There are 2 queues per port and other queues are for port to port traffic. Signed-off-by:
Murali Karicheri <m-karicheri2@ti.com>
-