From fdc857358747fcf0c905779e3f114af66feeab1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 1 Apr 2023 20:58:54 +0200 Subject: [PATCH] kernel: backport upstreamed DSA B53 MMAP patch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Move the patch from pending to backport, since it has been accepted upstream: https://github.com/torvalds/linux/commit/45977e58ce65ed0459edc9a0466d9dfea09463f5 Signed-off-by: Álvaro Fernández Rojas --- ....3-0005-net-dsa-b53-mmap-add-phy-ops.patch | 49 ++++++++ ...-net-dsa-b53-mmap-add-more-63xx-SoCs.patch | 2 +- ...dsa-b53-mmap-allow-passing-a-chip-ID.patch | 4 +- .../776-net-dsa-b53-mmap-add-phy-ops.patch | 118 ------------------ 4 files changed, 52 insertions(+), 121 deletions(-) create mode 100644 target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch delete mode 100644 target/linux/generic/pending-5.15/776-net-dsa-b53-mmap-add-phy-ops.patch diff --git a/target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch b/target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch new file mode 100644 index 0000000000..f35ae2588b --- /dev/null +++ b/target/linux/generic/backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch @@ -0,0 +1,49 @@ +From 45977e58ce65ed0459edc9a0466d9dfea09463f5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Thu, 23 Mar 2023 20:48:41 +0100 +Subject: [PATCH] net: dsa: b53: mmap: add phy ops +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing +B53_PORT_MII_PAGE registers which hangs the device. +This access should be done through the MDIO Mux bus controller. + +Signed-off-by: Álvaro Fernández Rojas +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/b53/b53_mmap.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/net/dsa/b53/b53_mmap.c ++++ b/drivers/net/dsa/b53/b53_mmap.c +@@ -216,6 +216,18 @@ static int b53_mmap_write64(struct b53_d + return 0; + } + ++static int b53_mmap_phy_read16(struct b53_device *dev, int addr, int reg, ++ u16 *value) ++{ ++ return -EIO; ++} ++ ++static int b53_mmap_phy_write16(struct b53_device *dev, int addr, int reg, ++ u16 value) ++{ ++ return -EIO; ++} ++ + static const struct b53_io_ops b53_mmap_ops = { + .read8 = b53_mmap_read8, + .read16 = b53_mmap_read16, +@@ -227,6 +239,8 @@ static const struct b53_io_ops b53_mmap_ + .write32 = b53_mmap_write32, + .write48 = b53_mmap_write48, + .write64 = b53_mmap_write64, ++ .phy_read16 = b53_mmap_phy_read16, ++ .phy_write16 = b53_mmap_phy_write16, + }; + + static int b53_mmap_probe_of(struct platform_device *pdev, diff --git a/target/linux/generic/pending-5.15/773-net-dsa-b53-mmap-add-more-63xx-SoCs.patch b/target/linux/generic/pending-5.15/773-net-dsa-b53-mmap-add-more-63xx-SoCs.patch index 1e95425952..e2da4e7f05 100644 --- a/target/linux/generic/pending-5.15/773-net-dsa-b53-mmap-add-more-63xx-SoCs.patch +++ b/target/linux/generic/pending-5.15/773-net-dsa-b53-mmap-add-more-63xx-SoCs.patch @@ -94,7 +94,7 @@ Reviewed-by: Florian Fainelli --- a/drivers/net/dsa/b53/b53_mmap.c +++ b/drivers/net/dsa/b53/b53_mmap.c -@@ -333,8 +333,11 @@ static void b53_mmap_shutdown(struct pla +@@ -347,8 +347,11 @@ static void b53_mmap_shutdown(struct pla static const struct of_device_id b53_mmap_of_table[] = { { .compatible = "brcm,bcm3384-switch" }, diff --git a/target/linux/generic/pending-5.15/774-net-dsa-b53-mmap-allow-passing-a-chip-ID.patch b/target/linux/generic/pending-5.15/774-net-dsa-b53-mmap-allow-passing-a-chip-ID.patch index b84ad12d01..456643f05d 100644 --- a/target/linux/generic/pending-5.15/774-net-dsa-b53-mmap-allow-passing-a-chip-ID.patch +++ b/target/linux/generic/pending-5.15/774-net-dsa-b53-mmap-allow-passing-a-chip-ID.patch @@ -122,7 +122,7 @@ Signed-off-by: Álvaro Fernández Rojas .vlans = 4096, --- a/drivers/net/dsa/b53/b53_mmap.c +++ b/drivers/net/dsa/b53/b53_mmap.c -@@ -248,7 +248,7 @@ static int b53_mmap_probe_of(struct plat +@@ -262,7 +262,7 @@ static int b53_mmap_probe_of(struct plat return -ENOMEM; pdata->regs = mem; @@ -131,7 +131,7 @@ Signed-off-by: Álvaro Fernández Rojas pdata->big_endian = of_property_read_bool(np, "big-endian"); of_ports = of_get_child_by_name(np, "ports"); -@@ -332,14 +332,28 @@ static void b53_mmap_shutdown(struct pla +@@ -346,14 +346,28 @@ static void b53_mmap_shutdown(struct pla } static const struct of_device_id b53_mmap_of_table[] = { diff --git a/target/linux/generic/pending-5.15/776-net-dsa-b53-mmap-add-phy-ops.patch b/target/linux/generic/pending-5.15/776-net-dsa-b53-mmap-add-phy-ops.patch deleted file mode 100644 index 786e07c8bb..0000000000 --- a/target/linux/generic/pending-5.15/776-net-dsa-b53-mmap-add-phy-ops.patch +++ /dev/null @@ -1,118 +0,0 @@ -From patchwork Thu Mar 23 19:48:41 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= - -X-Patchwork-Id: 13186039 -X-Patchwork-Delegate: kuba@kernel.org -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 vger.kernel.org (vger.kernel.org [23.128.96.18]) - by smtp.lore.kernel.org (Postfix) with ESMTP id 968C3C6FD1C - for ; Thu, 23 Mar 2023 19:48:57 +0000 (UTC) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S230463AbjCWTs4 (ORCPT ); - Thu, 23 Mar 2023 15:48:56 -0400 -Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55372 "EHLO - lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S231235AbjCWTsv (ORCPT - ); Thu, 23 Mar 2023 15:48:51 -0400 -Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com - [IPv6:2a00:1450:4864:20::431]) - by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ECB01040F; - Thu, 23 Mar 2023 12:48:46 -0700 (PDT) -Received: by mail-wr1-x431.google.com with SMTP id i9so21784869wrp.3; - Thu, 23 Mar 2023 12:48:46 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=gmail.com; s=20210112; t=1679600924; - h=content-transfer-encoding:mime-version:message-id:date:subject:cc - :to:from:from:to:cc:subject:date:message-id:reply-to; - bh=/D6faZLuMe7xaso6CO/2kkyQATErE9ouEiXJJAWuYSw=; - b=Sy0AoQ2nURFU7hQ4iDJucgH+I1i7hZxm6erI5lMl/wC/XyNRhAZD+ZJSzlFJBQDtoD - hZThEQp9Ad0QKaZFom1OzYTuNqWp1QWKY+AJFN/vyaEKWP/Q1jYAIRkTJK3c+qpZwesc - Oha96WNA7SfaVJ/HBCTlaPwV1/N7X5gOWxoqX59Fb4KDRLJ7PBASD6XXxTnaeFudYogB - Vg3Mq+rm/TApR/IPWANEO7KqEr6StC0P0EN1tSnfPdAkxSkByuM34l+pr5LXD8w91MGe - 1BQSl1vHyZQjR/WJmiZl1QAgSaJR0EVn2isPcjOIjQPBg+HQ4AY4MFoaOTm6RanKzloA - BtWw== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20210112; t=1679600924; - h=content-transfer-encoding:mime-version:message-id:date:subject:cc - :to:from:x-gm-message-state:from:to:cc:subject:date:message-id - :reply-to; - bh=/D6faZLuMe7xaso6CO/2kkyQATErE9ouEiXJJAWuYSw=; - b=GoOv7EUR83WD3MWgKMC9ENLuaNcBHHis524Yrd5LxZOocYFmdtARV8Gfgk2WHyQ5lM - zoNvI+h6alZwbu2qWJq9KbAUekFUm5/qkjWvPGRMcQVt9aKiCI/nLy6zYG4tJSqT2kyX - FHbhy2GbJIriCm8ENoRfzE5RhAjxFuaaD+/apSEA5IK4a7hm+VKDWJDe+VF8C/Vah/Bp - tK2LG14OdhhwFmepUsr9lA7jzTqhyCAFklHW+frebH2K/D4ZzvcScvXTx3k+d8+7ZuYr - BkPI0fgMryZdYgeGDWnox5s1jIzQQn4laPpNczVMu06i9j8ANfjnZ9uICrpUDAAKgn+x - uGBg== -X-Gm-Message-State: AAQBX9efILx1adxeGqvUsSK8ibPnaoTHCJA78gzwtmsK+HYaaGH/yO4t - xPl4Q8TUvNTDcy2J2/mFy80= -X-Google-Smtp-Source: - AKy350bX5yENhBXAjV5ZhqRDlOsZvqU+xNCSUbf4jNQtqB8hjgDg9RB7fVuazc+3ZdlciEIHI1q/jg== -X-Received: by 2002:adf:f30c:0:b0:2cf:ed87:37c9 with SMTP id - i12-20020adff30c000000b002cfed8737c9mr200232wro.11.1679600924524; - Thu, 23 Mar 2023 12:48:44 -0700 (PDT) -Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net. - [79.146.124.255]) - by smtp.gmail.com with ESMTPSA id - p17-20020adfcc91000000b002c71dd1109fsm16952587wrj.47.2023.03.23.12.48.43 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Thu, 23 Mar 2023 12:48:44 -0700 (PDT) -From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= -To: f.fainelli@gmail.com, jonas.gorski@gmail.com, andrew@lunn.ch, - olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, - kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, - netdev@vger.kernel.org, linux-kernel@vger.kernel.org -Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= -Subject: [PATCH] net: dsa: b53: mmap: add phy ops -Date: Thu, 23 Mar 2023 20:48:41 +0100 -Message-Id: <20230323194841.1431878-1-noltari@gmail.com> -X-Mailer: git-send-email 2.30.2 -MIME-Version: 1.0 -Precedence: bulk -List-ID: -X-Mailing-List: netdev@vger.kernel.org -X-Patchwork-Delegate: kuba@kernel.org - -Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing -B53_PORT_MII_PAGE registers which hangs the device. -This access should be done through the MDIO Mux bus controller. - -Signed-off-by: Álvaro Fernández Rojas ---- - drivers/net/dsa/b53/b53_mmap.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - ---- a/drivers/net/dsa/b53/b53_mmap.c -+++ b/drivers/net/dsa/b53/b53_mmap.c -@@ -216,6 +216,18 @@ static int b53_mmap_write64(struct b53_d - return 0; - } - -+static int b53_mmap_phy_read16(struct b53_device *dev, int addr, int reg, -+ u16 *value) -+{ -+ return -EIO; -+} -+ -+static int b53_mmap_phy_write16(struct b53_device *dev, int addr, int reg, -+ u16 value) -+{ -+ return -EIO; -+} -+ - static const struct b53_io_ops b53_mmap_ops = { - .read8 = b53_mmap_read8, - .read16 = b53_mmap_read16, -@@ -227,6 +239,8 @@ static const struct b53_io_ops b53_mmap_ - .write32 = b53_mmap_write32, - .write48 = b53_mmap_write48, - .write64 = b53_mmap_write64, -+ .phy_read16 = b53_mmap_phy_read16, -+ .phy_write16 = b53_mmap_phy_write16, - }; - - static int b53_mmap_probe_of(struct platform_device *pdev, -- 2.30.2