From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3A78D2ECF7 for ; Tue, 20 Jan 2026 04:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SXPo8bwtf9qN2jtL95UMWclkUppnt2yJ6sNk7llHuWA=; b=Lqcp87Wiorq3871ONvjk5d6l9X M9VvyUaDrfSARNfD43jNr1DIv9kVtaaUoBMqECSgLDgxw2gHxy/69+0qN49H/jNuCQuoeJzjVD5YL 6HA4zeIoVb3ld5pRwlkbzUajntcizdbxm9md4R+QZaTnECgmMtp1fhLbpw4QrhMuMzQpUQ8oO+44n ahx665pIt91NVJ39zc1Ccccob4/OoYt8BwxPnVuQFWdcqu1EbhB3Ed7pjbAfnJKBkiZidun2SFSta yu9EfSAo0tycSBXVkDpmCzpmt3Lfa7K8AbGfgkJUK8xjlK+qGm423LwGb7QF13vXPl2JPFc1td7Wj ySq4cTjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vi3o4-00000003D5H-2Hok; Tue, 20 Jan 2026 04:57:32 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vi3o2-00000003D4n-1Y7g; Tue, 20 Jan 2026 04:57:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SXPo8bwtf9qN2jtL95UMWclkUppnt2yJ6sNk7llHuWA=; b=AY8/+hKPuLS7V6sGeREJlqYc42 njM+nvbRUjCCla3reFcqIeDt8wH6lIwGmpgTrO6G6Eclk9AVzViDCbwMS1mG9I2Q2yuf9lU1m3pHo dvHY/+a+MCdgtpL30bzkPPZPS5hscx41Ow1BiSv5GQHnYGG7sKQeL/crNbLsqSdpwVSJtzJo334u/ Qi8cgLNzU3DRAK7n/qrDdIzFkZDdEyWFwvLWn3jKiPO8g4JyqosQ7F6BPXCglLfcniBna57i7lSwY 0z9kb5X1Kz8DO/gof3q+lg7aeW78bzBMu56kUNaWVY7qCcVwKsMmRv+hPn535Smw/oD3KLefqaygo 3mGdbuwg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:50384) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vi3nK-000000005q6-3P48; Tue, 20 Jan 2026 04:56:46 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vi3n6-000000007Ae-2ALf; Tue, 20 Jan 2026 04:56:32 +0000 Date: Tue, 20 Jan 2026 04:56:32 +0000 From: "Russell King (Oracle)" To: Inochi Amaoto Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yanteng Si , Yao Zi , Vladimir Oltean , Lad Prabhakar , Choong Yong Liang , Maxime Chevallier , Chen-Yu Tsai , Shangjuan Wei , Boon Khai Ng , Quentin Schulz , Giuseppe Cavallaro , Jose Abreu , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Longbin Li Subject: Re: [PATCH net-next 3/3] net: stmmac: Add glue layer for Spacemit K3 SoC Message-ID: References: <20260120043609.910302-1-inochiama@gmail.com> <20260120043609.910302-4-inochiama@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260120043609.910302-4-inochiama@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260119_205730_413286_9985E495 X-CRM114-Status: GOOD ( 15.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jan 20, 2026 at 12:36:08PM +0800, Inochi Amaoto wrote: > Adds Spacemit dwmac driver support on the Spacemit K3 SoC. Some more information would be useful. E.g. describing why you need to fix the RGMII mode. > +/* ctrl register bits */ > +#define PHY_INTF_RGMII BIT(3) > +#define PHY_INTF_MII BIT(4) > + > +#define WAKE_IRQ_EN BIT(9) > +#define PHY_IRQ_EN BIT(12) > + > +/* dline register bits */ > +#define RGMII_RX_DLINE_EN BIT(0) > +#define RGMII_RX_DLINE_STEP GENMASK(5, 4) > +#define RGMII_RX_DLINE_CODE GENMASK(15, 8) > +#define RGMII_TX_DLINE_EN BIT(16) > +#define RGMII_TX_DLINE_STEP GENMASK(21, 20) > +#define RGMII_TX_DLINE_CODE GENMASK(31, 24) > + > +#define MAX_DLINE_DELAY_CODE 0xff > + > +struct spacemit_dwmac { > + struct device *dev; > + struct clk *tx; > +}; This structure seems unused. > + > +/* Note: the delay step value is at 0.1ps */ > +static const unsigned int k3_delay_step_10x[4] = { > + 367, 493, 559, 685 > +}; > + > +static int spacemit_dwmac_set_delay(struct regmap *apmu, > + unsigned int dline_offset, > + unsigned int tx_code, unsigned int tx_config, > + unsigned int rx_code, unsigned int rx_config) > +{ > + unsigned int mask, val; > + > + mask = RGMII_RX_DLINE_STEP | RGMII_TX_DLINE_CODE | RGMII_TX_DLINE_EN | > + RGMII_TX_DLINE_STEP | RGMII_RX_DLINE_CODE | RGMII_RX_DLINE_EN; > + val = FIELD_PREP(RGMII_TX_DLINE_CODE, tx_config) | > + FIELD_PREP(RGMII_TX_DLINE_CODE, tx_code) | RGMII_TX_DLINE_EN | > + FIELD_PREP(RGMII_TX_DLINE_CODE, rx_config) | > + FIELD_PREP(RGMII_RX_DLINE_CODE, rx_code) | RGMII_RX_DLINE_EN; These FIELD_PREP() fields look wrong. Did you mean to use DLINE_CODE both tx_config and tx_code, and did you mean to use TX_DLINE_CODE for rx_config ? > + plat_dat->clk_tx_i = devm_clk_get_enabled(&pdev->dev, "tx"); > + if (IS_ERR(plat_dat->clk_tx_i)) > + return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat->clk_tx_i), > + "failed to get tx clock\n"); You set plat_dat->clk_tx_i, but you don't point plat_dat->set_clk_tx_rate at anything, which means the stmmac core does nothing with this. Given the last two points, has RGMII mode been tested on this hardware? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!