From patchwork Sun May 8 18:53:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12842529 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 CA4A6C433F5 for ; Sun, 8 May 2022 19:01:50 +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=XWSDW6W4cDsRcaaDp1eMiRovNskkD+0KlDTWRhq+PNI=; b=PJJdJteXr2mWdm cWL05jcGN/eqpzpHMYjh15i9U7H6mhyRUHAM4BW2+JDJPMeYQM/BELQSJNVpV1N+lTR6sqQQ/q7bA SlgrL5cnNTkb5lzmpaQwg0v7+j6LtDFxc6Z9P1LQZqkEuFLgh9bs8+497QAS57pgKQdH+lvEKUwfe Pd9u9yiIkVoLLrl23wnPet87LE7Fy5m9wiemq1604LuOm/X7nKGE+Lgh8XjONB84mXjtJncZ5bMGW 8VxqrdIzZsfn5Z3GwlOBNKlJvqjDRgYIeIi/bMilnv+eWawdtCp/+Ik5bQ/BAI3crsH1ApZIMjsUv xaB0JgnSt0lM5ZUpBpAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnm8L-00AyRe-Qi; Sun, 08 May 2022 18:59:59 +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 1nnm2b-00Avyx-8H for linux-arm-kernel@lists.infradead.org; Sun, 08 May 2022 18:54:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mPqoa3BMP0M3SLz6+9dWcaF4UnxxkgAFRPvB81UH52yQktf8HzJhyXhZLZ2f3sMGHX+uE6+9xJfTRtPyyz8WMdBIlbJ+nS8DRxn31RKMFLqD/+DsPQTST6bON51wN/HJ1rmnnBqdO3G9YKDHHmSNwFFUmRYT78gMrH5N0CQUKEPH9cxMXXDXmuy7B0CcMxGqKZayogql1RjMvIIros9hx7Ui021D30HeaZCx9Bcke2Q0NrsnilmqKQJ1Rl6ibP/h65ThMlAPH+9JReXpPzn5U7kr8mbrvATLL94UXfH4sTkaseSWcSK12muZPz4Nmz5Ug9Rcqn/aaETtD+Tit5pakA== 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=hR6KyRqP3UGkGySX6vQxXEvYmEmEmfBf9oJhx5+YSio=; b=K46ywgbVLax84IzxdeavBPcNV0ZBrPlwXgFissd5hWwrshnBaP8rYhZ4yC/lnX2fQ2iWTzQ5NLbLpO0Hwc+EH0rcxJf8+iLC/QLqujKMwgJ223ff691PUeg61d2BhRUNnWol+oU1Cc1Kuvb0vMz+VujxceTCmZKC5an0fxkQJ4JLobwqwj8fqG4LjA+xJi2TKx1QiTUiJa3A/K8jtRVGjYZJ4nIxLJjoiL9n9dcPq1Que9MAyppvNTDUog+SRikmM9rLCX5PtxW0VpQCyvpVohXzJMG9pyWV8Y1RemldTxuG8/MiUvgPIXJcprEhwYfrupIK7qj8CRqTcUygcSAzRA== 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=hR6KyRqP3UGkGySX6vQxXEvYmEmEmfBf9oJhx5+YSio=; b=BrjDEO2iKmOndQ0ORDkWFlfXQxdWYNkCTH4+/Ain0iHWbogbTf0rAIZQYCJhzSVQJyV59Fqb/wa3ccd6EnU6hQYjhh3vIBMT4l5NQQ6t6XbVvt8Dkop6OGMUBCfcxwEUx3w/qfXD0m/TXcwpHBTrNVteYo7k55Et+dqHEPrzgfg= 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:58 +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:58 +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 13/16] net: mscc: ocelot: expose vcap_props structure Date: Sun, 8 May 2022 11:53:10 -0700 Message-Id: <20220508185313.2222956-14-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: 6d8095d0-13df-4621-c320-08da31241bd8 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: pCb4LD+HUyGunOFYiQC9vzi0cM5RIIPdSvFmXWGfjDbvMnEk4jXdzREMfG35QYAzDGbcUmqukeC4qFAHWnxt9WJlV2wC3XCAsvkbswmvCS3Ddspid8hFgQAXuCIEEcMcfXVMoGKWEgMUYndaGL+X+KnuuOmbCr8AC28Yi/Ddlbu+gO3fG36dwTFTrCZlL14H7maot3xGnr0Rp3sFbWvg8dz7ZOqVqOUT10DCe/r9y5ITFYcu/LJUmhKwSqP7dyVhzWBidJ0V4vUM9MJf4wq46CdmlJAr5FqrShAnI3IlwLp48Y4ZTwNXTOr3u/BrxN6EG0WFD8+nLNi4a8ko8YzjWnLIt+/+PcbIEEQOKX8qGblfSa43h7DHEVYwG67zWlkgViNLN7Wt2doTami9XgZJR1iuKusehz2BCBlY2Lh+u4FBe4pLbTe2kiLRgxF5nHB/OUM0cBj7xmmNUbz2NrwS5NvPy8XXL23rGvoSAInqYrZOCSQ0vLpByYsYo7nIbBK+OuPiT1CkIBWMVvDgYQOHTHyzqMlJogXOJQX58X0E0UW9JZTfJMQf/4obXLEt1E6lrOjSknU994G45e0GTBAwb9xslRXeOfBTbhwzqNZ8iF6YqpzEfWXkXpX5zTY7Yg7GfPaa4hA8521vi+WVcmwP/Ci8DSSWh7kfxQiKI7W3gGmTkYfsw4C0kTK6TFMl5hjKi58iJpu+UEm7ootQso+psQ== 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)(396003)(39840400004)(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: 9IXnJVxctbh6lFNGUX3Jwb8uB6nsBGXA5Vh+y/r/d7QGuBrt+SdciGthyCpQEJysiIhhm+EwG3ktl+1TPfhMvYU3l/ykx5e4ygHcrKod8sJDpp7De9pJ9yulwncNBgkT5M3fJulGQwVjUqqqJr1l5Kkf4tzDZZ/HJK6PFMRYISImvWtm8Dxicj1MvpdsSCcxs0I+PlCQdatoX7fj0ZcTpEZsFofbFbZy8WBhCsU5SuaTO+F7O8ybWj7MBpOskmbIAcNHcHX6cqvw9HYTADTLKuFEq9BMoh+zsGQJWqUaSI77dvbKv74rkvFM59CfVHdI7GjKcTeWt2zkAQoFyNtu28TTjP6thBitHwvsUMttY5N0c1hTWBB25kJhupVAyItvjU3V+4EKVeMF+T36atoXJEE/brHjIhbSmxCOQrPNz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FuFMgQcLt8LpmTSTpDbHzqE5Ti/5FB4w6g38tb28278DUqFG4pw9TGQZ/9+lEf3oMrSWRsgsAnCLALKkYB9PRU/TtBud0kom267s2shBVgIWrBktyxE7MMSrSc7WgwvYstMIXRF3YnlRtSftwQCWjeWDz14WZQLGwj6VgWmLvGXzlp1F5icZzeyU1nukCVTqKQFpsg/Uz1zuZwJCia6/y1FR0uchnoDd2ZXF1R9Ej1CWWRdpAgiMycDlarAnxRLp6bOA X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d8095d0-13df-4621-c320-08da31241bd8 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:58.4308 (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: dDmOmLV09ee6BpGc0XbcGCDekx0Zq/jmbuIxneAMU6MnzIl2PRQHbLXh8DGjbU/KqHmDGNaLBAlUveiR9mPq3R/qCgmVi2FsQLLWjNWpGcM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5672 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220508_115401_346128_DA27F611 X-CRM114-Status: GOOD ( 13.26 ) 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 vcap_props structure is common to other devices, specifically the VSC7512 chip that can only be controlled externally. Export this structure so it doesn't need to be recreated. Signed-off-by: Colin Foster --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 43 --------------------- drivers/net/ethernet/mscc/vsc7514_regs.c | 44 ++++++++++++++++++++++ include/soc/mscc/vsc7514_regs.h | 1 + 3 files changed, 45 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 7673ed76358b..6191bca7a9c4 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -161,49 +161,6 @@ static const struct ocelot_ops ocelot_ops = { .netdev_to_port = ocelot_netdev_to_port, }; -static struct vcap_props vsc7514_vcap_props[] = { - [VCAP_ES0] = { - .action_type_width = 0, - .action_table = { - [ES0_ACTION_TYPE_NORMAL] = { - .width = 73, /* HIT_STICKY not included */ - .count = 1, - }, - }, - .target = S0, - .keys = vsc7514_vcap_es0_keys, - .actions = vsc7514_vcap_es0_actions, - }, - [VCAP_IS1] = { - .action_type_width = 0, - .action_table = { - [IS1_ACTION_TYPE_NORMAL] = { - .width = 78, /* HIT_STICKY not included */ - .count = 4, - }, - }, - .target = S1, - .keys = vsc7514_vcap_is1_keys, - .actions = vsc7514_vcap_is1_actions, - }, - [VCAP_IS2] = { - .action_type_width = 1, - .action_table = { - [IS2_ACTION_TYPE_NORMAL] = { - .width = 49, - .count = 2 - }, - [IS2_ACTION_TYPE_SMAC_SIP] = { - .width = 6, - .count = 4 - }, - }, - .target = S2, - .keys = vsc7514_vcap_is2_keys, - .actions = vsc7514_vcap_is2_actions, - }, -}; - static struct ptp_clock_info ocelot_ptp_clock_info = { .owner = THIS_MODULE, .name = "ocelot ptp", diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c index 2b75753da4e2..d538b05306f8 100644 --- a/drivers/net/ethernet/mscc/vsc7514_regs.c +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c @@ -677,3 +677,47 @@ const struct vcap_field vsc7514_vcap_is2_actions[] = { [VCAP_IS2_ACT_HIT_CNT] = { 49, 32 }, }; EXPORT_SYMBOL(vsc7514_vcap_is2_actions); + +struct vcap_props vsc7514_vcap_props[] = { + [VCAP_ES0] = { + .action_type_width = 0, + .action_table = { + [ES0_ACTION_TYPE_NORMAL] = { + .width = 73, /* HIT_STICKY not included */ + .count = 1, + }, + }, + .target = S0, + .keys = vsc7514_vcap_es0_keys, + .actions = vsc7514_vcap_es0_actions, + }, + [VCAP_IS1] = { + .action_type_width = 0, + .action_table = { + [IS1_ACTION_TYPE_NORMAL] = { + .width = 78, /* HIT_STICKY not included */ + .count = 4, + }, + }, + .target = S1, + .keys = vsc7514_vcap_is1_keys, + .actions = vsc7514_vcap_is1_actions, + }, + [VCAP_IS2] = { + .action_type_width = 1, + .action_table = { + [IS2_ACTION_TYPE_NORMAL] = { + .width = 49, + .count = 2 + }, + [IS2_ACTION_TYPE_SMAC_SIP] = { + .width = 6, + .count = 4 + }, + }, + .target = S2, + .keys = vsc7514_vcap_is2_keys, + .actions = vsc7514_vcap_is2_actions, + }, +}; +EXPORT_SYMBOL(vsc7514_vcap_props); diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h index d2b5b6b86aff..a939849efd91 100644 --- a/include/soc/mscc/vsc7514_regs.h +++ b/include/soc/mscc/vsc7514_regs.h @@ -12,6 +12,7 @@ #include extern const struct ocelot_stat_layout vsc7514_stats_layout[]; +extern struct vcap_props vsc7514_vcap_props[]; extern const struct reg_field vsc7514_regfields[REGFIELD_MAX];