From patchwork Fri Dec 4 12:34:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11951651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35549C4361B for ; Fri, 4 Dec 2020 12:34:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9C8922A99 for ; Fri, 4 Dec 2020 12:34:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9C8922A99 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ui28AK0dW+HMcFL8TX8H7z9Rct5VLYbfjiuDK9x/ulY=; b=GzRbFXE+wsyvOJjCFOAZ3eFiL kaPw2zotEXU2xK6Qw6Cz6bDta7pChCieg9lWN4cEtnYdDSAX2ZarHWUbQmWiLL4EgUPn4epYqLfM9 Nz/nQ7i3fmiWtC8aNWXYcOv3VifaIPUr33DiVz92tKzi8mfEIh1vMlLifGSC8RGJa6ufvdrAUHGw4 IVF3R/deXzAYujFQ0vtMV7qvHCtkrkq4YF1lQtilMOm18GV4viERFQOFt1yPtGB37wIHN4jPRZNE8 e617rjmwZhvUD8XJ87ZCNf9r4xA8WXbL3ekjNrHP0QTXkVFYBDmUtiMXmv3eilxo5jDkHnTfkYfmf 8jGoiiXzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIR-0000MJ-Ch; Fri, 04 Dec 2020 12:34:47 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIP-0000Ll-IQ for linux-riscv@lists.infradead.org; Fri, 04 Dec 2020 12:34:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607085285; x=1638621285; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=UcUlJBmSMSOmv9XOQ1o8b3C5jJGReV2lY9LYt+kzBJI=; b=Co9aQIa4/eiPunUQxy3wMOLkj0G8+1AZeEmEiBdKSuqyd+zdVFKAmDXS K/sc7Wk/y9mwvvFnZgJ26aCk9yP3E1tFBHPO7xh09wETs2q4cTmEea55m ab3wiXdOauCf7V6e6It4GjHwuDkIsaUnQKzjZnM6AEmB5M4iVSosoGnBl OK3P6FHXpUNGBkxVHkctMz/CNVrRZC24hPc23hWmRU7wJJxmemJ0jptAO xg13GKg4HoRakZuQEcuhmgDwHWY9AwK8i//ZmjdiUDNvKR8DxmRsdoKMM h/l11vamZW1WUY89MG558OzXTrAyYsaNR+MuohiLx2mw2ca5x+u+PyDN1 Q==; IronPort-SDR: H0uz4UleAmEnesn+ycDTYguScnHPR4FSqtfBx7lTGbHkWFrIW+HXGanO2fthaLOyWSoyz16RIH mTOL5BwV2zlx9NP6t9RtzsuhfDdahIlC2aH5ubx7Z7NGvQ/EsXwN0niPVfnWdJ9QySYRfKENCy 9TFSKZRLD/4LDIrBg9Zqk/kHlhT07W9KRqNXGf1TcEhHWAw/+xfupGJJ4MbrsfCpP2DUWXBw8O nbcK6+/4CixT8Xe6gYZRRJ8m3F4C57HUNK5gAYzLByBLoLJzyv0BdZgp2qxjzhTujymrtCfd6G iLk= X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="101477134" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2020 05:34:42 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 4 Dec 2020 05:34:42 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 4 Dec 2020 05:34:35 -0700 From: Claudiu Beznea To: , , , , , , Subject: [PATCH 1/7] net: macb: add userio bits as platform configuration Date: Fri, 4 Dec 2020 14:34:15 +0200 Message-ID: <1607085261-25255-2-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> References: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_073445_755072_89A93350 X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yash.shah@sifive.com, linux-riscv@lists.infradead.org, Claudiu Beznea Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This is necessary for SAMA7G5 as it uses different values for PHY interface and also introduces hdfctlen bit. Signed-off-by: Claudiu Beznea Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cadence/macb.h | 10 ++++++++++ drivers/net/ethernet/cadence/macb_main.c | 28 ++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 1f5da4e4f4b2..7daabffe4318 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1147,6 +1147,14 @@ struct macb_pm_data { u32 usrio; }; +struct macb_usrio_config { + u32 mii; + u32 rmii; + u32 rgmii; + u32 refclk; + u32 hdfctlen; +}; + struct macb_config { u32 caps; unsigned int dma_burst_length; @@ -1155,6 +1163,7 @@ struct macb_config { struct clk **rx_clk, struct clk **tsu_clk); int (*init)(struct platform_device *pdev); int jumbo_max_len; + const struct macb_usrio_config *usrio; }; struct tsu_incr { @@ -1288,6 +1297,7 @@ struct macb { u32 rx_intr_mask; struct macb_pm_data pm_data; + const struct macb_usrio_config *usrio; }; #ifdef CONFIG_MACB_USE_HWSTAMP diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 7b1d195787dc..6d46153a7c4b 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3913,15 +3913,15 @@ static int macb_init(struct platform_device *pdev) if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) { val = 0; if (phy_interface_mode_is_rgmii(bp->phy_interface)) - val = GEM_BIT(RGMII); + val = bp->usrio->rgmii; else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII && (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) - val = MACB_BIT(RMII); + val = bp->usrio->rmii; else if (!(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) - val = MACB_BIT(MII); + val = bp->usrio->mii; if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN) - val |= MACB_BIT(CLKEN); + val |= bp->usrio->refclk; macb_or_gem_writel(bp, USRIO, val); } @@ -4439,6 +4439,13 @@ static int fu540_c000_init(struct platform_device *pdev) return macb_init(pdev); } +static const struct macb_usrio_config macb_default_usrio = { + .mii = MACB_BIT(MII), + .rmii = MACB_BIT(RMII), + .rgmii = GEM_BIT(RGMII), + .refclk = MACB_BIT(CLKEN), +}; + static const struct macb_config fu540_c000_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP, @@ -4446,12 +4453,14 @@ static const struct macb_config fu540_c000_config = { .clk_init = fu540_c000_clk_init, .init = fu540_c000_init, .jumbo_max_len = 10240, + .usrio = &macb_default_usrio, }; static const struct macb_config at91sam9260_config = { .caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, .clk_init = macb_clk_init, .init = macb_init, + .usrio = &macb_default_usrio, }; static const struct macb_config sama5d3macb_config = { @@ -4459,6 +4468,7 @@ static const struct macb_config sama5d3macb_config = { | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, .clk_init = macb_clk_init, .init = macb_init, + .usrio = &macb_default_usrio, }; static const struct macb_config pc302gem_config = { @@ -4466,6 +4476,7 @@ static const struct macb_config pc302gem_config = { .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, + .usrio = &macb_default_usrio, }; static const struct macb_config sama5d2_config = { @@ -4473,6 +4484,7 @@ static const struct macb_config sama5d2_config = { .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, + .usrio = &macb_default_usrio, }; static const struct macb_config sama5d3_config = { @@ -4482,6 +4494,7 @@ static const struct macb_config sama5d3_config = { .clk_init = macb_clk_init, .init = macb_init, .jumbo_max_len = 10240, + .usrio = &macb_default_usrio, }; static const struct macb_config sama5d4_config = { @@ -4489,18 +4502,21 @@ static const struct macb_config sama5d4_config = { .dma_burst_length = 4, .clk_init = macb_clk_init, .init = macb_init, + .usrio = &macb_default_usrio, }; static const struct macb_config emac_config = { .caps = MACB_CAPS_NEEDS_RSTONUBR | MACB_CAPS_MACB_IS_EMAC, .clk_init = at91ether_clk_init, .init = at91ether_init, + .usrio = &macb_default_usrio, }; static const struct macb_config np4_config = { .caps = MACB_CAPS_USRIO_DISABLED, .clk_init = macb_clk_init, .init = macb_init, + .usrio = &macb_default_usrio, }; static const struct macb_config zynqmp_config = { @@ -4511,6 +4527,7 @@ static const struct macb_config zynqmp_config = { .clk_init = macb_clk_init, .init = macb_init, .jumbo_max_len = 10240, + .usrio = &macb_default_usrio, }; static const struct macb_config zynq_config = { @@ -4519,6 +4536,7 @@ static const struct macb_config zynq_config = { .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, + .usrio = &macb_default_usrio, }; static const struct of_device_id macb_dt_ids[] = { @@ -4640,6 +4658,8 @@ static int macb_probe(struct platform_device *pdev) bp->wol |= MACB_WOL_HAS_MAGIC_PACKET; device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET); + bp->usrio = macb_config->usrio; + spin_lock_init(&bp->lock); /* setup capabilities */ From patchwork Fri Dec 4 12:34:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11951653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A89EDC4361A for ; Fri, 4 Dec 2020 12:34:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D02722AAA for ; Fri, 4 Dec 2020 12:34:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D02722AAA Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xHK0EFRi6MGduF+XHBJ2cq4OeKTuadd2OnOa2Ngl0+I=; b=skM7bSTYgF06ut+Jn6YAui5RS BbRdCd29axyJZ4YkOpbkcLcCYqcYym61TV8RDiID1vyD4DPYkah+QGzCN7uPnice0C3HDByO+cfqD cySa/Gs60UjC8QnLYERedrXXcWOcPFJkc9rDfrhw0EvSG6OdK5ECoNNR03tdm1lhpkNGOvQLTBWYx kdgDJaA0Uv4KQSoPAAiNare4ZYk6s46+XipRKPyr3aIBUF5RA31hVCrB5d2QUwRDXtRk8n/AQocoX C9nanZMIRx3xt1HT4C/YrChe/K5/1zCU1ai1GdBrZOq1BR7zD/SQk9i0KWCnZ/LpqqrDzMqdbHnSk IBYCOKvIQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIU-0000NC-RO; Fri, 04 Dec 2020 12:34:50 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIS-0000Ll-Px for linux-riscv@lists.infradead.org; Fri, 04 Dec 2020 12:34:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607085288; x=1638621288; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=uYCBqJLZnpSG4vW8rBFgGJq3+ZAfuyYXev+YIiqcc1g=; b=FQVcD8UjK/DgQkqnB9jsNKcaBboG02yKRse7WvtBLUBQ535sfFyMnz/x qKfODoV8I0H6ZQUlSwhZkz3bTgpgdqQyLD2ORFW1nt+an9qSHyRg5daiv z45KtfXLkq0OgaL93CMp5Cd8FltglKUkD71nzAztBpta82iBP2NIlXGVS 8bM06uNkFnOM2+mwZB9vgMft2iAjADijcFxDVwndzwtbDDU6fRf+16pLx 1NImmpNe7Dl1822DPlEJBIlNU01P3MBCD47Coltt6MHMSQVN4D+599/Wv 7sfuBh1munHPsUJfplTH2/mfuPrY6dg2OIb7gGr7O9DytfdcX5JzupP3K g==; IronPort-SDR: KGYfLM3VecLAB0mBzpDKNZgIccTIBMR3ibZtbRUSxH/oVkyeyhLfsk8FbxS/dT0WFcwuIMerSc cQMxaIG+s6qqUVenOz4SeRC8nfvaRjAJaU4SFJrjnP92fH+P2dd7SOz6JgRQByDJx0qMIkeHyR qidAtXKlr6rptS30tFLp8CSTV6ypsNfDB0xlzb2rVm50AYSAc/zMJyeCOgVdN9Mv4aQobkRgc0 QH9ZMcq0+hKlb70fTf5gXi11djDas0X2Ro5T+UDaavIoodUIGfztp1oaFVfue8OKIQ9NSKHFzD /a0= X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="101477159" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2020 05:34:48 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 4 Dec 2020 05:34:47 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 4 Dec 2020 05:34:42 -0700 From: Claudiu Beznea To: , , , , , , Subject: [PATCH 2/7] net: macb: add capability to not set the clock rate Date: Fri, 4 Dec 2020 14:34:16 +0200 Message-ID: <1607085261-25255-3-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> References: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_073449_047873_8826D110 X-CRM114-Status: GOOD ( 15.00 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yash.shah@sifive.com, linux-riscv@lists.infradead.org, Claudiu Beznea Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org SAMA7G5's ethernet IPs TX clock could be provided by its generic clock or by the external clock provided by the PHY. The internal IP logic divides properly this clock depending on the link speed. The patch adds a new capability so that macb_set_tx_clock() to not be called for IPs having this capability (the clock rate, in case of generic clock, is set at the boot time via device tree and the driver only enables it). Signed-off-by: Claudiu Beznea Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cadence/macb.h | 1 + drivers/net/ethernet/cadence/macb_main.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 7daabffe4318..769694c7f86c 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -699,6 +699,7 @@ #define MACB_CAPS_GEM_HAS_PTP 0x00000040 #define MACB_CAPS_BD_RD_PREFETCH 0x00000080 #define MACB_CAPS_NEEDS_RSTONUBR 0x00000100 +#define MACB_CAPS_CLK_HW_CHG 0x04000000 #define MACB_CAPS_MACB_IS_EMAC 0x08000000 #define MACB_CAPS_FIFO_MODE 0x10000000 #define MACB_CAPS_GIGABIT_MODE_AVAILABLE 0x20000000 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 6d46153a7c4b..b23e986ac6dc 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -460,15 +460,14 @@ static void macb_init_buffers(struct macb *bp) /** * macb_set_tx_clk() - Set a clock to a new frequency - * @clk: Pointer to the clock to change + * @bp: pointer to struct macb * @speed: New frequency in Hz - * @dev: Pointer to the struct net_device */ -static void macb_set_tx_clk(struct clk *clk, int speed, struct net_device *dev) +static void macb_set_tx_clk(struct macb *bp, int speed) { long ferr, rate, rate_rounded; - if (!clk) + if (!bp->tx_clk || !(bp->caps & MACB_CAPS_CLK_HW_CHG)) return; switch (speed) { @@ -485,7 +484,7 @@ static void macb_set_tx_clk(struct clk *clk, int speed, struct net_device *dev) return; } - rate_rounded = clk_round_rate(clk, rate); + rate_rounded = clk_round_rate(bp->tx_clk, rate); if (rate_rounded < 0) return; @@ -495,11 +494,12 @@ static void macb_set_tx_clk(struct clk *clk, int speed, struct net_device *dev) ferr = abs(rate_rounded - rate); ferr = DIV_ROUND_UP(ferr, rate / 100000); if (ferr > 5) - netdev_warn(dev, "unable to generate target frequency: %ld Hz\n", + netdev_warn(bp->dev, + "unable to generate target frequency: %ld Hz\n", rate); - if (clk_set_rate(clk, rate_rounded)) - netdev_err(dev, "adjusting tx_clk failed.\n"); + if (clk_set_rate(bp->tx_clk, rate_rounded)) + netdev_err(bp->dev, "adjusting tx_clk failed.\n"); } static void macb_validate(struct phylink_config *config, @@ -751,7 +751,7 @@ static void macb_mac_link_up(struct phylink_config *config, if (rx_pause) ctrl |= MACB_BIT(PAE); - macb_set_tx_clk(bp->tx_clk, speed, ndev); + macb_set_tx_clk(bp, speed); /* Initialize rings & buffers as clearing MACB_BIT(TE) in link down * cleared the pipeline and control registers. From patchwork Fri Dec 4 12:34:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11951655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 467E0C433FE for ; Fri, 4 Dec 2020 12:35:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3B9A22A99 for ; Fri, 4 Dec 2020 12:35:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3B9A22A99 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wu9p9F5OKTEMCayMM3vvWU5ItKEbqAt935EMEObkOOU=; b=28dgU/1mZ0v3vqzH5vI8LTgsz cSPsTL9Gzt2A9PN4mnQiYXETuwoCiG/PqDXISBbPE0ibfZfACrygiaxF3YSApD/vas4ySZnIueikc tZzzR/Dpj2NNMAGVJDVSH058TZjuyV5578R+ZC+EAQTfKkW3LJdETjqttu44thrIGGQVFEkBTy9Q7 r2WZWPDWLYxZig7KOQPsqkGlINVkVVtWF3i5RDKEw5BoOIeh3ouOKVXPxZ9mW8Fld8KTSMLv05Szz /4dbfaXGOpY71nQdObL43sa/bdoxO6UpgIvwTi/pWlF7XJ3qbSiAWloCpFGn37wsNvL5Aci2dUjBD UukU4N7mQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIb-0000Ot-DZ; Fri, 04 Dec 2020 12:34:57 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIY-0000O6-Ad for linux-riscv@lists.infradead.org; Fri, 04 Dec 2020 12:34:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607085294; x=1638621294; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ZYRrAJmxsOLG1C4vggyXLYq/gsMVkhtO66yVO0ElffY=; b=XZvW75Ly584nKD2iQqishkrvWyJNw0P4l1S2/yYCHCBuDMHaNUePzBV+ sUH4qa4S0s4oG96zfxoHSH1sa9aK96IEzhd4yN7VeKj6fvS+xcZMEYFHS BvmdULqOuiEN9g3WVbvRdWandIi+Vd/Au70APDkjn5hiRRpKAGbj+NYtk 6Fxdc4hqnhZh8WxjxtDjuHdmjFNCc31HMMCxOQ7ZjKz2hWD7GUBZuj9oY 4tNhPzFaklNiBc+SxOGvzqKWQ89ITnE1g3T0XBKJsTFkdtEKUPwl1aqfx BaNTp8h+0eQJR46qq7wZ4Dn1KJQ2NXz2ltycXuu6Uwq9JByCxDDOH4BGL A==; IronPort-SDR: 4AgOSzrzKBHkNPgP4TDvpq/4MMDbEvMfa3ctVdWJtakul0osZdMjb+zVwKWIiNNrFbzI9gkAJO umP64wCuPfZhOB2sNZepGIbCzxP58WCy7dbGMgkm/JngK3qXPhHfyrO55PDJ4dkIBCzN81YoW7 46nx8e5US0pZVDZPISgMh6coklxQGZeV0eJqPHEggAC5GvRAFeTXvEbjNiW3dz8IKvAVs60Bto Ke54RAUK0aF0JW3Zf6qVFSN7JCR/QuMSQD1LCVct8xbGMpYICNdIBxb9KiHnmmzCyG8URFuzfj k1c= X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="36120031" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2020 05:34:53 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 4 Dec 2020 05:34:52 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 4 Dec 2020 05:34:48 -0700 From: Claudiu Beznea To: , , , , , , Subject: [PATCH 3/7] net: macb: unprepare clocks in case of failure Date: Fri, 4 Dec 2020 14:34:17 +0200 Message-ID: <1607085261-25255-4-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> References: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_073454_534553_B17C296C X-CRM114-Status: GOOD ( 12.95 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yash.shah@sifive.com, linux-riscv@lists.infradead.org, Claudiu Beznea Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Unprepare clocks in case of any failure in fu540_c000_clk_init(). Fixes: c218ad559020 ("macb: Add support for SiFive FU540-C000") Signed-off-by: Claudiu Beznea --- drivers/net/ethernet/cadence/macb_main.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index b23e986ac6dc..29d144690b3b 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4406,8 +4406,10 @@ static int fu540_c000_clk_init(struct platform_device *pdev, struct clk **pclk, return err; mgmt = devm_kzalloc(&pdev->dev, sizeof(*mgmt), GFP_KERNEL); - if (!mgmt) - return -ENOMEM; + if (!mgmt) { + err = -ENOMEM; + goto err_disable_clocks; + } init.name = "sifive-gemgxl-mgmt"; init.ops = &fu540_c000_ops; @@ -4418,16 +4420,29 @@ static int fu540_c000_clk_init(struct platform_device *pdev, struct clk **pclk, mgmt->hw.init = &init; *tx_clk = devm_clk_register(&pdev->dev, &mgmt->hw); - if (IS_ERR(*tx_clk)) - return PTR_ERR(*tx_clk); + if (IS_ERR(*tx_clk)) { + err = PTR_ERR(*tx_clk); + goto err_disable_clocks; + } err = clk_prepare_enable(*tx_clk); - if (err) + if (err) { dev_err(&pdev->dev, "failed to enable tx_clk (%u)\n", err); - else + goto err_disable_clocks; + } else { dev_info(&pdev->dev, "Registered clk switch '%s'\n", init.name); + } return 0; + +err_disable_clocks: + clk_disable_unprepare(*tx_clk); + clk_disable_unprepare(*hclk); + clk_disable_unprepare(*pclk); + clk_disable_unprepare(*rx_clk); + clk_disable_unprepare(*tsu_clk); + + return err; } static int fu540_c000_init(struct platform_device *pdev) From patchwork Fri Dec 4 12:34:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11951657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6430C4361A for ; Fri, 4 Dec 2020 12:35:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A6E122A99 for ; Fri, 4 Dec 2020 12:35:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A6E122A99 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+0CXdbieQJh2Vq3RRJMUhZbm9MqZskof8PV7j5GUVVg=; b=ktxdtV4lUccnVtvfEOB9AYEoo B3PjGVTJcXJwTEvwT2Ls05jSRnQBzQ17ZLDTaUo1U5kH2d5YgC9+PsjNzWTn57kV0PFakPyLhLPKM Geh77zO4/28WRtVCScSij66ajsmEsyHjiDIgMkcqNEdZiXvNhIfjH7DuEfQg0l8Iatf7jVMmV2o+9 sCE+DmGTpr09PXbgVba7d2/vekSiIH/3S6Vs7FnIxFY+EhlN2CHiR8ziSe2LX9XxATpfpYZ63onWb f2BCOgHfintrVwWUh62EdA01WhpcbFwHS4VXV5Ab3PBtGN80GzpMRtSya82NSL++0CAGXPkaEe+Bn 4CJCthVBA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIh-0000Qk-UJ; Fri, 04 Dec 2020 12:35:03 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIf-0000Pc-8c for linux-riscv@lists.infradead.org; Fri, 04 Dec 2020 12:35:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607085300; x=1638621300; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=jY0R1/xfu6HtmxjTgcdxe7QK3p92MvvnE8O6H0jUXmQ=; b=XNufLkMeD7aGdCO7shgIp+GxGgRAJmawcgQeLGT0OljaJ+g3y2LT3x+b 1V6a4FtSDyoaY6GHcbogp6ZQmafJimV/R1wnLGyL6A7HJhFcCgrXKoR5N DUK63Qyd9f15qU1pDya+IfEDr/G8VwVgtKlSGaOnD9H0yi569j4F1eRM7 odk3q3//OvJvQWMbDZnLmJtPJzw94sefZ6E6PeHmLG9EHXI/zPhSEnxjZ kFoIRjJ7i0gnTmcu0NzWviHkTQY3KKuDVxDTcXEYHhj5860RFZvIXPyZT QRsf2ds9rjGLjQlj2TkFqmjOMgS724NuUFcmOUomgQatR1NsKu0zlLhKf w==; IronPort-SDR: yQcU00xr0zK5tubVLPX5yonEi3W28OoMB75jGJ27XyOAH8cxFiBkx2AQdlqnlsVrC3mRfJea2L /mmu1c4UViqAWU9R7q0mkGi7u7WNAsDbgVhpq/DchS5cxVFpoYXq2gmTsImtzf42ODbQrDb7/T MNrbFhl7pN9EzZrMNmJcNS77XwPl/i70xht4+qlz4vAgdsPGSP7e+DHmPdm0zi/UyxnH8y30Iw 1v59h/WuSXPyGdnKdQh+3p/Mdip0w7DSPcMTaH0CP96wUDsIM5qrU9sM1C2qcEh+hsRi0/d1BL EQM= X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="106188081" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2020 05:34:59 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 4 Dec 2020 05:34:59 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 4 Dec 2020 05:34:53 -0700 From: Claudiu Beznea To: , , , , , , Subject: [PATCH 4/7] dt-bindings: add documentation for sama7g5 ethernet interface Date: Fri, 4 Dec 2020 14:34:18 +0200 Message-ID: <1607085261-25255-5-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> References: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_073501_486183_B5CFC5BD X-CRM114-Status: GOOD ( 10.32 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yash.shah@sifive.com, linux-riscv@lists.infradead.org, Claudiu Beznea Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add documentation for SAMA7G5 ethernet interface. Signed-off-by: Claudiu Beznea Reviewed-by: Andrew Lunn --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt index 0b61a90f1592..26543a4e15d5 100644 --- a/Documentation/devicetree/bindings/net/macb.txt +++ b/Documentation/devicetree/bindings/net/macb.txt @@ -16,6 +16,7 @@ Required properties: Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC. Use "cdns,zynqmp-gem" for Zynq Ultrascale+ MPSoC. Use "sifive,fu540-c000-gem" for SiFive FU540-C000 SoC. + Use "microchip,sama7g5-emac" for Microchip SAMA7G5 ethernet interface. Or the generic form: "cdns,emac". - reg: Address and length of the register set for the device For "sifive,fu540-c000-gem", second range is required to specify the From patchwork Fri Dec 4 12:34:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11951659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD311C433FE for ; Fri, 4 Dec 2020 12:35:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FAF222A99 for ; Fri, 4 Dec 2020 12:35:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FAF222A99 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PKyWF59H4lWSy09rfRK9mbs7Vs1fSfzxs/4zFw2UMBg=; b=vsQqWQ8DseT4lFtJA3zfsuQDE urcHnCBIw/4iKkaE2aVOJrCdUkiPdptT2w8mc7tKlkiPlPA5Q77FvtyK/QGBH4HS5kHsLPtLuvwS4 CcVCLZT0TdqWxNgYC5wQ1APFwKSTe2Q/S+H+zp6Vrgc+78ba5fU3x7LhMEesXEsNzpJWm7nLxdUEJ ST9PrmjkNglf+hh9fF7cruGuApxmSFnN9tD4VFFiCF53Tvg+MGai90ry++JwQyLs6MO+3davIipwv xmLEKXSWs7f+9orH4dT/2rsIZDg0HOT+3NwFH4OolOzmprStPdwpyHlAmx3/GHPmdsfFnifUy9XYQ VwhE4f5TQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIo-0000Sj-LZ; Fri, 04 Dec 2020 12:35:10 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIm-0000Ro-6E for linux-riscv@lists.infradead.org; Fri, 04 Dec 2020 12:35:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607085309; x=1638621309; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=CEAhOF2TJwycrOj7z9P3j3P2KFYumQb/0Mv/EX+Mw/g=; b=ZslFPDqbuNKD5Uk4Ed0Qdeg6OGjpAXbWqjhJmtjELDh+Y2zV57d/h3zv pp9r+AN3KUj4X2BFW620b2dm+yqkUC45bSe7G+nmGEisd/zOMJRyGWJX3 A1G3okOiXS6bDdK9j8E5FJFp2mBYIaaFZkGNBrkyVfWH1/FFL9958F3mm AczeyXpL7g3aJaEOn6C0H7iSx1qWgAB4s+KKgrtvcwvS6u2XN4jwU6XhD QJrvmQXRS/n5REeZUARjAOb462W1fSxXdXQZ+gfU4VAK9VlhQ57zg0mpb W6f/1en498opHGr6hnuuY3C9fOB9A2iITs9qkdLf4PiuhOHFuG/kw7MiA A==; IronPort-SDR: lGZYJVQlGn78KeShwwy5zzLE4V2cI87zhM3mRW+H4nfUuJIjaxIj9prdO2BjlZZNx3Q08R76ft /lehhDedLFk43Ra0ahkWnbH7UY41S4+mgo19GFj9aIuKVHVy50mRgQk/eewLu4u+y7BAfhrRsj sC6a6tZ9Zp+ajhRaX0fV9CziK3DGbfFxWFr+4HlLyMoEb96S4oQrvKTvqeh1/3NNXANyEWZ9/h whf/8Jwf+E+KiHYSdRpoZF5MnhTKaXJnp6YypLa4vS4o9gd/LU0RSdmvuwVY+DKOMh6el3ULSr zYk= X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="100918867" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2020 05:35:06 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 4 Dec 2020 05:35:05 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 4 Dec 2020 05:34:59 -0700 From: Claudiu Beznea To: , , , , , , Subject: [PATCH 5/7] dt-bindings: add documentation for sama7g5 gigabit ethernet interface Date: Fri, 4 Dec 2020 14:34:19 +0200 Message-ID: <1607085261-25255-6-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> References: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_073508_364260_28F3E631 X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yash.shah@sifive.com, linux-riscv@lists.infradead.org, Claudiu Beznea Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add documentation for SAMA7G5 gigabit ethernet interface. Signed-off-by: Claudiu Beznea Reviewed-by: Andrew Lunn --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt index 26543a4e15d5..e08c5a9d53da 100644 --- a/Documentation/devicetree/bindings/net/macb.txt +++ b/Documentation/devicetree/bindings/net/macb.txt @@ -17,6 +17,7 @@ Required properties: Use "cdns,zynqmp-gem" for Zynq Ultrascale+ MPSoC. Use "sifive,fu540-c000-gem" for SiFive FU540-C000 SoC. Use "microchip,sama7g5-emac" for Microchip SAMA7G5 ethernet interface. + Use "microchip,sama7g5-gem" for Microchip SAMA7G5 gigabit ethernet interface. Or the generic form: "cdns,emac". - reg: Address and length of the register set for the device For "sifive,fu540-c000-gem", second range is required to specify the From patchwork Fri Dec 4 12:34:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11951661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48846C4361A for ; Fri, 4 Dec 2020 12:35:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00DBD22A99 for ; Fri, 4 Dec 2020 12:35:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00DBD22A99 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ABo3LkTGa1nxeAX3h3payBqFKeTZ3gsBSHmRkADPZ7s=; b=nkUjEonf/i/jI8yfywbpd+PYf ykfA+9bJNh+6aZSQuuhuCamPnWfQTFuvB0x8BEfiJilIC55ugFiXX2boS+HvT2XkTCaH4W478jc6u ZOkOA52g5m2y80br7+O0+2frPEHCth6iqbxfPuRDk5Y9sIWC+KFg5QUGYZ7S87JHEgzerwYk+ypol PyXeG65s1kyzC7WSbbzToJko8YauqS9U84C6qzzH6klj/v7db+XUSEKZS29yXoCDYw49nnp3ikHhd oN1JJ01LQEMD/NSn6/4onXxotLsLhJWBLxVw615fImP3LiFbP+i/BpJZZiU+Ey4ouEaP2hKvkKpFo cL934wlyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIu-0000VE-Ds; Fri, 04 Dec 2020 12:35:16 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIr-0000TX-4g for linux-riscv@lists.infradead.org; Fri, 04 Dec 2020 12:35:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607085312; x=1638621312; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=yzKQluhYPffqyE+muc7ujoCkg9zgVEFQBijHQdhkibk=; b=K3t9a0U1X4Jn66QvwElG/tIMQRei3jVo0nMjxIRXmiLw5PFpvtfA60SI fOyN9vxRak6cjIUAHlnm2qsJEdCQk5dCdP/LcvTMlxJUpx5sD+F+uTFdP /TnwXqMFCbrAXY+iK/TxIuqmbR1e6mOXvE2lmYKwb37XFPYzT+X7r2G4i 081E8Xrwxacy1x0lnerhf/FjRFI5CFfLG20uTv1UFqQXJZTw4x+D3jvIk iNSlLXHLxpLl6D69iMukK3jNj/E5y+n5WhGrX4KY8EQCNnrBb7d9fUoXY pe+mQyELjVJnnd1lE0kSY6oY3wMMhan2jsKOpnqXVxxY5Ba+c3kJ0imz+ w==; IronPort-SDR: 56pKorbgBMzy4H9gJX9mAjHU66b5Tv7xjzoKOfeQriAozK6hoifvsE7LIZH21kDwzfxU542zbv axKxp2m9LCMvba3btBfSSU9Hg5d5uFQ/0xFYFZEJVce4m9q3t94UowO0ExohEx7Df1b44i+cgz nLlPpEj3OKh0/NWRv+7i6+lHVGPTZYZyTWrNTsDt5OP5lrbh1yrP0hv1nkUMaWZQ37/wOyN4P5 NBfpeyxrYTXN2GKn/3keBaSYQNUELc/Xcs12xUPU1/Ef3J8DJA7kz+MbkVaMtkSevAhE4NQj6Z sj8= X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="106188165" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2020 05:35:11 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 4 Dec 2020 05:35:11 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 4 Dec 2020 05:35:05 -0700 From: Claudiu Beznea To: , , , , , , Subject: [PATCH 6/7] net: macb: add support for sama7g5 gem interface Date: Fri, 4 Dec 2020 14:34:20 +0200 Message-ID: <1607085261-25255-7-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> References: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_073513_358305_6F8D6AA3 X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yash.shah@sifive.com, linux-riscv@lists.infradead.org, Claudiu Beznea Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add support for SAMA7G5 gigabit ethernet interface. Signed-off-by: Claudiu Beznea Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cadence/macb_main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 29d144690b3b..22340e55d4b7 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4461,6 +4461,14 @@ static const struct macb_usrio_config macb_default_usrio = { .refclk = MACB_BIT(CLKEN), }; +static const struct macb_usrio_config sama7g5_usrio = { + .mii = 0, + .rmii = 1, + .rgmii = 2, + .refclk = BIT(2), + .hdfctlen = BIT(6), +}; + static const struct macb_config fu540_c000_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP, @@ -4554,6 +4562,14 @@ static const struct macb_config zynq_config = { .usrio = &macb_default_usrio, }; +static const struct macb_config sama7g5_gem_config = { + .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG, + .dma_burst_length = 16, + .clk_init = macb_clk_init, + .init = macb_init, + .usrio = &sama7g5_usrio, +}; + static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,at32ap7000-macb" }, { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, @@ -4571,6 +4587,7 @@ static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config}, { .compatible = "cdns,zynq-gem", .data = &zynq_config }, { .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config }, + { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, macb_dt_ids); From patchwork Fri Dec 4 12:34:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11951663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2B23C4361A for ; Fri, 4 Dec 2020 12:35:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2E2D22A99 for ; Fri, 4 Dec 2020 12:35:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2E2D22A99 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eaS6GHJlWLI6M3llpe93LTexhknor1jeQgowFy3Ye6k=; b=1fuFvuGWx3f1vMtQKUOhpnzeu hIOT7TqYJCuSouXdOg6bX17AaonSLRqsdCxLLpeFC0RtcfBRjhNBXGzFbTJq4mj3aTIkWyVwBD5O7 Bgl24xcxqCvGII7TOsqj/L97p2IW3hDJJ5wckVjtXF1sJgrG9xJMl12795IXxr81hAqpmkm4yFqch kjex13qcC5csALj4+IV7jpt00WYeH9tRmHI+04gp6jiTTs2uxqf4rIgHw7/QGMS2cx9AjtTU1dTNJ 0XEeBdn9X9XNFpBi15OKHJQJiGmMqGuLPG/W3HO7RsEn8QrjZOf1z4mrjZDtpr9VfXTTbFyALaZE3 kzZEz3lnA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIz-0000Xf-60; Fri, 04 Dec 2020 12:35:21 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klAIx-0000TX-Ht for linux-riscv@lists.infradead.org; Fri, 04 Dec 2020 12:35:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607085319; x=1638621319; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=g1J9PQBnIlV0iQX/uOV1x4ubZU85IwPi2qdU1ENP0lg=; b=gU08VKVCS+QswBXxes1UBwYeSfHzaQL5Jaa4UMbPIWlIpxCAyGWkmdzA S7Df20XxaACI4GaHveOdZTrXPX2eeqY3nk/Q+nlWSyjSPFEettQFIt14h BO/X9374KncHDVQ1qQpDKkKShHJwJ5M/6GIGDlIVE1AGdo8xpX90L1wDO PP6JYYrEJEZWTnrhPq/NLeCkHKjGc2Hl1vfYUxJ39j03joHBl75hsV9ZF 4CFmTONXOPHp0AGZogF5G5NvA5Rwr7Bal9qJT7fdWiYrJTc8czvNwD5em nRX5pDe1kGEpwD5nHzZT7UUEXN3cl66MjY+IsvFELVGJOsnAonWV91mSp g==; IronPort-SDR: D2DUSi6LWDPa/lP7TKgXBQhoI/cowMjEzS/ZVxVNk+O1U5si6Nz6305FT8GJ2k2jdtDCsSx56p +pedqLfAEItdgwjDrQ8XMwoegq/W/rQo7FNgrn1gdQVEBsIA8QyZUwBnOEJkyEWD+P/82bXnDl 3mbyoiv2035rn5KZFPhkWIWh0irCIy9aOUiKyFIrv2MkfAKesu+/+6o1xyaTNXR+0sG1ZhfJX7 r16apTftoiagZfNTpKY3ArYGvzs7fhsnI3wav3t52adL+WZtBLMUpqln6+u0myEMzU/HMEZOce TIo= X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="106188212" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Dec 2020 05:35:18 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 4 Dec 2020 05:35:18 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 4 Dec 2020 05:35:12 -0700 From: Claudiu Beznea To: , , , , , , Subject: [PATCH 7/7] net: macb: add support for sama7g5 emac interface Date: Fri, 4 Dec 2020 14:34:21 +0200 Message-ID: <1607085261-25255-8-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> References: <1607085261-25255-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_073519_760280_B91F901B X-CRM114-Status: GOOD ( 10.78 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yash.shah@sifive.com, linux-riscv@lists.infradead.org, Claudiu Beznea Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add support for SAMA7G5 10/100Mbps interface. Signed-off-by: Claudiu Beznea Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cadence/macb_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 22340e55d4b7..2e1f9b28e388 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4570,6 +4570,14 @@ static const struct macb_config sama7g5_gem_config = { .usrio = &sama7g5_usrio, }; +static const struct macb_config sama7g5_emac_config = { + .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_USRIO_HAS_CLKEN, + .dma_burst_length = 16, + .clk_init = macb_clk_init, + .init = macb_init, + .usrio = &sama7g5_usrio, +}; + static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,at32ap7000-macb" }, { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, @@ -4588,6 +4596,7 @@ static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,zynq-gem", .data = &zynq_config }, { .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config }, { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config }, + { .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, macb_dt_ids);