Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1831281rda; Tue, 24 Oct 2023 04:57:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhcaXbcbxz6Ji6yJmO8/X6dxNeq0iCIsIdfd6KOqIavccBoS+rlSYLe0rlEhKNZpZKZ6GK X-Received: by 2002:a17:902:dac9:b0:1ca:9415:a50d with SMTP id q9-20020a170902dac900b001ca9415a50dmr11447202plx.2.1698148662935; Tue, 24 Oct 2023 04:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698148662; cv=none; d=google.com; s=arc-20160816; b=DQaO+GWBWhx/DfBkqjG+t8K5fKDows8HoDpF1FF9n5evlUQYAcAlEg7TA53RqF6MHu 4rNh6TPp8P8PmMcZR94B/2Wwp+t/ytrU0pMPqvRDVigt+qBPNauVDpK4LOy3rf+zP55X vEIxI0GTZwEubYN+kYnYenQ4oqJRZUN2FHkANAhjwgsw+93YpfqyESuubnZYQUtdmbES UYJpHrDieVFU9z8DTLKPGBhSIZbeY0R4KKk5iJKQ45ZHtx0DVDo7IzW2b5unLohKyfIS Z/0dWt01WyEPBiH1LlznDEjdSYo7LKDBxUP270oPagKjOqldlEMvPQP+aFUSRjR6+9EK nChQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:content-language:references:cc:to:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=tFZDtST9F5ScQU4SqfzEOMm6rr2egoG0MZcpsMGP7qA=; fh=KxOL2PSmXcih4luxdRyM4lQQK1Ka1j9V19DfeOBy1SU=; b=RZWITRaD77oD4C+XgG9+6Z8Pa0dhwABR9XjutekEcCRAgYo0ocHYDcr+x2ttpsWfPs KqgWvan6ShI3oEmS0djGmbMpalD9+iE/KTS730yud40Lc/uGSekkyhU4zs5VnDZBZBIu iUt+0meu/503si3NST1Q8Z9x9C5Wp6OqpIRFNsKFVcSeMJrdhqzWyLrJ126OgVAHl/H9 m4jo9KLu0sVAcyOIPwWaSGDU3y2m4w4+ICRnEGSR86LFaqEKyR4wUQ5Elv13bLGoLshu 1N6JVLWMjuPID5MViRWCQPTDWxLvn/S5LEO+ZpJaVeFmySY7WBXNrEdHQAQOoldcgOEO 5E8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U38GQfbR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j1-20020a170902690100b001c9c3f327e1si8289028plk.191.2023.10.24.04.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 04:57:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U38GQfbR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 30007803891A; Tue, 24 Oct 2023 04:57:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232676AbjJXL5b (ORCPT + 99 others); Tue, 24 Oct 2023 07:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbjJXL5a (ORCPT ); Tue, 24 Oct 2023 07:57:30 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DADEBD for ; Tue, 24 Oct 2023 04:57:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31B9CC433C7; Tue, 24 Oct 2023 11:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698148647; bh=P/62AzhAT4KUu+utmsfzDa4VRGeCzMsZgfgeMsb7fFQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=U38GQfbR3I5gJybWpH3LqCbdHqpdPDApaYa1y7mhdHfH2MA7aXAYD+2IlpfaC18ma ay52CdaP3lbY7qoerCPgb9NzBkZaYvVu6JOy6tttoVEA/9mwRg6ZlI0aiqvEeInWsf kOd9ellhuLwmoQl6mfxAOuMpu+8dt9wLEIdk/FScqAlOGcsHo8PqLqskRi6YiRSxlr NaPcuKp9WnIagQ1fYKvNijy78f+vYKm/NxP7lIuAqlZd/dVtwz/vPsm47pdz6uMMdW SXvqgXOgbwqZFCX4/1BYlXn7j2iOMuHpR9lEIalQ/nNPG4+BlxKqWdsLHMuJxaJ+IJ XV8pef6DwsLOQ== Message-ID: <59767fb8-8b9a-472a-884c-009cb00ed0b9@kernel.org> Date: Tue, 24 Oct 2023 13:57:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 8/9] microchip: lan865x: add driver support for Microchip's LAN865X MACPHY To: Parthiban Veerasooran , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, corbet@lwn.net, steen.hegelund@microchip.com, rdunlap@infradead.org, horms@kernel.org, casper.casan@gmail.com, andrew@lunn.ch Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, horatiu.vultur@microchip.com, Woojung.Huh@microchip.com, Nicolas.Ferre@microchip.com, UNGLinuxDriver@microchip.com, Thorsten.Kummermehr@microchip.com References: <20231023154649.45931-1-Parthiban.Veerasooran@microchip.com> <20231023154649.45931-9-Parthiban.Veerasooran@microchip.com> Content-Language: en-US From: Krzysztof Kozlowski Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDA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can8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <20231023154649.45931-9-Parthiban.Veerasooran@microchip.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 24 Oct 2023 04:57:40 -0700 (PDT) On 23/10/2023 17:46, Parthiban Veerasooran wrote: > The LAN8650/1 is designed to conform to the OPEN Alliance 10BASE‑T1x > MAC‑PHY Serial Interface specification, Version 1.1. The IEEE Clause 4 > MAC integration provides the low pin count standard SPI interface to any > microcontroller therefore providing Ethernet functionality without > requiring MAC integration within the microcontroller. The LAN8650/1 > operates as an SPI client supporting SCLK clock rates up to a maximum of > 25 MHz. This SPI interface supports the transfer of both data (Ethernet > frames) and control (register access). > > By default, the chunk data payload is 64 bytes in size. A smaller payload > data size of 32 bytes is also supported and may be configured in the > Chunk Payload Size (CPS) field of the Configuration 0 (OA_CONFIG0) > register. Changing the chunk payload size requires the LAN8650/1 be reset > and shall not be done during normal operation. > > The Ethernet Media Access Controller (MAC) module implements a 10 Mbps > half duplex Ethernet MAC, compatible with the IEEE 802.3 standard. > 10BASE-T1S physical layer transceiver integrated into the LAN8650/1. The > PHY and MAC are connected via an internal Media Independent Interface > (MII). > > Signed-off-by: Parthiban Veerasooran > --- > MAINTAINERS | 6 + > drivers/net/ethernet/microchip/Kconfig | 11 + > drivers/net/ethernet/microchip/Makefile | 2 + > drivers/net/ethernet/microchip/lan865x.c | 415 +++++++++++++++++++++++ > 4 files changed, 434 insertions(+) > create mode 100644 drivers/net/ethernet/microchip/lan865x.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 9580be91f5e9..1b1bd3218a2d 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -14001,6 +14001,12 @@ L: netdev@vger.kernel.org > S: Maintained > F: drivers/net/ethernet/microchip/lan743x_* > > +MICROCHIP LAN8650/1 10BASE-T1S MACPHY ETHERNET DRIVER > +M: Parthiban Veerasooran > +L: netdev@vger.kernel.org > +S: Maintained > +F: drivers/net/ethernet/microchip/lan865x.c > + > MICROCHIP LAN87xx/LAN937x T1 PHY DRIVER > M: Arun Ramadoss > R: UNGLinuxDriver@microchip.com > diff --git a/drivers/net/ethernet/microchip/Kconfig b/drivers/net/ethernet/microchip/Kconfig > index 329e374b9539..596caf59dea6 100644 > --- a/drivers/net/ethernet/microchip/Kconfig > +++ b/drivers/net/ethernet/microchip/Kconfig > @@ -59,4 +59,15 @@ source "drivers/net/ethernet/microchip/lan966x/Kconfig" > source "drivers/net/ethernet/microchip/sparx5/Kconfig" > source "drivers/net/ethernet/microchip/vcap/Kconfig" > > +config LAN865X > + tristate "LAN865x support" > + depends on SPI > + depends on OA_TC6 > + help > + Support for the Microchip LAN8650/1 Rev.B0 MACPHY Ethernet chip. It > + uses OPEN Alliance 10BASE-T1x Serial Interface specification. > + > + To compile this driver as a module, choose M here. The module will be > + called lan865x. That's odd indentation. Kconfig help goes with tab and two spaces. > + > endif # NET_VENDOR_MICROCHIP > diff --git a/drivers/net/ethernet/microchip/Makefile b/drivers/net/ethernet/microchip/Makefile > index bbd349264e6f..1fa4e15a067d 100644 > --- a/drivers/net/ethernet/microchip/Makefile > +++ b/drivers/net/ethernet/microchip/Makefile > @@ -12,3 +12,5 @@ lan743x-objs := lan743x_main.o lan743x_ethtool.o lan743x_ptp.o > obj-$(CONFIG_LAN966X_SWITCH) += lan966x/ > obj-$(CONFIG_SPARX5_SWITCH) += sparx5/ > obj-$(CONFIG_VCAP) += vcap/ ... > +static void lan865x_remove(struct spi_device *spi) > +{ > + struct lan865x_priv *priv = spi_get_drvdata(spi); > + > + oa_tc6_exit(priv->tc6); > + unregister_netdev(priv->netdev); > + free_netdev(priv->netdev); > +} > + > +#ifdef CONFIG_OF Drop ifdef > +static const struct of_device_id lan865x_dt_ids[] = { > + { .compatible = "microchip,lan865x" }, > + { /* Sentinel */ } > +}; > +MODULE_DEVICE_TABLE(of, lan865x_dt_ids); > +#endif > + > +#ifdef CONFIG_ACPI > +static const struct acpi_device_id lan865x_acpi_ids[] = { > + { .id = "LAN865X", > + }, > + {}, > +}; > +MODULE_DEVICE_TABLE(acpi, lan865x_acpi_ids); > +#endif > + > +static struct spi_driver lan865x_driver = { > + .driver = { > + .name = DRV_NAME, > +#ifdef CONFIG_OF Drop ifdef > + .of_match_table = lan865x_dt_ids, > +#endif > +#ifdef CONFIG_ACPI Why do you need this ifdef? > + .acpi_match_table = ACPI_PTR(lan865x_acpi_ids), > +#endif > + }, > + .probe = lan865x_probe, > + .remove = lan865x_remove, > +}; > +module_spi_driver(lan865x_driver); > + > +MODULE_DESCRIPTION(DRV_NAME " 10Base-T1S MACPHY Ethernet Driver"); > +MODULE_AUTHOR("Parthiban Veerasooran "); > +MODULE_LICENSE("GPL"); > +MODULE_ALIAS("spi:" DRV_NAME); You should not need MODULE_ALIAS() in normal cases. If you need it, usually it means your device ID table is wrong. Best regards, Krzysztof