summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti/icssm
AgeCommit message (Collapse)Author
32 hoursConvert 'alloc_obj' family to use the new default GFP_KERNEL argumentLinus Torvalds
This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
48 hourstreewide: Replace kmalloc with kmalloc_obj for non-scalar typesKees Cook
This is the result of running the Coccinelle script from scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to avoid scalar types (which need careful case-by-case checking), and instead replace kmalloc-family calls that allocate struct or union object instances: Single allocations: kmalloc(sizeof(TYPE), ...) are replaced with: kmalloc_obj(TYPE, ...) Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...) are replaced with: kmalloc_objs(TYPE, COUNT, ...) Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...) are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...) (where TYPE may also be *VAR) The resulting allocations no longer return "void *", instead returning "TYPE *". Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-04net: ti: icssm-prueth: Add support for ICSSM RSTP switchRoger Quadros
Add support for RSTP switch mode by enhancing the existing ICSSM dual EMAC driver with switchdev support. Enable the PRU-ICSSM to operate in switch mode, with the 2 PRU ports acting as external ports and the host acting as an internal port. Packets received from the PRU ports will be forwarded to the host (store and forward mode) and also to the other PRU port (either using store and forward mode or via cut-through mode). Packets coming from the host will be transmitted either from one or both of the PRU ports (depending on the FDB decision). By default, the dual EMAC firmware will be loaded in the PRU-ICSS subsystem. To configure the PRU-ICSS to operate as a switch, a different firmware must to be loaded. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com> Signed-off-by: Parvathi Pudi <parvathi@couthit.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260130124559.1182780-4-parvathi@couthit.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-02-04net: ti: icssm-prueth: Add switchdev support for icssm_prueth driverRoger Quadros
Add support for offloading the RSTP switch feature to the PRU-ICSS subsystem by adding switchdev support. PRU-ICSS is capable of operating in RSTP switch mode with two external ports and one host port. PRUETH driver and firmware interface support will be added into icssm_prueth in the subsequent commits. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com> Signed-off-by: Parvathi Pudi <parvathi@couthit.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260130124559.1182780-3-parvathi@couthit.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-02-04net: ti: icssm-prueth: Add helper functions to configure and maintain FDBRoger Quadros
Introduce helper functions to configure and maintain Forwarding Database (FDB) tables to aid with the switch mode feature for PRU-ICSS ports. The PRU-ICSS FDB is maintained such that it is always in sync with the Linux bridge driver FDB. The FDB is used by the driver to determine whether to flood a packet, received from the user plane, to both ports or direct it to a specific port using the flags in the FDB table entry. The FDB is implemented in two main components: the Index table and the MAC Address table. Adding, deleting, and maintaining entries are handled by the PRUETH driver. There are two types of entries: Dynamic: created from the received packets and are subject to aging. Static: created by the user and these entries never age out. 8-bit hash value obtained using the source MAC address is used to identify the index to the Index/Hash table. A bucket-based approach is used to collate source MAC addresses with the same hash value. The Index/Hash table holds the bucket index (16-bit value) and the number of entries in the bucket with the same hash value (16-bit value). This table can hold up to 256 entries, with each entry consuming 4 bytes of memory. The bucket index value points to the MAC address table indicating the start of MAC addresses having the same hash values. Each entry in the MAC Address table consists of: 1. 6 bytes of the MAC address, 2. 2-byte aging time, and 3. 1-byte each for port information and flags respectively. When a new entry is added to the FDB, the hash value is calculated using an XOR operation on the 6-byte MAC address. The result is used as an index into the Hash/Index table to check if any entries exist. If no entries are present, the first available empty slot in the MAC Address table is allocated to insert this MAC address. If entries with the same hash value are already present, the new MAC address entry is added to the MAC Address table in such a way that it ensures all entries are grouped together and sorted in ascending MAC address order. This approach helps efficiently manage FDB entries. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com> Signed-off-by: Parvathi Pudi <parvathi@couthit.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260130124559.1182780-2-parvathi@couthit.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-19net: ti: icssm-prueth: unwind cleanly in probe()Dan Carpenter
This error handling triggers a Smatch warning: drivers/net/ethernet/ti/icssm/icssm_prueth.c:1574 icssm_prueth_probe() warn: 'prueth->pru1' is an error pointer or valid The warning is harmless because the pru_rproc_put() function has an IS_ERR_OR_NULL() check built in. However, there is a small bug if syscon_regmap_lookup_by_phandle() fails. In that case we should call of_node_put() on eth0_node and eth1_node. It's a little bit easier to re-write this code to only free things which we know have been allocated successfully. Fixes: 511f6c1ae093 ("net: ti: icssm-prueth: Adds ICSSM Ethernet driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Parvathi Pudi <parvathi@couthit.com> Link: https://patch.msgid.link/aMvVagz8aBRxMvFn@stanley.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-14net: ti: icssm-prueth: Adds IEP support for PRUETH on AM33x, AM43x and AM57x ↵Parvathi Pudi
SOCs Added API hooks for IEP module (legacy 32-bit model) to support timestamping requests from application. Reviewed-by: Mohan Reddy Putluru <pmohan@couthit.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com> Signed-off-by: Parvathi Pudi <parvathi@couthit.com> Link: https://patch.msgid.link/20250912115443.529856-6-parvathi@couthit.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-14net: ti: icssm-prueth: Adds link detection, RX and TX support.Roger Quadros
Changes corresponding to link configuration such as speed and duplexity. IRQ and handler initializations are performed for packet reception.Firmware receives the packet from the wire and stores it into OCMC queue. Next, it notifies the CPU via interrupt. Upon receiving the interrupt CPU will service the IRQ and packet will be processed by pushing the newly allocated SKB to upper layers. When the user application want to transmit a packet, it will invoke sys_send() which will in turn invoke the PRUETH driver, then it will write the packet into OCMC queues. PRU firmware will pick up the packet and transmit it on to the wire. Reviewed-by: Mohan Reddy Putluru <pmohan@couthit.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com> Signed-off-by: Parvathi Pudi <parvathi@couthit.com> Link: https://patch.msgid.link/20250912115443.529856-5-parvathi@couthit.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-14net: ti: icssm-prueth: Adds PRUETH HW and SW configurationRoger Quadros
Updates for MII_RT hardware peripheral configuration such as RX and TX configuration for PRU0 and PRU1, frame sizes, and MUX config. Updates for PRU-ICSS firmware register configuration and DRAM, SRAM and OCMC memory initialization, which will be used in the runtime for packet reception and transmission. DUAL-EMAC memory allocation for software queues and its supporting components such as the buffer descriptors and queue descriptors. These software queues are placed in OCMC memory and are shared with CPU by PRU-ICSS for packet receive and transmit. All declarations and macros are being used from common header file for various protocols. Reviewed-by: Mohan Reddy Putluru <pmohan@couthit.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com> Signed-off-by: Parvathi Pudi <parvathi@couthit.com> Link: https://patch.msgid.link/20250912115443.529856-4-parvathi@couthit.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-14net: ti: icssm-prueth: Adds ICSSM Ethernet driverRoger Quadros
Updates Kernel configuration to enable PRUETH driver and its dependencies along with makefile changes to add the new PRUETH driver. Changes includes init and deinit of ICSSM PRU Ethernet driver including net dev registration and firmware loading for DUAL-MAC mode running on PRU-ICSS2 instance. Changes also includes link handling, PRU booting, default firmware loading and PRU stopping using existing remoteproc driver APIs. Reviewed-by: Mohan Reddy Putluru <pmohan@couthit.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com> Signed-off-by: Parvathi Pudi <parvathi@couthit.com> Link: https://patch.msgid.link/20250912104741.528721-3-parvathi@couthit.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>