From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 011CA39526F; Wed, 4 Feb 2026 23:22:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770247332; cv=none; b=QLIjD9zb2m5ndnE5aG7P3n/hrOweHElVPdG8FWYK8WP1Qv8Yvb7B/ktThEnzjIXhVzQwipfk3qaZ86hgm+zeJpzHKvHbbh0bTH0U99hDkRifeOB+y/oV6BplC3IsLIwuJP8dKL0bwzCg33Et3Z3x2uVOweNst5obA+UpIw6QKrI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770247332; c=relaxed/simple; bh=ES8gXinlTHhZRpU9iV91xxLNxi1do/y+GyihrwEvBGI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=DLf+es1itZ3+rnrgKvTDGkh5lOExOFrHtCdNGdP7ccsw4LPaky9LTRr7dgPit3iMy7fSWimD1GAvrzMhYNeSMUE4VHq/reDsn6PpsDOjf3WWD/Lw29fE8eCp/TufsF4unLxTxZBOQkii89BNzeYE1iWlp9WGITm5Muv68WB6dTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=nx5hGD84; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=Naz589/k; arc=none smtp.client-ip=80.241.56.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="nx5hGD84"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="Naz589/k" Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4f5xFr5FHNz9th0; Thu, 5 Feb 2026 00:22:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1770247328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jUPYl25/I/xaiQSwfhlSBNd7Hf3mIc4vRgkGcNTxP+o=; b=nx5hGD84YpwLQE5ISYb8EhFYHYd55Ava0d/82Uq/1kYQHBAHBHW9Hoc2znL9bqtq2AP/vW nfudTgcJIA0EVWIPzX20A3KVwcOLRd2yXTkmG7ttec1W+RxXsvMF3wTUI8/gDua+meyr+j wdjTDx5O79ZmWv++gAq/KZiltx1TvQXllui60O4XQmluA5Txt5LxVbDmIRZPUhDwMps/i6 emIdJ6LmMbYwoUAd/XnZvNeneD2TP2rboFMKB7irda79mZDBlch+mHEiffkjCawZ5+olVb yRWDFjSkUQuSXN1mVAxhN1c8k6EwXY5NE5FDiSifBtbA8INjlPU2652HxzNRxQ== Authentication-Results: outgoing_mbo_mout; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b="Naz589/k"; spf=pass (outgoing_mbo_mout: domain of lukasz.majewski@mailbox.org designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=lukasz.majewski@mailbox.org From: Lukasz Majewski DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1770247326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jUPYl25/I/xaiQSwfhlSBNd7Hf3mIc4vRgkGcNTxP+o=; b=Naz589/kaMWyIosGEF/Rd/gURaV0AXT1/yfFZnKXKqGf7zkRO9hMewjOZRj7er1cuEh0EF oGJcdXeoKsdTFpcF7UZpkbDClV2HEo9YhVUpI1XtKrmKmzEFoYgtcLIqib2sRZlbMyHckO R0SaFbubQnFXffvxQfenf/Afglxu1s8Hc1bklMg2UP9nIGBqxTlKzKN+quxMnQ4LV8Q4A6 zgkoW+tAXymgPguoWIUBKIAGDvX5CfYQWLoyJbmzdpbJC5vlcuisWN7+dZ9adKZdmD7TVf stVI4TZBTCYVOG3eA1AZOoNYTe5eQUoYHe9EBussQyab/y62RXbYg71B2In0ew== To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo Cc: Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Richard Cochran , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren , Simon Horman , Lukasz Majewski Subject: [net-next v23 0/7] net: mtip: Add support for MTIP imx287 L2 switch driver Date: Thu, 5 Feb 2026 00:21:28 +0100 Message-Id: <20260204232135.1024665-1-lukasz.majewski@mailbox.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-RS-ID: 1a65e745695a95c5e45 X-MBO-RS-META: ackt1q4t6kc7djdtdctky69jssasp49z X-Rspamd-Queue-Id: 4f5xFr5FHNz9th0 This patch series adds support for More Than IP's L2 switch driver embedded in some NXP's SoCs. This one has been tested on imx287, but is also available in the vf610. In the past there has been performed some attempts to upstream this driver: 1. The 4.19-cip based one [1] 2. DSA based one for 5.12 [2] - i.e. the switch itself was treat as a DSA switch with NO tag appended. 3. The extension for FEC driver for 5.12 [3] - the trick here was to fully reuse FEC when the in-HW switching is disabled. When bridge offloading is enabled, the driver uses already configured MAC and PHY to also configure PHY. All three approaches were not accepted as eligible for upstreaming. The driver from this series has following features: 1. It is fully separated from fec_main - i.e. can be used interchangeable with it. To be more specific - one can build them as modules and if required switch between them when e.g. bridge offloading is required. To be more specific: - Use FEC_MAIN: When one needs support for two ETH ports with separate uDMAs used for both and bridging can be realized in SW. - Use MTIPL2SW: When it is enough to support two ports with only uDMA0 attached to switch and bridging shall be offloaded to HW. 2. This driver uses MTIP's L2 switch internal VLAN feature to provide port separation at boot time. Port separation is disabled when bridging is required. 3. Example usage: Configuration: ip link set lan0 up; sleep 1; ip link set lan1 up; sleep 1; ip link add name br0 type bridge; ip link set br0 up; sleep 1; ip link set lan0 master br0; ip link set lan1 master br0; bridge link; ip addr add 192.168.2.17/24 dev br0; ping -c 5 192.168.2.222 Removal: ip link set br0 down; ip link delete br0 type bridge; ip link set dev lan1 down ip link set dev lan0 down 4. Limitations: - Driver enables and disables switch operation with learning and ageing. - Missing is the advanced configuration (e.g. adding entries to FBD). This is on purpose, as up till now we didn't had consensus about how the driver shall be added to Linux. However, on top of this patch set the code with SWITCHDEV support (v6.6. PREEMPT_RT enabled) has been implemented in [4]. 5. Clang build: make LLVM_SUFFIX=-19 LLVM=1 mrproper cp ./arch/arm/configs/mxs_defconfig .config make ARCH=arm LLVM_SUFFIX=-19 LLVM=1 W=1 menuconfig make ARCH=arm LLVM_SUFFIX=-19 LLVM=1 W=1 -j8 LOADADDR=0x40008000 uImage dtbs make LLVM_SUFFIX=-19 LLVM=1 mrproper make LLVM_SUFFIX=-19 LLVM=1 allmodconfig make LLVM_SUFFIX=-19 LLVM=1 W=1 drivers/net/ethernet/freescale/mtipsw/ | tee llvm_build.log make LLVM_SUFFIX=-19 LLVM=1 W=1 -j8 | tee llvm_build.log 6. Kernel compliance checks: make coccicheck MODE=report J=4 M=drivers/net/ethernet/freescale/mtipsw/ make allmodconfig; ~/work/src/smatch/smatch_scripts/kchecker drivers/net/ethernet/freescale/mtipsw/ 7. GCC: make mrproper make allmodconfig make W=1 drivers/net/ethernet/freescale/mtipsw/ [source OE/Yocto SDK build environment] CROSS_COMPILE=arm-poky-linux-gnueabi- ARCH=arm make mrproper cp ./arch/arm/configs/mxs_defconfig .config CROSS_COMPILE=arm-poky-linux-gnueabi- ARCH=arm make menuconfig CROSS_COMPILE=arm-poky-linux-gnueabi- ARCH=arm make -j8 LOADADDR=0x40008000 uImage dtbs 8. DT_SCHEMA checks: source ~/.venv/bin/activate source /opt/poky/3.1.31/environment-setup-armv5e-poky-linux-gnueabi make dt_binding_check DT_SCHEMA_FILES=nxp,imx28-mtip-switch.yaml make CHECK_DTBS=y DT_SCHEMA_FILES=nxp,imx28-mtip-switch.yaml nxp/mxs/imx28-xea.dtb Links: [1] - https://github.com/lmajewski/linux-imx28-l2switch/commits/master [2] - https://github.com/lmajewski/linux-imx28-l2switch/tree/imx28-v5.12-L2-upstream-RFC_v1 [3] - https://source.denx.de/linux/linux-imx28-l2switch/-/tree/imx28-v5.12-L2-upstream-switchdev-RFC_v1?ref_type=heads [4] - https://github.com/lmajewski/linux-imx28-l2switch/commits/vf610-linux-6.6.y-mtipl2sw Lukasz Majewski (7): dt-bindings: net: Add MTIP L2 switch description net: mtip: The L2 switch driver for imx287 net: mtip: Add buffers management functions to the L2 switch driver net: mtip: Add net_device_ops functions to the L2 switch driver net: mtip: Add mtip_switch_{rx|tx} functions to the L2 switch driver net: mtip: Extend the L2 switch driver with management operations net: mtip: Extend the L2 switch driver for imx287 with bridge operations .../bindings/net/nxp,imx28-mtip-switch.yaml | 150 ++ MAINTAINERS | 7 + drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/Makefile | 1 + drivers/net/ethernet/freescale/mtipsw/Kconfig | 13 + .../net/ethernet/freescale/mtipsw/Makefile | 4 + .../net/ethernet/freescale/mtipsw/mtipl2sw.c | 2032 +++++++++++++++++ .../net/ethernet/freescale/mtipsw/mtipl2sw.h | 648 ++++++ .../ethernet/freescale/mtipsw/mtipl2sw_br.c | 138 ++ .../ethernet/freescale/mtipsw/mtipl2sw_mgnt.c | 442 ++++ 10 files changed, 3436 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/nxp,imx28-mtip-switch.yaml create mode 100644 drivers/net/ethernet/freescale/mtipsw/Kconfig create mode 100644 drivers/net/ethernet/freescale/mtipsw/Makefile create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw.c create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw.h create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw_br.c create mode 100644 drivers/net/ethernet/freescale/mtipsw/mtipl2sw_mgnt.c -- 2.39.5