Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2666231rwb; Sat, 8 Oct 2022 11:55:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7MnvysglAlp1j2KcnfGzShb3SGJeZgJ127tWGLb9NwHpo0+3GmkQw6MNPS0xY7cbPuWZnR X-Received: by 2002:a17:907:b0b:b0:78d:8877:9f9e with SMTP id h11-20020a1709070b0b00b0078d88779f9emr5434396ejl.693.1665255310001; Sat, 08 Oct 2022 11:55:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1665255309; cv=pass; d=google.com; s=arc-20160816; b=ZBgRS0Pv3E3DQN0b7BnGvEKT1kFlHoGUkakZnAqS8ibKmh1A0R7qh0dnBIe0puSvqI DmrYRMclyrC6vUXqibdR+hPWTfB5P6T0C0rL9Z+wYTdSSgOLBBVw0YkMMUtfj3U1Yr+V PUPrOTobIdkW7GUrFdvZO/vYq4uhGpplPEZpyyzXqTEZPgyBxTVN2SfXFNg3iwKCIlp0 gDcC314VDbjdctM8AwfeW1qH1U/ttGhpQb8Fgz4c/Q7peGAtObagwoR+5V67Prljp1qH S+ftj+Y8vNogaUnv99vs6DGQD0uk9bzVJalXeioXaHH/Wl5RrLj2TQCHPJlFgVpS3dKp iNdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iLPe7KitnzSsKJljKokTTWMRgfsa7lKoZH9viJ3Y+vE=; b=I2EWRQ+JOtfq1uMAz2y/6sCBfyTPWrqfbAJWNZcd0QnYMCSoNEFeEMZ/i7sElmtSx1 bE6JF1jA8YcHpTWNcmZ3b5gzBnbOx2V90zZ9nuAxl6F/L+QN5TtBdVXVZKGBRjnQ6L4O O2pAc07NzM5byp7xuVFqgkinh6T9QsU98TFyAJa7Ct8js6XDqbuHfOUwM2o8cZ+R6g0Z iohyhmFlIESGOpqD7GBt7r+h3gVA7DwTVdKOkddN4+pT3yTZajuBUF1J14TJsU1iyISG /qhsDLt16low1QKoeJwd81p5doyMBwrTszaFzfSuspPTbJ/+dj4Ts3iddhTVXyLWBAkg NOVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=umdm32M2; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o15-20020a170906974f00b00782fd14c6e3si6850034ejy.87.2022.10.08.11.54.44; Sat, 08 Oct 2022 11:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=umdm32M2; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbiJHSwg (ORCPT + 99 others); Sat, 8 Oct 2022 14:52:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbiJHSwN (ORCPT ); Sat, 8 Oct 2022 14:52:13 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2102.outbound.protection.outlook.com [40.107.94.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D2AD3F1FD; Sat, 8 Oct 2022 11:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FLu22WJ0iLkBo8uF1CqpF/UCZRRVgHO9zvG9Dv4WgWoBDwYzJFj56BToHKUReIBPmHPAGjUag2kcA6Rjm+h7DEmDY96DE12amFealLNZP+wghij/wcXo9t+dpPggGhRWEhx1BvhZpt6CaczR5hBGYdvJFGkBZWLBKL0qsUb+KGqJhJ+e7LTxgpHeA5dYuB609s9qd7N1WfUyhKa/JNsNY39Avpys/NmwJNPZe0ykd85WGSwUD/zPMx+SVlmvmS8KKOwwIoO8DRWStOIGdDi3e05S8vrSdq/zGFqNtH5zPxYFZ1OFjP81QBWyQRT+nLQD3MXV9WZzAhZvj8+BK4xwMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iLPe7KitnzSsKJljKokTTWMRgfsa7lKoZH9viJ3Y+vE=; b=PKSDb5f54uJc08NB/PfE1KN7GaRG37SM9VmGQu/SznlmZRzm/z+CllmQVhUrLLkaBLf5QJNXgS16Y3AI3nHMuaJ9LFpow5IsqZogWP8REz93J/peWUgmapPGZZyw59vbbpHtSOxlyViZY4p+UTt7coluJYjV+eNZ40CvBsx9zOXdldUhQBapzKYj3OW0ZDTg80lkaDHXMmeLggyvT5TsKiEpN+9K3oHcWApEcocAY7eSqbO83nOzwCxgZJ0dLeoRzIL1bpDj9RGWXUZWxBcZ6NAwsMsZwAyHf+TpqJCOM5pRxFbPbpOpPPTex/DyR9aMm01Qq1TCMKg+FO9fXR6UGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iLPe7KitnzSsKJljKokTTWMRgfsa7lKoZH9viJ3Y+vE=; b=umdm32M222FZBRhDiKYCD7OW5LXOugDdNAY2qyQfMcuSvNDL2fp2+riopIs1GoOZXWq87k441EoIiG9QPdd9eWRfG32+PvGrkJgwheBvvizrmUAhw9ZOuRHvRMS1fz93ddlYsS6FPkFe5P9KWvW26LWFf+X9dvJtRiQONE7mRWQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by PH7PR10MB6129.namprd10.prod.outlook.com (2603:10b6:510:1f7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Sat, 8 Oct 2022 18:52:08 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f%7]) with mapi id 15.20.5676.028; Sat, 8 Oct 2022 18:52:07 +0000 From: Colin Foster To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Russell King , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Vivien Didelot , Andrew Lunn , Krzysztof Kozlowski , Rob Herring , Lee Jones , Vladimir Oltean Subject: [RFC v4 net-next 07/17] net: dsa: felix: add configurable device quirks Date: Sat, 8 Oct 2022 11:51:42 -0700 Message-Id: <20221008185152.2411007-8-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221008185152.2411007-1-colin.foster@in-advantage.com> References: <20221008185152.2411007-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0304.namprd03.prod.outlook.com (2603:10b6:303:dd::9) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|PH7PR10MB6129:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f308378-e427-43f4-4ca6-08daa95e32e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tlnZhB/UVzcc++vdSlZTanDGdvJObLx0OWrdfAn64wQeEhS0qmlKbkuHuSWr95Fnv4n74G9Qqlz6jGH1a6uwfQTLNaKhQiWrS0qaaJG/Mwfn5cwonApFEhKit5NdyR4tLVxuVId0fBllsjwS7N2oWoEh3OiohSyhkLQmBSo2Kklgc6cZNSvWcoB7qbDfVjmDh50ynfBMHpLbApIzgO/bhKfMrbvtKnGJXXZMVm03UhRRU6L8ZjAihEaMi+Yx0MIcbfc+Bv/UkRwa7PokyIjGt94nL7Fcz/ulKlQ3rSMxydGWUKw2q9+XRgNtbxcfbi5cBw8uNkO5JvJBZl2vZvXD7TqoiOpNiua9KMxSP+9x0iXAiYDzlLKfiNXTTzWuJTdyQH56v+Xwmj5Vnl6llPkVHbc/qXunhMc4PSqJ/8USqDkpkhLr32QxUHTHzB6mzHtm4rM9pB8Dl1vefHAnzvLoNWm+7BVOsWMlvsbONZiK8rdQGQE1xkw36nsxdfbjkYTggyjkvqhHRcXUbtgZwwq4ofy7jR25NKuCEwffZv8FYmlGuMWDvUvkhSfPEQxY8leLX+Ip/5RhKMe9HwKM6HkBjrW9N21kbLLGzIUkyft/wWynIJZbYWQXS1XGKQFwBqUWTiNMuF6cnRgCpAmTLPRHdEEqvtTTdEaYO693iLl+hhBy6hOKBb4aKMVIvvoe2m3otj39z7vuV7gPp12dmi9ZupFHE63OMHJP6nt4rRrdGc81RlYlh/cxuCalmcC73YAb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(39830400003)(376002)(366004)(136003)(396003)(451199015)(44832011)(186003)(6512007)(6666004)(26005)(6486002)(6506007)(2616005)(316002)(54906003)(38100700002)(38350700002)(52116002)(4326008)(86362001)(83380400001)(1076003)(478600001)(36756003)(7416002)(2906002)(41300700001)(8676002)(66476007)(8936002)(5660300002)(66946007)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UZsGjsfwQVWIxY3gugyL451+9HDB7bDC4sX5xVIcfQaGXJsnymTWIXhnU75P?= =?us-ascii?Q?qOVbcM+34Xy4rbp3WvkzARsJUHjC3eytTdvec8Ov3nOwX2lB75s47LSA88yB?= =?us-ascii?Q?ejj41kAtA5Ml9S8oP+zn+peWaw+q/am6sujBjXgO2IYwsrBJgSDSj5Lpwuqe?= =?us-ascii?Q?BGuNHfUK35uom5u1RsXSBX+MTyXuNNCT4iAmlIEZB1MzdDhar5Quo7eDRY6T?= =?us-ascii?Q?8vKcvMxp10AVPr0MZqCxhetTevldw0PDnCYyRaKrZ15vNUZnvvSIknxXWz9l?= =?us-ascii?Q?YWQauuqWtrJYq405QyRdV84m7oCcBUF5f+NdQffuRKtZkrgNasDvZoC5Q5Xi?= =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tQId94Q2rcVVPzetB/ijD?= =?us-ascii?Q?vMomTaTRL4HbR3wDPBLhkGssOqaH9V5ATxPy/hoKt0ObhI9hFVMRNkPX/8x4?= =?us-ascii?Q?0B/LWWhMHvJXCgNjW+8nKIEmOG9/LceDrLHZcNRHahB1eC/+kDJSwe/8ftrW?= =?us-ascii?Q?v7nAsYD/TJ0vO5zJMBcOf2cCI85BkJWkTZ0Rl5QnzVCZiKsCU4l3aN9tqzXF?= =?us-ascii?Q?s9TiYm2uU6clY7OZFKz+pTp1Tj6eVG3eyZcmhwaEk8IF0RZoHVHUWlrb8WIo?= =?us-ascii?Q?Cr7Czhe8k2Q0TKFPukXNqq50MeTjrU4Wz1uToLiq0frJ2ro8zEmNRJZaeT1N?= =?us-ascii?Q?wi/Y698qDwUN55vVnIPbbsNBR3DLmqoBWRafl0IJ2spRyjiaRUNzHVKlTX7R?= =?us-ascii?Q?QA=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f308378-e427-43f4-4ca6-08daa95e32e5 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2022 18:52:07.4129 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: haLqY14rNPKZnwTfB5obdM5ejdH16/GYeXoN9VdO7BWtdzf4LleJBDkhYl0NF8nxiV/1nOa/vlsFwXd/DDX0VKsZP3gDkoQWmNnyh6/cx+U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The define FELIX_MAC_QUIRKS was used directly in the felix.c shared driver. Other devices (VSC7512 for example) don't require the same quirks, so they need to be configured on a per-device basis. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean --- v2-v4 * No changes v1 from previous RFC: * No changes --- drivers/net/dsa/ocelot/felix.c | 7 +++++-- drivers/net/dsa/ocelot/felix.h | 1 + drivers/net/dsa/ocelot/felix_vsc9959.c | 1 + drivers/net/dsa/ocelot/seville_vsc9953.c | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index dd3a18cc89dd..d56f6f67f648 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1082,9 +1082,12 @@ static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port, phy_interface_t interface) { struct ocelot *ocelot = ds->priv; + struct felix *felix; + + felix = ocelot_to_felix(ocelot); ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface, - FELIX_MAC_QUIRKS); + felix->info->quirks); } static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, @@ -1099,7 +1102,7 @@ static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, ocelot_phylink_mac_link_up(ocelot, port, phydev, link_an_mode, interface, speed, duplex, tx_pause, rx_pause, - FELIX_MAC_QUIRKS); + felix->info->quirks); if (felix->info->port_sched_speed_set) felix->info->port_sched_speed_set(ocelot, port, speed); diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index c9c29999c336..e6b7021036c2 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -37,6 +37,7 @@ struct felix_info { u16 vcap_pol_base2; u16 vcap_pol_max2; const struct ptp_clock_info *ptp_caps; + unsigned long quirks; /* Some Ocelot switches are integrated into the SoC without the * extraction IRQ line connected to the ARM GIC. By enabling this diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 26a35ae322d1..8999c523c0be 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -2584,6 +2584,7 @@ static const struct felix_info felix_info_vsc9959 = { .num_mact_rows = 2048, .num_ports = VSC9959_NUM_PORTS, .num_tx_queues = OCELOT_NUM_TC, + .quirks = FELIX_MAC_QUIRKS, .quirk_no_xtr_irq = true, .ptp_caps = &vsc9959_ptp_caps, .mdio_bus_alloc = vsc9959_mdio_bus_alloc, diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c index 7af33b2c685d..3e2f988b2b40 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -1002,6 +1002,7 @@ static const struct felix_info seville_info_vsc9953 = { .vcap_pol_max = VSC9953_VCAP_POLICER_MAX, .vcap_pol_base2 = VSC9953_VCAP_POLICER_BASE2, .vcap_pol_max2 = VSC9953_VCAP_POLICER_MAX2, + .quirks = FELIX_MAC_QUIRKS, .num_mact_rows = 2048, .num_ports = VSC9953_NUM_PORTS, .num_tx_queues = OCELOT_NUM_TC, -- 2.25.1