From patchwork Tue Nov 8 08:23:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036010 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 8F421C433FE for ; Tue, 8 Nov 2022 08:23:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233747AbiKHIXw (ORCPT ); Tue, 8 Nov 2022 03:23:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiKHIXv (ORCPT ); Tue, 8 Nov 2022 03:23:51 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DE2CF014 for ; Tue, 8 Nov 2022 00:23:50 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 0829A84DF9; Tue, 8 Nov 2022 09:23:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895828; bh=wgb6XYrXtu1js3p2L4ykT61qERQS3CKBqRCMbvrkYXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z2sijH2NG+pgndT7No36ls73onlvp5rBuP1kYGwDBUaBwZR1wbeI83JRryZmu/cfJ nHAiQ9bqkjJFXd2vPz9jvOAu7+UZZ/2/lyQRSTaHQE4ZlptU2lBLhBsiU54IPUNpjr iCWXT14jg8cnr+h8XF525qucODxwDyICqj+EVk2UsVlsGmQjcSV3B+X35N3a+3Bz3u adGv7LU+AVxrQl6ZaTFNlfjXtStyPJQM8qQ5Y6x1ubHS6uAMSywbC6D1g/3TdbOKis IFo/UYPCs1ETxa4WnruK8pNeahJaY1UExaP7w9q05tY0+liElj/2hJuVxpQz6yA6V2 GHTNLt3q9SRRQ== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Matthias Schiffer , Lukasz Majewski Subject: [PATCH 1/9] net: dsa: allow switch drivers to override default slave PHY addresses Date: Tue, 8 Nov 2022 09:23:22 +0100 Message-Id: <20221108082330.2086671-2-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthias Schiffer Avoid having to define a PHY for every physical port when PHY addresses are fixed, but port index != PHY address. Signed-off-by: Matthias Schiffer Signed-off-by: Lukasz Majewski [Adjustments for newest kernel upstreaming] --- include/net/dsa.h | 1 + net/dsa/slave.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index ee369670e20e..210b0e215ac9 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -858,6 +858,7 @@ struct dsa_switch_ops { int (*port_setup)(struct dsa_switch *ds, int port); void (*port_teardown)(struct dsa_switch *ds, int port); + int (*get_phy_address)(struct dsa_switch *ds, int port); u32 (*get_phy_flags)(struct dsa_switch *ds, int port); /* diff --git a/net/dsa/slave.c b/net/dsa/slave.c index a9fde48cffd4..8bb1e8770846 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2273,7 +2273,7 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) struct device_node *port_dn = dp->dn; struct dsa_switch *ds = dp->ds; u32 phy_flags = 0; - int ret; + int ret, addr; dp->pl_config.dev = &slave_dev->dev; dp->pl_config.type = PHYLINK_NETDEV; @@ -2299,7 +2299,12 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) /* We could not connect to a designated PHY or SFP, so try to * use the switch internal MDIO bus instead */ - ret = dsa_slave_phy_connect(slave_dev, dp->index, phy_flags); + if (ds->ops->get_phy_address) + addr = ds->ops->get_phy_address(ds, dp->index); + else + addr = dp->index; + + ret = dsa_slave_phy_connect(slave_dev, addr, phy_flags); } if (ret) { netdev_err(slave_dev, "failed to connect to PHY: %pe\n", From patchwork Tue Nov 8 08:23:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036013 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 B73F3C4332F for ; Tue, 8 Nov 2022 08:23:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233650AbiKHIX4 (ORCPT ); Tue, 8 Nov 2022 03:23:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232641AbiKHIXv (ORCPT ); Tue, 8 Nov 2022 03:23:51 -0500 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9182F27B12 for ; Tue, 8 Nov 2022 00:23:50 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 64F3984EC7; Tue, 8 Nov 2022 09:23:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895828; bh=Gs6DnUydFRMZ2YE+Wn8GF/e+WivSI2G7EmFJMVghOvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UWAmEF66T99msKZCC0y4PaoPYYhpYEVzUCLkBhIkfuniSNZkkU0Z0RoCwpztQj7OQ Uo93GCCtvz1+K9ZryDR2E82ts0JpdmAGALK25Du4GS9pceXJFd9dUhojg2cMyN8Zlc QB1UZOnujrj47c4szx2WDwOAtHS7999DdcCnBh/85pbKpMn67BRXHWsGG9XG5EMdKH OsNI5JrgzBvIIbm74bS7CcAmt8O1oRXCMjh5QxXDbyJG3v3LVnXfZlFbqi+VDDT71n M6EHGPoMJUGcCBvUE+KjWN/pc9GzA+PaIK5i7ygey/4edmlXNOO0rHnTcazB9Jfmke EaryWVTucVWCw== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Matthias Schiffer Subject: [PATCH 2/9] net: dsa: mv88e6xxx: account for PHY base address offset in dual chip mode Date: Tue, 8 Nov 2022 09:23:23 +0100 Message-Id: <20221108082330.2086671-3-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthias Schiffer In dual chip mode (6250 family), not only global and port registers are shifted by sw_addr, but also the PHY addresses. Account for this in the IRQ mapping. Signed-off-by: Matthias Schiffer --- drivers/net/dsa/mv88e6xxx/chip.h | 1 + drivers/net/dsa/mv88e6xxx/global2.c | 2 +- drivers/net/dsa/mv88e6xxx/smi.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index e693154cf803..b03f279a673d 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -328,6 +328,7 @@ struct mv88e6xxx_chip { const struct mv88e6xxx_bus_ops *smi_ops; struct mii_bus *bus; int sw_addr; + unsigned int phy_base_addr; /* Handles automatic disabling and re-enabling of the PHY * polling unit. diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c index fa65ecd9cb85..fd6ba1fc6bef 100644 --- a/drivers/net/dsa/mv88e6xxx/global2.c +++ b/drivers/net/dsa/mv88e6xxx/global2.c @@ -1172,7 +1172,7 @@ int mv88e6xxx_g2_irq_mdio_setup(struct mv88e6xxx_chip *chip, err = irq; goto out; } - bus->irq[chip->info->phy_base_addr + phy] = irq; + bus->irq[chip->phy_base_addr + phy] = irq; } return 0; out: diff --git a/drivers/net/dsa/mv88e6xxx/smi.c b/drivers/net/dsa/mv88e6xxx/smi.c index a990271b7482..520e47b375b2 100644 --- a/drivers/net/dsa/mv88e6xxx/smi.c +++ b/drivers/net/dsa/mv88e6xxx/smi.c @@ -186,5 +186,9 @@ int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip, if (chip->smi_ops->init) return chip->smi_ops->init(chip); + chip->phy_base_addr = chip->info->phy_base_addr; + if (chip->info->dual_chip) + chip->phy_base_addr += sw_addr; + return 0; } From patchwork Tue Nov 8 08:23:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036014 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 626CEC433FE for ; Tue, 8 Nov 2022 08:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232654AbiKHIX6 (ORCPT ); Tue, 8 Nov 2022 03:23:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233274AbiKHIXv (ORCPT ); Tue, 8 Nov 2022 03:23:51 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D29427B1C for ; Tue, 8 Nov 2022 00:23:50 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C045A84F34; Tue, 8 Nov 2022 09:23:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895829; bh=+9d0loleSBLQE3udcwHEbOBMYujfJ70ZJ0Qtzvonwjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h0NUSEStZEFtCdG7zqwmp7rE4jSis1rGaN/VEMk5bwBoRjcgfAtH7XoAisYrwgDcp 0o6lt8fA/N77KvVQFalUHbh9gALISLyI2t9j7h+nYuXitCGJxMsIAxBaqBT1UdEIAL BnX4BkrZ5G+HeSqEbLMeDhHATUjPQS3fHrRK2ANOWp7/0pBur5nfSLdYsRQPbENGmm 9T29UM3+ORzhTrTmeaG/SozNdNtL0zRrQX6Bm02h2Ew0KL19iUtBaAfvLnzhNOipQn CHsXhGfrAgzPliS8n+HiUbWaN2gpjOI5iiUHgRcKOqTccH8kcGdvaHErvE6jgIoq2B Z8k9R7LK7c3IQ== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Matthias Schiffer Subject: [PATCH 3/9] net: dsa: mv88e6xxx: implement get_phy_address Date: Tue, 8 Nov 2022 09:23:24 +0100 Message-Id: <20221108082330.2086671-4-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthias Schiffer Avoid the need to specify a PHY for each physical port in the device tree when phy_base_addr is not 0 (6250 and 6341 families). This change should be backwards-compatible with existing device trees, as it only adds sensible defaults where explicit definitions were required before. Signed-off-by: Matthias Schiffer --- drivers/net/dsa/mv88e6xxx/chip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 2479be3a1e35..d51fd1966be9 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -6362,6 +6362,13 @@ static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, return chip->tag_protocol; } +static int mv88e6xxx_get_phy_address(struct dsa_switch *ds, int port) +{ + struct mv88e6xxx_chip *chip = ds->priv; + + return chip->phy_base_addr + port; +} + static int mv88e6xxx_change_tag_protocol(struct dsa_switch *ds, enum dsa_tag_protocol proto) { @@ -6887,6 +6894,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = { .phylink_mac_link_up = mv88e6xxx_mac_link_up, .get_strings = mv88e6xxx_get_strings, .get_ethtool_stats = mv88e6xxx_get_ethtool_stats, + .get_phy_address = mv88e6xxx_get_phy_address, .get_sset_count = mv88e6xxx_get_sset_count, .port_enable = mv88e6xxx_port_enable, .port_disable = mv88e6xxx_port_disable, From patchwork Tue Nov 8 08:23:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036012 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 1A195C43219 for ; Tue, 8 Nov 2022 08:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233544AbiKHIXx (ORCPT ); Tue, 8 Nov 2022 03:23:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233472AbiKHIXv (ORCPT ); Tue, 8 Nov 2022 03:23:51 -0500 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9A1827B20 for ; Tue, 8 Nov 2022 00:23:50 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 2A52084F84; Tue, 8 Nov 2022 09:23:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895829; bh=RLS+pi+x+DGj/QyOO6rDYnVOgDX2w+lzfFHtKBegPAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QYw57EY07IrBYVdPRxYbN4vyoZ49/GDUaLae9vnfr5HHLBSt1TxDllqlf4flejfuS 1O6nBEm0hmzdfQQ7egwAwTGXnttTCt2MPZARVz6+S6iEAATSAN0On40kT1Sl93T9+E rLXhy3WdE4nHaxxuPCPb7iBK/cRveuttCyYfkjNdw4KJ7Y/5CD/fo2GqvzoWUGq2bE Ia1imfPSfc+lbbq7kvjXwdervIAM0eK9q7iiUNyoBIik6IFn6rX5L0pnTgedsgawXV rB/HHiufUlIZw2wGkbLj9aNWFGuad9VYCAUYfVXxp/86/LNhTOnac66Yh71/yHnJiw cm463C4ley/4g== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Matthias Schiffer , Lukasz Majewski Subject: [PATCH 4/9] net: dsa: mv88e6xxx: add support for MV88E6020 switch Date: Tue, 8 Nov 2022 09:23:25 +0100 Message-Id: <20221108082330.2086671-5-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthias Schiffer A 6250 family switch with 5 internal PHYs and no PTP support. Signed-off-by: Matthias Schiffer Signed-off-by: Lukasz Majewski [Adjustments for newest kernel upstreaming] --- drivers/net/dsa/mv88e6xxx/chip.c | 20 ++++++++++++++++++++ drivers/net/dsa/mv88e6xxx/chip.h | 1 + drivers/net/dsa/mv88e6xxx/port.h | 1 + 3 files changed, 22 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index d51fd1966be9..cfb6df516e27 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -5527,6 +5527,26 @@ static const struct mv88e6xxx_ops mv88e6393x_ops = { }; static const struct mv88e6xxx_info mv88e6xxx_table[] = { + [MV88E6020] = { + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6020, + .family = MV88E6XXX_FAMILY_6250, + .name = "Marvell 88E6020", + .num_databases = 64, + .num_ports = 7, + .num_internal_phys = 5, + .max_vid = 4095, + .port_base_addr = 0x8, + .phy_base_addr = 0x0, + .global1_addr = 0xf, + .global2_addr = 0x7, + .age_time_coeff = 15000, + .g1_irqs = 9, + .g2_irqs = 5, + .atu_move_port_mask = 0xf, + .dual_chip = true, + .ops = &mv88e6250_ops, + }, + [MV88E6085] = { .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6085, .family = MV88E6XXX_FAMILY_6097, diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index b03f279a673d..c7cbbecd7fe1 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -54,6 +54,7 @@ enum mv88e6xxx_frame_mode { /* List of supported models */ enum mv88e6xxx_model { + MV88E6020, MV88E6085, MV88E6095, MV88E6097, diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h index cb04243f37c1..60a36a8bc131 100644 --- a/drivers/net/dsa/mv88e6xxx/port.h +++ b/drivers/net/dsa/mv88e6xxx/port.h @@ -111,6 +111,7 @@ /* Offset 0x03: Switch Identifier Register */ #define MV88E6XXX_PORT_SWITCH_ID 0x03 #define MV88E6XXX_PORT_SWITCH_ID_PROD_MASK 0xfff0 +#define MV88E6XXX_PORT_SWITCH_ID_PROD_6020 0x0200 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6085 0x04a0 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6095 0x0950 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6097 0x0990 From patchwork Tue Nov 8 08:23:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036018 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 B0259C4332F for ; Tue, 8 Nov 2022 08:24:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233764AbiKHIYI (ORCPT ); Tue, 8 Nov 2022 03:24:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233768AbiKHIXz (ORCPT ); Tue, 8 Nov 2022 03:23:55 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8F2E27B1C for ; Tue, 8 Nov 2022 00:23:52 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8300184F8B; Tue, 8 Nov 2022 09:23:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895829; bh=RfmabqkZO6fgaCGQFzgiP1gJlOe3btIFnwokS/xokkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bxMItxiduto+YvYS6eSRbw3jg/eUEErngylUADp+NPeJGC2Rc/JtOVHbRHTGNju/p cuFJ+lhNQB22DDaZYZsRyjEwYtvG3Yri3e3d8oTOE65YmCWJtigDqtWQkfeey8riBZ LuqBfSPaVUw6cHGG5pCdsnPHq0Xc+MVHFGWRq8mc2guIUQlWWNDI3NiR+R7StCq0pp gqKbVuW5cbr/KW9kNrj+MXYxAyjs1cNBBGBiIzKFp/d7LVu1kG8scnMwkrMHhkfoSP L8s08VbeYFeMT4WuMShNwY5ZCwhUqGWs5UUjVwzH57HMouED+Z7GTRRl6iuXkOm6JT AtrqkiNnBmCFw== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Lukasz Majewski Subject: [PATCH 5/9] net: dsa: mv88e6xxx: Add support for MV88E6071 switch Date: Tue, 8 Nov 2022 09:23:26 +0100 Message-Id: <20221108082330.2086671-6-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch provides support for MV88E6071 Marvell switch. Signed-off-by: Lukasz Majewski --- drivers/net/dsa/mv88e6xxx/chip.c | 21 +++++++++++++++++++++ drivers/net/dsa/mv88e6xxx/chip.h | 1 + drivers/net/dsa/mv88e6xxx/port.h | 1 + 3 files changed, 23 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index cfb6df516e27..09877a464665 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -5547,6 +5547,27 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .ops = &mv88e6250_ops, }, + [MV88E6071] = { + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6071, + .family = MV88E6XXX_FAMILY_6250, + .name = "Marvell 88E6071", + .num_databases = 64, + .num_ports = 7, + .num_internal_phys = 5, + .max_vid = 4095, + .port_base_addr = 0x08, + .phy_base_addr = 0x00, + .global1_addr = 0x0f, + .global2_addr = 0x07, + .age_time_coeff = 15000, + .g1_irqs = 9, + .g2_irqs = 5, + .atu_move_port_mask = 0xf, + .dual_chip = true, + .ptp_support = true, + .ops = &mv88e6250_ops, + }, + [MV88E6085] = { .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6085, .family = MV88E6XXX_FAMILY_6097, diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index c7cbbecd7fe1..2fcab41e03b7 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -55,6 +55,7 @@ enum mv88e6xxx_frame_mode { /* List of supported models */ enum mv88e6xxx_model { MV88E6020, + MV88E6071, MV88E6085, MV88E6095, MV88E6097, diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h index 60a36a8bc131..04e814a45597 100644 --- a/drivers/net/dsa/mv88e6xxx/port.h +++ b/drivers/net/dsa/mv88e6xxx/port.h @@ -112,6 +112,7 @@ #define MV88E6XXX_PORT_SWITCH_ID 0x03 #define MV88E6XXX_PORT_SWITCH_ID_PROD_MASK 0xfff0 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6020 0x0200 +#define MV88E6XXX_PORT_SWITCH_ID_PROD_6071 0x0710 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6085 0x04a0 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6095 0x0950 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6097 0x0990 From patchwork Tue Nov 8 08:23:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036016 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 0ECA3C43217 for ; Tue, 8 Nov 2022 08:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233772AbiKHIYD (ORCPT ); Tue, 8 Nov 2022 03:24:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233758AbiKHIXx (ORCPT ); Tue, 8 Nov 2022 03:23:53 -0500 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A62B327B11 for ; Tue, 8 Nov 2022 00:23:52 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id E155684FAC; Tue, 8 Nov 2022 09:23:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895830; bh=xzSyd5yI9MJDufr4RuTyWI2LqmKTCp4NW9Jyp55qKvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUjulGKvxGpg6mtRVCqZBZBJyf2WQ8TEc4wcdR3tbq7lP1h4jQowK8A7cZ4Vr/Gl0 yhnAubOB+9KxonivmeSdCDFY5kHjAPUltYxGG9JhR7FvcZTv+ysaG7Vma3NvcPDJQ4 hdwCZUZwLmdHweydvp4/51vvLYMnl1I/uXqfs5A3NkBhI5I4A07EtnG5a7hELTBvvv mvny38r0kZOaOth3xU6/xhAasSVOrvZgODGvtdTrVdvy2muub6WnNoKXxGyoea97mo SAYaC+Bg78V0tWQus+70m45ds0Hso6NI0EfCxPNKJZcp3VeEb5rVLVd9gG3dW1LOoG Xt3qtlGW/Eh3A== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Lukasz Majewski Subject: [PATCH 6/9] net: dsa: marvell: Provide per device information about max frame size Date: Tue, 8 Nov 2022 09:23:27 +0100 Message-Id: <20221108082330.2086671-7-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Different Marvell DSA switches support different size of max frame bytes to be sent. For example mv88e6185 supports max 1632B, which is now in-driver standard value. On the other hand - mv88e6071 supports 2048 bytes. As this value is internal and may be different for each switch IC new entry in struct mv88e6xxx_info has been added to store it. When the 'max_frame_size' is not defined (and hence zeroed by the kvzalloc()) the default of 1632 bytes is used. Signed-off-by: Lukasz Majewski --- drivers/net/dsa/mv88e6xxx/chip.c | 12 ++++++++++-- drivers/net/dsa/mv88e6xxx/chip.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 09877a464665..d90835b4c606 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3542,11 +3542,19 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port) static int mv88e6xxx_get_max_mtu(struct dsa_switch *ds, int port) { struct mv88e6xxx_chip *chip = ds->priv; + int max_frame_size; if (chip->info->ops->port_set_jumbo_size) return 10240 - VLAN_ETH_HLEN - EDSA_HLEN - ETH_FCS_LEN; - else if (chip->info->ops->set_max_frame_size) - return 1632 - VLAN_ETH_HLEN - EDSA_HLEN - ETH_FCS_LEN; + else if (chip->info->ops->set_max_frame_size) { + if (chip->info->max_frame_size) + max_frame_size = chip->info->max_frame_size; + else + max_frame_size = 1632; + + return max_frame_size - VLAN_ETH_HLEN - EDSA_HLEN - ETH_FCS_LEN; + } + return 1522 - VLAN_ETH_HLEN - EDSA_HLEN - ETH_FCS_LEN; } diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 2fcab41e03b7..6ec4010fd634 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -132,6 +132,7 @@ struct mv88e6xxx_info { unsigned int num_ports; unsigned int num_internal_phys; unsigned int num_gpio; + unsigned int max_frame_size; unsigned int max_vid; unsigned int max_sid; unsigned int port_base_addr; From patchwork Tue Nov 8 08:23:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036015 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 78D8CC4332F for ; Tue, 8 Nov 2022 08:24:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233771AbiKHIYB (ORCPT ); Tue, 8 Nov 2022 03:24:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233751AbiKHIXx (ORCPT ); Tue, 8 Nov 2022 03:23:53 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A839E27B12 for ; Tue, 8 Nov 2022 00:23:52 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 3FEE384FB5; Tue, 8 Nov 2022 09:23:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895830; bh=DBYzCogn/9wiUq7uYmdB4Lu0Fygut93Crnr7cr8sh/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qSSqAs18dMI5jvpo5UdsoCXuh1WOw+K5heyOX9VFGwXFTEYKYLLcB7j41eBwr4RXz LBlveKMeoQR1MD/6/nHic1ZETCjMxNusAkWa6CIH5/uesPsvi3Jr1Pe7h8fOu7g7Kh VkD5TMbazuTUMFOxH/yzO9gF3MYmepl9fLofHIB0+NqTWZ2dtEMPYRs4JaWl7ruvnL gcC/SdpzGfaA6Y1SRnBSSG1tf2rTgZXFL6XOqIQwa3MH3Qz/1CTltUDTGdKBFKcPHR TeyT3gRzaGryGidInhNGwT26jZEGAXA0cc3N1vzrElyokMhuNSM11drYTVjejlVSsH wYa2RCFgy8WNg== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Lukasz Majewski Subject: [PATCH 7/9] net: dsa: mv88e6071: Define max frame size (2048 bytes) Date: Tue, 8 Nov 2022 09:23:28 +0100 Message-Id: <20221108082330.2086671-8-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Accroding to the documentation - the mv88e6071 can support frame size up to 2048 bytes. Signed-off-by: Lukasz Majewski --- drivers/net/dsa/mv88e6xxx/chip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index d90835b4c606..e0224fc92ddf 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -5563,6 +5563,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .num_ports = 7, .num_internal_phys = 5, .max_vid = 4095, + .max_frame_size = 2048, .port_base_addr = 0x08, .phy_base_addr = 0x00, .global1_addr = 0x0f, From patchwork Tue Nov 8 08:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036019 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 9A911C433FE for ; Tue, 8 Nov 2022 08:24:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233790AbiKHIYG (ORCPT ); Tue, 8 Nov 2022 03:24:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233764AbiKHIXz (ORCPT ); Tue, 8 Nov 2022 03:23:55 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B391327B20 for ; Tue, 8 Nov 2022 00:23:52 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id A521884FD1; Tue, 8 Nov 2022 09:23:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895830; bh=hLXrhRTurbcSSZsbXU8locKJgnsGkDQF25HkMYQuNwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WSwFG18mGgU388Pq0u+O3gPcPD9YeG2pG2wKkaDyvQFzly39tHbeDPUtBsZhEyU8s uUHbQbyNqteCWbVcqHoZQC53z4Z+5grCSxEIn0p2RTMQ9mLPOeJqaIpq0Tzx1ZYfjj 3w69F/2VEKo9RL6shqQF14aBQu0FLOuWOLfJeKybNZMJYXl20u3u8H3F1NdhL3cPzr I1USqCtc8SkjvNe9k+Wu4yWVlYe2Bf5W8IcFeENVwzRkGHMMertWC2ibnnNe26hCuy NIDS198FL0D4CAhuFg7Z+vuAZ/rodlw++yfOvwPeRuxUTRM0d3lY2aF3jOq0XfiqKM WBRs5xlugiaRw== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Lukasz Majewski Subject: [PATCH 8/9] net: dsa: mv88e6071: Provide struct mv88e6xxx_ops Date: Tue, 8 Nov 2022 09:23:29 +0100 Message-Id: <20221108082330.2086671-9-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This structure is the same as the one for mv88e6250 and is supposed to ease further development of mv88e6071 (to put functions not present on the mv88e6250 device). Signed-off-by: Lukasz Majewski --- drivers/net/dsa/mv88e6xxx/chip.c | 43 ++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index e0224fc92ddf..1aba9d15a5e0 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -4961,6 +4961,45 @@ static const struct mv88e6xxx_ops mv88e6250_ops = { .phylink_get_caps = mv88e6250_phylink_get_caps, }; +static const struct mv88e6xxx_ops mv88e6071_ops = { + /* MV88E6XXX_FAMILY_6071 */ + .ieee_pri_map = mv88e6250_g1_ieee_pri_map, + .ip_pri_map = mv88e6085_g1_ip_pri_map, + .irl_init_all = mv88e6352_g2_irl_init_all, + .get_eeprom = mv88e6xxx_g2_get_eeprom16, + .set_eeprom = mv88e6xxx_g2_set_eeprom16, + .set_switch_mac = mv88e6xxx_g2_set_switch_mac, + .phy_read = mv88e6xxx_g2_smi_phy_read, + .phy_write = mv88e6xxx_g2_smi_phy_write, + .port_set_link = mv88e6xxx_port_set_link, + .port_sync_link = mv88e6xxx_port_sync_link, + .port_set_rgmii_delay = mv88e6352_port_set_rgmii_delay, + .port_set_speed_duplex = mv88e6250_port_set_speed_duplex, + .port_tag_remap = mv88e6095_port_tag_remap, + .port_set_frame_mode = mv88e6351_port_set_frame_mode, + .port_set_ucast_flood = mv88e6352_port_set_ucast_flood, + .port_set_mcast_flood = mv88e6352_port_set_mcast_flood, + .port_set_ether_type = mv88e6351_port_set_ether_type, + .port_egress_rate_limiting = mv88e6097_port_egress_rate_limiting, + .port_pause_limit = mv88e6097_port_pause_limit, + .port_disable_pri_override = mv88e6xxx_port_disable_pri_override, + .stats_snapshot = mv88e6320_g1_stats_snapshot, + .stats_set_histogram = mv88e6095_g1_stats_set_histogram, + .stats_get_sset_count = mv88e6250_stats_get_sset_count, + .stats_get_strings = mv88e6250_stats_get_strings, + .stats_get_stats = mv88e6250_stats_get_stats, + .set_cpu_port = mv88e6095_g1_set_cpu_port, + .set_egress_port = mv88e6095_g1_set_egress_port, + .watchdog_ops = &mv88e6250_watchdog_ops, + .mgmt_rsvd2cpu = mv88e6352_g2_mgmt_rsvd2cpu, + .pot_clear = mv88e6xxx_g2_pot_clear, + .reset = mv88e6250_g1_reset, + .vtu_getnext = mv88e6185_g1_vtu_getnext, + .vtu_loadpurge = mv88e6185_g1_vtu_loadpurge, + .avb_ops = &mv88e6352_avb_ops, + .ptp_ops = &mv88e6250_ptp_ops, +}; + static const struct mv88e6xxx_ops mv88e6290_ops = { /* MV88E6XXX_FAMILY_6390 */ .setup_errata = mv88e6390_setup_errata, @@ -5552,7 +5591,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .g2_irqs = 5, .atu_move_port_mask = 0xf, .dual_chip = true, - .ops = &mv88e6250_ops, + .ops = &mv88e6071_ops, }, [MV88E6071] = { @@ -5574,7 +5613,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .atu_move_port_mask = 0xf, .dual_chip = true, .ptp_support = true, - .ops = &mv88e6250_ops, + .ops = &mv88e6071_ops, }, [MV88E6085] = { From patchwork Tue Nov 8 08:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 13036017 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 81026C433FE for ; Tue, 8 Nov 2022 08:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233782AbiKHIYF (ORCPT ); Tue, 8 Nov 2022 03:24:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233766AbiKHIXz (ORCPT ); Tue, 8 Nov 2022 03:23:55 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1024D27B21 for ; Tue, 8 Nov 2022 00:23:53 -0800 (PST) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 0ECC785002; Tue, 8 Nov 2022 09:23:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667895831; bh=C6B+a2DadBo1YhlPDtYATKhq1EjEieIoxolsfqGeLgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ve2WcK/TsSX+91gcYxhxq7S9tkfZxe9T+dtU7rDKkumOdmgCyqYxM7Fu21krcOw71 ORyBVUyvHCpLX9gg5uWCuNS1cwzbTa0PdihkzDhZ8NkUaDGO7cRwBpYII3t2y3Ovqd smGZxy4Xj7fgH6GK2HTdTZ5+tLKsN7joaXw1GO+Ui1qk7R2WIhoj3cd31gC6B885rr g10MwKIb6F2Jhm5MDQ/olt5BRMpgvapZWws+p+AhN870x0js+hjAZwX55XHKVi0PVh wrXsyUKAtoi7hshnWjcRZJzbC49hyBFG3mX1MrwebJ9MS3KwhMnFdvlvv851LjDkHN HED9LhEZ2F3Mg== From: Lukasz Majewski To: Andrew Lunn , Vivien Didelot Cc: Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Lukasz Majewski Subject: [PATCH 9/9] net: dsa: mv88e6071: Set .set_max_frame_size callback Date: Tue, 8 Nov 2022 09:23:30 +0100 Message-Id: <20221108082330.2086671-10-lukma@denx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108082330.2086671-1-lukma@denx.de> References: <20221108082330.2086671-1-lukma@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The .set_max_frame_size is now set to the mv88e6185_g1_set_max_frame_size() function. The global switch control register (0x4 offset) used as well as the bit (10) are the same. The only difference is the misleading suffix (1632) as the mv88e6071/mv88e6020 supports 2048 bytes as a maximal size of the frame. Signed-off-by: Lukasz Majewski --- drivers/net/dsa/mv88e6xxx/chip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 1aba9d15a5e0..ce7723d1ffbe 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -4998,6 +4998,7 @@ static const struct mv88e6xxx_ops mv88e6071_ops = { .vtu_loadpurge = mv88e6185_g1_vtu_loadpurge, .avb_ops = &mv88e6352_avb_ops, .ptp_ops = &mv88e6250_ptp_ops, + .set_max_frame_size = mv88e6185_g1_set_max_frame_size, }; static const struct mv88e6xxx_ops mv88e6290_ops = {