{"id":2229931,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229931/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260428-net-macb-support-for-feature-lite-instances-v1-4-480e4cecac01@nanoxplore.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260428-net-macb-support-for-feature-lite-instances-v1-4-480e4cecac01@nanoxplore.com>","date":"2026-04-28T18:04:08","name":"[4/4] net: macb: add gigabit implementation for fixed-link","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"fb87976c7eb9f9d32b38851c6c997366d1d92588","submitter":{"id":93277,"url":"http://patchwork.ozlabs.org/api/1.1/people/93277/?format=json","name":"Christian DREHER via B4 Relay","email":"devnull+christian.dreher.nanoxplore.com@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260428-net-macb-support-for-feature-lite-instances-v1-4-480e4cecac01@nanoxplore.com/mbox/","series":[{"id":501943,"url":"http://patchwork.ozlabs.org/api/1.1/series/501943/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=501943","date":"2026-04-28T18:04:05","name":"net: macb: support for instances with less features","version":1,"mbox":"http://patchwork.ozlabs.org/series/501943/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229931/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229931/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=ImZkt/zk;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.b=\"ImZkt/zk\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org","phobos.denx.de; spf=pass\n smtp.mailfrom=devnull+christian.dreher.nanoxplore.com@kernel.org"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4wb2358Fz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 08:48:46 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id D5DEA846C1;\n\tWed, 29 Apr 2026 00:48:17 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id F31C384664; Tue, 28 Apr 2026 20:04:52 +0200 (CEST)","from sea.source.kernel.org (sea.source.kernel.org\n [IPv6:2600:3c0a:e001:78e:0:1991:8:25])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 7DC3984674\n for <u-boot@lists.denx.de>; Tue, 28 Apr 2026 20:04:48 +0200 (CEST)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by sea.source.kernel.org (Postfix) with ESMTP id F3DF0441D7;\n Tue, 28 Apr 2026 18:04:46 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPS id D7170C2BCB9;\n Tue, 28 Apr 2026 18:04:46 +0000 (UTC)","from aws-us-west-2-korg-lkml-1.web.codeaurora.org\n (localhost.localdomain [127.0.0.1])\n by smtp.lore.kernel.org (Postfix) with ESMTP id D0CC4FF885A;\n Tue, 28 Apr 2026 18:04:46 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1777399486;\n bh=mrlGr/d8yy87uKVmydZvefXxDFcwk2ymAz8fKV2K0bw=;\n h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;\n b=ImZkt/zk2eByNImLHBxftCqzf0E9leO3vl2FAmgtggKty+U7jEWDOvGGK79uxy542\n 8GkcAWR0w1CNmhRgPH9KvgtQFtWWe99Hstrx6EQnPmVWxXAn+kLn3Vl4zooLY6e92T\n KJNkos8iVTgqu8sXIE8yskO+SmykifKpEAxDEyT74/z4oBYKTljj2BUG85RiTDDjsd\n /HbS9FxntURZlgyPJAUuYafnG1tM1kXzaF6MRY38AUUM1eFdqeezCdjbNfHeTcSkDq\n xwTxOWHP7yrHTITn8N3iii9WmPA+QO/HBMKNZF+b4C7G3bgKt2HfHQIIwwIGUc+HYh\n BbajxUVW3rumw==","From":"Christian DREHER via B4 Relay\n <devnull+christian.dreher.nanoxplore.com@kernel.org>","Date":"Tue, 28 Apr 2026 20:04:08 +0200","Subject":"[PATCH 4/4] net: macb: add gigabit implementation for fixed-link","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"\n <20260428-net-macb-support-for-feature-lite-instances-v1-4-480e4cecac01@nanoxplore.com>","References":"\n <20260428-net-macb-support-for-feature-lite-instances-v1-0-480e4cecac01@nanoxplore.com>","In-Reply-To":"\n <20260428-net-macb-support-for-feature-lite-instances-v1-0-480e4cecac01@nanoxplore.com>","To":"u-boot@lists.denx.de","Cc":"Jerome Forissier <jerome.forissier@arm.com>,\n Tom Rini <trini@konsulko.com>,\n Christian DREHER <christian.dreher@nanoxplore.com>","X-Mailer":"b4 0.15.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1777399485; l=2337;\n i=christian.dreher@nanoxplore.com; s=20260428; h=from:subject:message-id;\n bh=C5Nzv11Bwryz9D8hZGO5arZ3cYSEIEx4tJZcH1tjt9k=;\n b=jktcw76AUqrFYKKOIov1SKJ23gxal8xRE0YBkgG50FZIBR4mdRJZsK8jjIR2cQPFCWoh3Y3BN\n o5eaMDjjG9MDcqWV8tqYZEfo2cSU8lloghIB16pmZDz/Ik3W1TktCsG","X-Developer-Key":"i=christian.dreher@nanoxplore.com; a=ed25519;\n pk=id7EcKmXLV2xNgNiCIcsPjkoMQHM/qxTYqEqMhidSAU=","X-Endpoint-Received":"by B4 Relay for\n christian.dreher@nanoxplore.com/20260428 with auth_id=760","X-Original-From":"Christian DREHER <christian.dreher@nanoxplore.com>","X-Mailman-Approved-At":"Wed, 29 Apr 2026 00:48:15 +0200","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Reply-To":"christian.dreher@nanoxplore.com","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"From: Christian DREHER <christian.dreher@nanoxplore.com>\n\nA fixed gigabit link on a non-gigabit controller is only rejected\nduring PHY init (even though there is no PHY to init), because, on\ndevice-tree parsing, the controller is not probed, and it is still\nunknown whether it is gigabit-capable.\n\nThis code was only tested on emulator with a full-duplex RGMII\ninterface, but is expected to work in GMII or half-duplex as well.\n\nSigned-off-by: Christian DREHER <christian.dreher@nanoxplore.com>\n---\n drivers/net/macb.c | 32 ++++++++++++++++++++++++++++----\n 1 file changed, 28 insertions(+), 4 deletions(-)","diff":"diff --git a/drivers/net/macb.c b/drivers/net/macb.c\nindex 5cc29ecb214..bea1dfed892 100644\n--- a/drivers/net/macb.c\n+++ b/drivers/net/macb.c\n@@ -772,18 +772,40 @@ static int macb_phy_init(struct udevice *dev, const char *name)\n \t\t\tlpa);\n \t} else {\n \t\t/* if macb port is a fixed link */\n-\t\t/* TODO : manage gigabit capable processors */\n+\t\tconst char *human_readable_speed;\n+\n \t\tspeed = macb->speed;\n \t\tduplex = macb->duplex;\n+\t\tswitch (speed) {\n+\t\tcase 2:\n+\t\t\thuman_readable_speed = \"1000\";\n+\t\t\tbreak;\n+\t\tcase 1:\n+\t\t\thuman_readable_speed = \"100\";\n+\t\t\tbreak;\n+\t\tcase 0:\n+\t\t\thuman_readable_speed = \"10\";\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tprintf(\"%s: speed %d not supported\\n\", name, speed);\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t\tprintf(\"%s: link up, %sMbps %s-duplex\\n\",\n \t\t\tname,\n-\t\t\tspeed ? \"100\" : \"10\",\n+\t\t\thuman_readable_speed,\n \t\t\tduplex ? \"full\" : \"half\");\n \t}\n \n \tncfgr = macb_readl(macb, NCFGR);\n \tncfgr &= ~(MACB_BIT(SPD) | MACB_BIT(FD) | GEM_BIT(GBE));\n-\tif (speed) {\n+\tif (speed == 2) {\n+\t\tif (!gem_is_gigabit_capable(macb)) {\n+\t\t\tprintf(\"%s: is not gigabit Ethernet capable\\n\", name);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tncfgr |= GEM_BIT(GBE);\n+\t\tret = macb_linkspd_cb(dev, _1000BASET);\n+\t} else if (speed == 1) {\n \t\tncfgr |= MACB_BIT(SPD);\n \t\tret = macb_linkspd_cb(dev, _100BASET);\n \t} else {\n@@ -1329,7 +1351,9 @@ static int macb_eth_of_to_plat(struct udevice *dev)\n \t\tmacb->phy_addr = PHY_MAX_ADDR + 1;\n \t\tmacb->duplex = fdtdec_get_bool(blob, fl_node, \"full-duplex\");\n \t\tspeed_fdt = fdtdec_get_int(blob, fl_node, \"speed\", 0);\n-\t\tif (speed_fdt == 100) {\n+\t\tif (speed_fdt == 1000) {\n+\t\t\tmacb->speed = 2;\n+\t\t} else if (speed_fdt == 100) {\n \t\t\tmacb->speed = 1;\n \t\t} else if (speed_fdt == 10) {\n \t\t\tmacb->speed = 0;\n","prefixes":["4/4"]}