Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp44837imn; Mon, 25 Jul 2022 09:48:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1va5iLgbLoimxK1aGq7IRaLTVjU9TTjDqikgDkwDHJaN6ns4BOEAJD5BCNqhXWi7GaiKYKQ X-Received: by 2002:a17:90b:10c:b0:1f2:8a5f:d1a3 with SMTP id p12-20020a17090b010c00b001f28a5fd1a3mr10892811pjz.48.1658767730171; Mon, 25 Jul 2022 09:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658767730; cv=none; d=google.com; s=arc-20160816; b=P7d4SbfettbXPti34ZBychLcWIw7nadTm8FSrRRqB8JPwIGykr97yFODgeX/uYCgVT ZSI+FliHIHK7ZHgLH4osJbYGd2JN8Z2VBeUPNj/vjN+tdxw9zX2bbIVryCEayeAEHPhk +Ue/HvFQuOZQWfCwqjisDuYvrwFqlCcbzXPDzy3AE3emhv8g+QQxZx85H2PQpy9xax9/ /o9hNKgRBx3Df/N6ZgUHWlRR6+mCkfrPu/TIp7jJJfWOwA7UWBhX7EAFuI/G352n3bfQ H69ZGvjPvUADUKTpP/cmLdzaoy+cQXiutodBfAmAP/qSkr5AGfl2JGiuksEupR7Ngs4/ z/dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ABwaToGBB0Vnovqqht5lcdpqVvne72SmRG2EVDvnde8=; b=v0mLD/Q3wclLXgxDuoxOVlYGUoS1Swf9Hfs411bPjpZUyZlWuDm6j4/zTYEqKNm6PZ Cpz+ltTtO6rta20XrpRh6U1ofL56dpY8M9uj2KGC4SN/f/KU8jnlbRsthuc9JxIQyXC3 Iivv3GSkSt9TAKfeAlHWze8aogbE+s459M2tO3RUXEwaPnUys/M+lyeEpKgJm2ILIYAn vnouSeD3dL3tMYVG3+3GoACljiqJPSiiUSy7w3rANndJCXw8Uj/7WImO9Rd/M0lqUHlG AbiymduoulDXBM0UyyhMuC20QbaChaGz6ZM5PEyG/EzYrHM7yWrQHpIQfZf5IVwWxtiQ EPqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a63930d000000b004198bf3061dsi16420481pge.279.2022.07.25.09.48.34; Mon, 25 Jul 2022 09:48:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=analog.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236550AbiGYQkU (ORCPT + 99 others); Mon, 25 Jul 2022 12:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236338AbiGYQkD (ORCPT ); Mon, 25 Jul 2022 12:40:03 -0400 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC85A1D0D7; Mon, 25 Jul 2022 09:40:02 -0700 (PDT) Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26PEhPLo014892; Mon, 25 Jul 2022 12:39:36 -0400 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3hgdw5wdn4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jul 2022 12:39:36 -0400 Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 26PGdZlL013494 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 Jul 2022 12:39:35 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Mon, 25 Jul 2022 12:39:34 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Mon, 25 Jul 2022 12:39:34 -0400 Received: from localhost.localdomain ([10.48.65.12]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 26PGd7uI014141; Mon, 25 Jul 2022 12:39:09 -0400 From: To: CC: , , , , , , , , , , , , , , , Subject: [net-next v2 0/3] net: ethernet: adi: Add ADIN1110 support Date: Mon, 25 Jul 2022 19:53:09 +0300 Message-ID: <20220725165312.59471-1-alexandru.tachici@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: bvmOsmDdtN_j5jZXNSoCv3VxyPWa_I5P X-Proofpoint-ORIG-GUID: bvmOsmDdtN_j5jZXNSoCv3VxyPWa_I5P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-25_12,2022-07-25_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 priorityscore=1501 spamscore=0 malwarescore=0 suspectscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207250067 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandru Tachici The ADIN1110 is a low power single port 10BASE-T1L MAC-PHY designed for industrial Ethernet applications. It integrates an Ethernet PHY core with a MAC and all the associated analog circuitry, input and output clock buffering. ADIN1110 MAC-PHY encapsulates the ADIN1100 PHY. The PHY registers can be accessed through the MDIO MAC registers. We are registering an MDIO bus with custom read/write in order to let the PHY to be discovered by the PAL. This will let the ADIN1100 Linux driver to probe and take control of the PHY. The ADIN2111 is a low power, low complexity, two-Ethernet ports switch with integrated 10BASE-T1L PHYs and one serial peripheral interface (SPI) port. The device is designed for industrial Ethernet applications using low power constrained nodes and is compliant with the IEEE 802.3cg-2019 Ethernet standard for long reach 10 Mbps single pair Ethernet (SPE). The switch supports various routing configurations between the two Ethernet ports and the SPI host port providing a flexible solution for line, daisy-chain, or ring network topologies. The ADIN2111 supports cable reach of up to 1700 meters with ultra low power consumption of 77 mW. The two PHY cores support the 1.0 V p-p operating mode and the 2.4 V p-p operating mode defined in the IEEE 802.3cg standard. The device integrates the switch, two Ethernet physical layer (PHY) cores with a media access control (MAC) interface and all the associated analog circuitry, and input and output clock buffering. The device also includes internal buffer queues, the SPI and subsystem registers, as well as the control logic to manage the reset and clock control and hardware pin configuration. Access to the PHYs is exposed via an internal MDIO bus. Writes/reads can be performed by reading/writing to the ADIN2111 MDIO registers via SPI. On probe, for each port, a struct net_device is allocated and registered. When both ports are added to the same bridge, the driver will enable offloading of frame forwarding at the hardware level. Driver offers STP support. Normal operation on forwarding state. Allows only frames with the 802.1d DA to be passed to the host when in any of the other states. Supports both VEB and VEPA modes. In VEB mode multicast/broadcast and unknown frames are handled by the ADIN2111, sw bridge will not see them (this is to save SPI bandwidth). In VEPA mode, all forwarding will be handled by the sw bridge, ADIN2111 will not attempt to forward any frames in hardware to the other port. Alexandru Tachici (3): net: phy: adin1100: add PHY IDs of adin1110/adin2111 net: ethernet: adi: Add ADIN1110 support dt-bindings: net: adin1110: Add docs Changelog V1 -> V2: adin1100.c: - added additional PHY IDs that are found in both the ADIN1110 and ADIN2111 ICs adin1110.c: - fixed warnings when built with W=1 - in adin1110_irq(): check status register read return value before moving on - call adin1110_read_frames() with a fixed budget to avoid running forever in the loop - in adin1110_port_bridge_join(): removed if() that checks if same port was added to multiple bridges, core already does that - phy_connect() now called with PHY_INTERFACE_MODE_INTERNAL instead - replaced dev_err() dev_err_ratelimited() in places where could flood log - set spi->mode to SPI_MODE_0 - on PHY_ID check also print expected PHY_ID - removed lock/unlock from adin1110_ndo_get_stats64() - removed rx_errors/rx_dropped/multicast counters updates for now. Those need SPI register reads in order to be accessed. - replaced mutex_unlocks() + return with gotos and a single mutex_unlock() - in adin1110_rx_mode_work(): check port_priv->flags for IFF_BROADCAST in order to enable/disable RX broadcast frames - allow promiscuous mode for ADIN2111. In this way, when added to a bridge, CPU will see the frames with an unknown destination address - in adin1110_rx_mode_work: also check if hw forwarding offloading can be enabled - added STP support - added VEB/VEPA support (ADIN2111). VEB can be used to allow the hardware to offload forwarding thus decreasing the amount of SPI talk, but with disregard to VLAN tags (hardware is oblivious to those). Also in VEB mode host will receive only multicast/broadcast or host MAC address. VEPA allows the bridge to handle all forwarding. ADIN2111 will not attempt to forward in hardware any type of frame. adi,adin1110.yaml: - Removed comas from $id and $schema - Removed spi-controller from ref: - Removed patternProperties for PHYs. No need to specify PHY IDs. Phylib probes required drivers anyway based on the IDs found on the registered MDIO bus. - Updated DT example .../devicetree/bindings/net/adi,adin1110.yaml | 81 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/adi/Kconfig | 28 + drivers/net/ethernet/adi/Makefile | 6 + drivers/net/ethernet/adi/adin1110.c | 1449 +++++++++++++++++ drivers/net/phy/adin1100.c | 7 +- 7 files changed, 1572 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/net/adi,adin1110.yaml create mode 100644 drivers/net/ethernet/adi/Kconfig create mode 100644 drivers/net/ethernet/adi/Makefile create mode 100644 drivers/net/ethernet/adi/adin1110.c -- 2.25.1