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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3066C25B4E for ; Sun, 22 Jan 2023 22:52:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 19122856CD; Sun, 22 Jan 2023 23:51:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="gF9KZMu8"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="q5WYdb7T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 52F2885518; Sun, 22 Jan 2023 23:51:18 +0100 (CET) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A12CE83623 for ; Sun, 22 Jan 2023 23:51:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C11FC32002E2; Sun, 22 Jan 2023 17:51:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 22 Jan 2023 17:51:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1674427871; x=1674514271; bh=j2 s9NJZZPsfRYDIhG5xYDc3Hzw5FvLOh6mqwU3Elkbc=; b=gF9KZMu8YKhhMkPQy+ Mm1M/miLVmkx25wVkCZXtjsplzLzNkGDr7wlHS5E37qstga8Oqph+X+17+4ZvZNt IWBes2j5knt3V7Thjo60fFuoAVF+t63jwneoQ0Yrhq44+vYnET49tmQ7hSpv2CsM pxQK856Z23ndTkNug6lXnUXifzdMwXxCSht0tXjnt51snrRCgvkcTBr6FCrGtaS0 zYOYIGumsv24vIRGdXuSVTBOlKCHAf4UJmPnmxJfqo0PEq2CiZw3Pf1QzxgVddbz jXcA6T6Gk0yyMArV2BQlygvKey7R0TURLs2D371WfcMiSZmmV3IHcHAQRetmnj2r X9Hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1674427871; x=1674514271; bh=j2s9NJZZPsfRY DIhG5xYDc3Hzw5FvLOh6mqwU3Elkbc=; b=q5WYdb7TUPrCpLuX72jcP+akjuu7b 1MaPmwtzEoOjCbzp1Om1hOVQJCMd06GPCoH8NtywgqXBQry3jnQXsd8tdPXskoMd YnUazZD6X+wqH2PKrQJNTRJ8qN7P+7FVzie3/kugvP8hW8nllcINpgvxn7CxuD7Q PLzMiIg7ejB87rvyiystxye2xh1X/Hel7/IWka8jVrl2xuNQgYSVchjJd5m2bq6A RTOQC9KxgAZb8iFiRYGzOjMogqR0mVn4FXXM3xFaPTQwpD1gk2qwQEbS1s/CHuej lnl/uFXcnampo8x1WcZgHG7KPLSGlgOH9rlvfEiqEXFMudVBpV/kPUlNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddujedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Jan 2023 17:51:10 -0500 (EST) From: Samuel Holland To: Andre Przywara , Jagan Teki Cc: Samuel Holland , Joe Hershberger , Ramon Fried , u-boot@lists.denx.de Subject: [PATCH v2 2/5] net: sun8i-emac: Add a flag for RMII support Date: Sun, 22 Jan 2023 16:51:03 -0600 Message-Id: <20230122225107.62464-3-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230122225107.62464-1-samuel@sholland.org> References: <20230122225107.62464-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Describe this feature instead of using the SoC ID. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 drivers/net/sun8i_emac.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index 986e565cd8..f232b8f087 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -137,6 +137,7 @@ enum emac_variant_id { struct emac_variant { enum emac_variant_id variant; + bool support_rmii; }; struct emac_dma_desc { @@ -337,9 +338,7 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata, reg = sun8i_emac_set_syscon_ephy(priv, reg); reg &= ~(SC_ETCS_MASK | SC_EPIT); - if (priv->variant->variant == H3_EMAC || - priv->variant->variant == A64_EMAC || - priv->variant->variant == H6_EMAC) + if (priv->variant->support_rmii) reg &= ~SC_RMII_EN; switch (priv->interface) { @@ -353,13 +352,10 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata, reg |= SC_EPIT | SC_ETCS_INT_GMII; break; case PHY_INTERFACE_MODE_RMII: - if (priv->variant->variant == H3_EMAC || - priv->variant->variant == A64_EMAC || - priv->variant->variant == H6_EMAC) { + if (priv->variant->support_rmii) { reg |= SC_RMII_EN | SC_ETCS_EXT_GMII; - break; + break; } - /* RMII not supported on A83T */ default: debug("%s: Invalid PHY interface\n", __func__); return -EINVAL; @@ -910,6 +906,7 @@ static const struct emac_variant emac_variant_a83t = { static const struct emac_variant emac_variant_h3 = { .variant = H3_EMAC, + .support_rmii = true, }; static const struct emac_variant emac_variant_r40 = { @@ -918,10 +915,12 @@ static const struct emac_variant emac_variant_r40 = { static const struct emac_variant emac_variant_a64 = { .variant = A64_EMAC, + .support_rmii = true, }; static const struct emac_variant emac_variant_h6 = { .variant = H6_EMAC, + .support_rmii = true, }; static const struct udevice_id sun8i_emac_eth_ids[] = { -- 2.37.4