From patchwork Sun May 8 18:53:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12842506 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D1E2C433F5 for ; Sun, 8 May 2022 18:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tfmeuriXh3tdf8OOCwUa2/FH0MoI3groZwyhpyknNOA=; b=lO0eAdXCtS56JZ eXvJCAc926Do94pvx/jNMZVrerE01tvJc10iL2P1EFP0zYOgDDa46CbfjibWoe4xfEJo5ojanSrHz 2VqtMn1A1AuAM9uwOAq3wPGOBqxIKxm5ci8q0T7MozncMjESJJ8ugMppZVIBvANjaoSVI0AqlGeHz UCrt96bA682UTcUWxKRGA8ghSk31sliaM47cRnbq04Ccf7ULqKTjdxDl8SU0w7uYKvmOSo0Y4M+sA UbIj6xNy+c/kw3CVvGe6jKUme3nj881tAh0QHwqV9c04vcLXOf7w3XCI+RfvkLiRBwJWkswbsihdL pJDcUaeeDJa3NFRCxK6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnm69-00AxcK-Vr; Sun, 08 May 2022 18:57:42 +0000 Received: from mail-co1nam11on2072d.outbound.protection.outlook.com ([2a01:111:f400:7eab::72d] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnm2V-00Avyx-6E for linux-arm-kernel@lists.infradead.org; Sun, 08 May 2022 18:53:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VzJsNqBDbwgfO9fjHlte6OAvYIdnbElhBmVIE+8Rh427IhcbIO9ogie2R9whGQrM730KY9L068jTbwDyc02cwhslgnqKtLFjmH+6xd/Y+3VzPylkOVDeQFkMKF8qRu7RiWKE/9mgeMJIKVYCRoRcTWWWkB61Tjy8BUzgcovBZXXTw8RSHN9Lxz93IfrUpxauNVShDP0MWLBoHUF/u86e64Pe4lua7a95o4NiVqbEfFZmHmUCvcKSxbrbn/gMxq8K5P34WfwXHyHAFWeJEbXfzGgmiti491TriNg7j7TwA6RV2nNjiAFr+Isx5i1IC23+VJ3ZZ4L6sbK1W8v1Kw6P9w== 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=gx6AZJnfc614Ow3stmxcAnCSyXe6NZrFhq+L/kh8pzI=; b=coMIbYo2Ptr3jXfxc1hqvhlRV0k+f6On7xSbOExSjRXI+ctF5+fzKVDKBnUnPvFaez0gv8xFBF+5x5fRJ10yEmW92irzHHsA1c3oQ0TiWYMyACZsY8gjTW/U2JzMgaEDsoRNYqqMZimdeRbIHewOslFRTDU+bYlxso36H48Vqlfg9XUuCyZ49orG459sGuIR1MnWbny9jKyw+Fjcv03EhNDY5PpzXO17JQcm+e9oo+ZwrxgSOXwxwIbuL9tgtnfv3cw+7ta7KTZIoLdVVkH1mgttEo74c/BG6wQ1uEf6+Hzmtl9jM128gsCiDQpEqsJ5LEI84H5/kOes2FvONe4p9g== 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=gx6AZJnfc614Ow3stmxcAnCSyXe6NZrFhq+L/kh8pzI=; b=nIUNiq5CiFfHrYjjDxnJQAFK7HOIoJDa2XoWsSJPLk4I9ANAHQh2b2F30ef3OpDnV9YwoG+2PoEnnVfhs0iCollUZ9/GepmPrBAYpzYZZoVdcRNizDUpn5EL1qGfg2GrTdLCrJdiQGkRccb1vWz5ANCyDNFRhY4grTvPBF+91Zs= 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 SJ0PR10MB5672.namprd10.prod.outlook.com (2603:10b6:a03:3ef::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.18; Sun, 8 May 2022 18:53:50 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::4581:787c:1a7a:873e]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::4581:787c:1a7a:873e%3]) with mapi id 15.20.5227.020; Sun, 8 May 2022 18:53:50 +0000 From: Colin Foster To: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org Cc: Terry Bowman , Wolfram Sang , Andy Shevchenko , Steen Hegelund , Lars Povlsen , Linus Walleij , Russell King , Heiner Kallweit , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Vivien Didelot , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [RFC v8 net-next 10/16] net: dsa: felix: add configurable device quirks Date: Sun, 8 May 2022 11:53:07 -0700 Message-Id: <20220508185313.2222956-11-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220508185313.2222956-1-colin.foster@in-advantage.com> References: <20220508185313.2222956-1-colin.foster@in-advantage.com> X-ClientProxiedBy: SJ0PR03CA0045.namprd03.prod.outlook.com (2603:10b6:a03:33e::20) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7357b10d-a843-488c-99ac-08da31241729 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5672:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jxqaJjfguqqM5JkPY9WZFFgMhQ38eUe4iaIaPcvC58C7CSemwOTUrCmeD046aJmgqO9aabFlP6QJFu2QM5ngHTCj/Nhg+zOay30apu+oPR6vz3G8DO2MYqHYmxMbyaJUvZWBYbb71PpwXgKx6cFHZiv2xoSgST5iZW85banaXy/CLI5KbUXvofv/a+fd2Pz+XVtldvEL91p9ku5uVvEwSSLDeO4nKP2VReEKAz4Q7RC6EoYCkAizwiiuE3IA+Bd/iueFOq4KnloE6ZiZRch0pHUmgqs0oUnELOBLd7GqRlfw8bAe77cZ8OCmcDQSMTXtQrpUd07UBfFiloNzP+phT5CndfMji31Idx9xiQcpljBFO3ouEz0G3GIRwr4HAh2k3b2O1VSokCEQxn5i8vnNBiWCve5ixbZZWeiLjHQoT2oKd6bN+97mFQDABs1bNErOUqDNcfVxAXhCXgx4b4JoDvPAm641TGDJrgq4R1DP+LIzQAiVWKSmsvcMqtgLyhcaE2Wf+4NlMdUQa7OWjMYMbrmSgoZJ7W/OBinSdwjLIaU5zi24Y3Lz6htCUNRrf+2EsZmJB4dMzEs+Xqd3pTXqKwp/J0b5fIb6P+Y85ukf8+xCvKPHU4Ll05ID6M8ZH2ZFKhKEkGbKikgBwLeoMx4+tYBWOI0d2croEFpLZmjz9Tm6Yw+XWUSTGNMf9e8fxQBN 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:(13230001)(39830400003)(396003)(366004)(346002)(376002)(136003)(6506007)(6666004)(6512007)(2906002)(8676002)(7416002)(52116002)(8936002)(4326008)(36756003)(5660300002)(86362001)(44832011)(66556008)(66476007)(26005)(2616005)(66946007)(6486002)(508600001)(38350700002)(1076003)(38100700002)(54906003)(186003)(316002)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h3LbwlwUNskfxDVmV6mGLnZ8vx1I3nqXT8XZ1P9927aROYpWO9iNvkeb6Lw/M5gloTQ/7aEiUOdVXzLCXPavaatc5Zo+gtLALbJk5o7h4ZdYMTy+3IuuU048+ndAkJClCHlir0Z/GP3WDrRDpE/6ZGWmVnA1BoYlyBVNCpDdAfP3/z6eck/CxEDaiFcxH26Pr4QQMB4fu4iZPxvRWDjLFpvlrNEnwaC9ZcvVcCXsv/5EeIUpSW6C5zlSRzPyJ6Wropk8yLPtsy2rqa8JOBdhjp4NRcF7Zg71l6S/ADw2H4tqiPHnoBDLGQJmXLcdzL877lgZ/nLo3X4kzuAHdjpbHWQNwaqDOKYG4fsbL7i+bvNsEVJuMhfljv1v/QlnsHFw3aC+jB/bVQ35C8C1yjrKbAN4qG4aVBALRTEA4I9+Q1xM/C5Hlv/JcladeSubPvnsWMj2NG1o+xxFYs3HU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vMfpUoTJKaIqcL+10EeJB21tuCDEz9V8MCxusIlAxr+tzpjf+6hvN0Q7RqoSQ42xQkmjJ65fWF35Rk1MOehdIMTqvxIc18agdx1vTmnl/X+/NrrP9xRWOleJwANRnbLT91r0dIJhDCuVAdmA1JOtNIAHWEs8RwqH91KhoODDVMm8HYAAbVizYAT0QxzjzCc6LE8CNzR0kfTOVDNaDADnbBlAq4VOsFfXL5gsH0R8gyLW3jNlv0qC+i3OurHVw1IHLh X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7357b10d-a843-488c-99ac-08da31241729 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2022 18:53:50.5719 (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: mLU0/D6O6+sk4aHoBEhZsL2T1jNmOxB3+urWh/4/5qd73RY+PMts3PryLF+1mSjz1FyEoGm/48o45Wap6SviBwfuUXCRp4+TxndtCEswh7w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5672 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220508_115355_284743_5A64F629 X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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 33cb124ca912..d09408baaab7 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1023,9 +1023,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, @@ -1040,7 +1043,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 39faf1027965..3ecac79bbf09 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -32,6 +32,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 081871824eaf..95e165a12382 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -2225,6 +2225,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 48fd43a93364..e1400fadf064 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -1092,6 +1092,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,