Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2666207rwb; Sat, 8 Oct 2022 11:55:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Se7UPpdn5Lc/UjA/uEer7HdpfoidmsSYG2y2oFiRJoGUHrJPBN+fBgpDBJcAg8rGIvEI+ X-Received: by 2002:a05:6402:1761:b0:455:37bb:93c3 with SMTP id da1-20020a056402176100b0045537bb93c3mr9740405edb.403.1665255308587; Sat, 08 Oct 2022 11:55:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1665255308; cv=pass; d=google.com; s=arc-20160816; b=L4qL5kB4szY34HPkn6LyuXkbUvib9cRyoJTnsSsF27gCtn5mg/WiSBgl43kNabI+65 rgDI4XjGk9+zBQfM/ajE0hmRnnxpbSgJWZFD6aAG7Ewr6Vyz9vIaa59f4dVsvqcxuCS4 by3Qnxg2Xb7cSFuNaLiOr+oUyxqP05IAAGNaAs6BFHKBc0RFSkW9u38VfQXoDgGqx+W6 2Mo//kcNcBXQkIKyHZhkox+jm3IpCObX9xGmdCY6cul1R7R8WyvPOefPcGCN0mZ0ph2u BKOtwSl81lQWG/aV6SUfiLIrteVlqnKrHJ+3amgBLMa2DiFViMmcKhNV6HZASVsk8x/M Dm1A== 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=9WMNRm7MJre1ZENaAT9rfjXZ7N/EsBrIby4woWSQ8hQ=; b=je43kyqoVSdN3+hy0VJY1ZiAeD5adNqgbg+9aPm/4K/4C7n89eMoXI/07HMGSscPTB SuORhsLAVCk29uamfv6SmqKkNip/QVaTu39mwmE5o1XyC28gVrgvRepzzJTDikMmgdY/ Xr/Am9/w2Mk6pZFdYLbBA838mZD7w19aWUpoY4A8vjRoBG+0OeXNnJb2Js9W7M2BsqER hpOKi46A2CVo/vq8X6whIHtjbbOqZIXLNVK4MOp8fuBGM7VoOJBTqEn3IJqkD7OK74R9 JRSXFtsTxxtrJ0kUbwy6S6/WS0MTlZ8KN9wUazcaEzBfcqW/3dsQbjLJA8ckEhbRIIP4 1lJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=ifzc+RoB; 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 hr29-20020a1709073f9d00b0077bbac643c7si6794267ejc.879.2022.10.08.11.54.41; Sat, 08 Oct 2022 11:55:08 -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=ifzc+RoB; 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 S229886AbiJHSwb (ORCPT + 99 others); Sat, 8 Oct 2022 14:52:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiJHSwL (ORCPT ); Sat, 8 Oct 2022 14:52:11 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2118.outbound.protection.outlook.com [40.107.94.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A19A93F1DA; Sat, 8 Oct 2022 11:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F20tlcYgvgXFrydMvrpff+o/fkHXSFA2hPJzszq4oiz59ldOQK8qSzMQ66ugwZAv4XejBecuLZr2tdtEW2jI5Vy+2bDTVHO+6aZ2koMSXMWdyMdwcm5jA92A0iGrXy+EuSa4RjonX9OB1tjBUXN2Fa/Y49lGYFpigVruerVoCvb8yOBG9S2r/GFfEQs2k2HR3sU1c8M/3Fr80g71GqvV5lt5bfjcPsA+P2LDy5UljKIVyyRo5MZJ+IiYWkpiVgwaXPHLZYgZ7yurgFRRnJGijLQOq2834uQ+Uy+g+ez3pwQvve0e2QH0sdutr4B/BMcNyNRF0nspny9n9gxruQ9xew== 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=9WMNRm7MJre1ZENaAT9rfjXZ7N/EsBrIby4woWSQ8hQ=; b=dDS2E1NvVM9My7PI52u2aTtKi1eJ2Z3JgpWlsjoSXZeUdSta1TYdogW4bp34dX1K+lWEBUEJmXyd3sMyKcUSPqVoPAEQyusOCwvJ4bjUcGzXKLVEeihm9OChQYJHhMK8G5iucZgTpaf0Ue4oBzvmUDjQQRkLl2LcDebyMTuehq9xuKBfKX8OoWztXI/2GDx0W9n7TF87NE+F08RSH6V5MfozCerLniJU2v/yLTel8T0FVLM6Icpm+V5ggG6GrsZ8PmpBaq5Ak5M4YhDwjrHS4tYdC75PdyhLdPqcuBIjKOsPqCaX0XixNPo/VjDBfxEKtM4suQeyWt85dwGMcfTrtQ== 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=9WMNRm7MJre1ZENaAT9rfjXZ7N/EsBrIby4woWSQ8hQ=; b=ifzc+RoBnyxt/rF2/X6F2pJwza0sScaG7O0CLJOMTUbkE3tF6VUeds4jYh+LX0vkzqbcXpqkTuhcJJW7hd1nMluHVOy+AiuKCmgW9WQwMwlZ17093cyQt+qbBeYcKofmGwh4hb1JukOMetE/ei/9mRhUwe8Pm/6l3Zd3rI5MThY= 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:05 +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:05 +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 02/17] net: mscc: ocelot: expose regfield definition to be used by other drivers Date: Sat, 8 Oct 2022 11:51:37 -0700 Message-Id: <20221008185152.2411007-3-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: b794e887-3c48-4a40-03fa-08daa95e3150 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sZ1XBsB2apiXIq3yLLF/VFzZsCKeueiqFrJI0U0SS9/b8KZ5QnBww/hnGkHToB5nCimgW+lpBN9zXCof2Nu6DFFMHKxqz76+5twmLDEd+8jWFGQGo83SQUGTHIRJ62KVGdYQ/7+WgLtTOIQuQDCgtSETRp9BvYZF1QFGQtEq0Jhu2Os16TPEoQirGKiZRrC+bnb32RGIFcyJOylF0FQ9pGerKpBxLpgJ4qQx2fObQ/qg7MJT1O47CkdcJGzOfU6rTWRXAnJjFbofLhHvSdVtk3+sJNyNc7q5n8eWrN93L1MRXH7We/pxTg8aEeyPo6Hb6qHUyl38fEwJvOxItgvalb4XypPrNZxlR8Om8297As29g92EZSFGuwhSSYwnqZKlhwtlGlyYlhquxq0oyAqANu2kykIcEJBYr+T3h+Leeh9nOx1uccYCXI6UuFqw/JkqRghEokmvLXW+kjnvfTYHiPfN4iI8sB+fEqB9OrvfMqPU6tWv4bFaC6RNRoJmWVO0kzXQv8u4VFnZp05XLp/a+LniJXyyhKJGFbpsULcC7eS9BfpwxgCEig2WNcRiHZbxMO8vAlWia6OBxGvymiieqqh4xE+YL/or3rHo8GKoBp0aqeAszcgpL7N6/ra05IUWEazmmw1uRJXiL0JxXhXiPYEPRmSP8AM50o33uj0B2elbwn1umAs20dpNZnPN/1NEFciy6Ch6QIuUc2GqryVBhFxZm7DSUMZjlTwMLrolqtBogVcGJ2bx2kNEisOfqhTQ 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)(30864003)(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?UqAMpe/9sj3iuJtyiqOGkH+fPeh4a+Ho6Dv5wt4ztOQxTwWQj8eKVxkda3br?= =?us-ascii?Q?W21QqX1Kx0+IVU79wcjh5AW83SUtpfrExvc+LW1vCO1ULdoDMxCWCGUCNI1j?= =?us-ascii?Q?OsOFrSGCnQwiC5RmPe7+xvvRXm2Fs0rTPZ6IFuurfrcAf4+bC0Y8JIFCHKct?= =?us-ascii?Q?N+yrszyB9SABpPyKNePIjg0OxP3pyKxAmRCHd7Pyh+PLhJCCFwJXx1Qxcy/D?= =?us-ascii?Q?E996RMwej/0+iR29LPeSNn2L+VsuE2+i9+LhLXIO74t8Wmojr1afZ2JJBLxk?= =?us-ascii?Q?ZI3n9kHS98VNZ3Z0yFTKJfysWj9F8nxSoBAxpHjRqIzJ0Jk8oskZdKKqwHX/?= =?us-ascii?Q?y5fRfat1/M7kjzrsrxjLeR4XC3EKk2ti7azeVNA6GRNyNy6i054BF+s3uFv5?= =?us-ascii?Q?7EuXPvtIYs1Ru1qOBf3RcKgp5+hMursg2MD9wF9ToA6GJzt26JkycYIqAdWs?= =?us-ascii?Q?t59fJBvtD5hqgB9e6kogr/ygHD8tz2O8wNbm6SCEWlICcJYnBSoRd3EtPX3B?= =?us-ascii?Q?9VdyJ/3Jl+jek19FH0Gd5dDG/FM4osIx+wYm6yxbzg1uPfL7Fs/VNci0XgL0?= =?us-ascii?Q?3Mc55zW+E43OFx5HQy9SZMzNxtJGZmTzWob2q2h4+/Gsl895uInoPt4iKASG?= =?us-ascii?Q?e4D+ro8bstJBlTTa0nx8P1Fy/I5EdakXEHd42rZCdDw+foMGytKb8wbacQ0o?= =?us-ascii?Q?Ul/3hiivQz6fO7SB8EBBSsTictFachiA9oN+Cnpj1J9QA6hoepcTBTMch5q2?= =?us-ascii?Q?7cl5K7pwyVDExcE17FRrzqFyKZscOuPgASgi1qczWFxF+FHKSpAsw9lzzr3l?= =?us-ascii?Q?traZ/k8GYJ5y7U5IBxnG/AiwCCWyOXSv/t3N3iHFNmC7icshkNgxoe6dQXIe?= =?us-ascii?Q?kEU+MVfrpdCB6VtVSGCOL09zLknT1aGl2Ha5mmsUd13bvglwEnRRTZhkdsrJ?= =?us-ascii?Q?5mUzCzBucsMsXoqL1Sv0Q/Gwjpxa+6izMP7pA9KnJOCjGsZS60PZ6yxlqJJq?= =?us-ascii?Q?0PkO8RuwiXZsVFAjpjVF5tDCgfdqIeV1oZpyxurARKsTqptjRMHrLhSipQy9?= =?us-ascii?Q?mhzt2fvWLJu6DioYhXgUqFL+clvP3El3RMqc4fauKSwH43Tm/c7siuqLemlI?= =?us-ascii?Q?Tm1ICMyLc8TqE1Y7yWAzvf/Mi6E8OfMQmVs1UkLlpfdj0uZOKb7CTXHOoKMY?= =?us-ascii?Q?k90vMHC1UXMYCx1biKaI3nNfNwAva9p74xdMwk5E4T5A0FwQhFVTjuDqdwqq?= =?us-ascii?Q?VPu7rc9JpYEk/fTqlE2KubOirj6wXfVylBdYFiDnLBdWexb+NPval6O3TNx8?= =?us-ascii?Q?cVV4lFJUQezeCylu/y+vbEIO9UIlX30QcWBXCCOroHpq/gY1yjo4BgtP8z9Y?= =?us-ascii?Q?Rof5TTjYH+UZ+QjyHCl/680fptPc17rBXWJS1uMGHnQcPGJBRLoi6o6s1+Vs?= =?us-ascii?Q?fcZWbrT1ITrSwDhLzg9YT7Y0Jy7Y5Qs+MzRK4YBfHs9ZVXLuKoEqFbB1YTMf?= =?us-ascii?Q?+WU6unJADBDwOEmPkKvRMK5pNYmpk1Om0ivuNYAeOd34Bl+yheLF/c3Hz4PW?= =?us-ascii?Q?RFvsHqyrPsxtCwZ2LXrscz5jeK9/uH18kpR8rQVoANTs2PFDNnX0jpfkii/L?= =?us-ascii?Q?Sg=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: b794e887-3c48-4a40-03fa-08daa95e3150 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:04.7256 (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: 6ePm5eOUDRjb+4tEXUX4lpM4qWY0qMG+fc1YlIPf8isq81i5rRFe+gVeqlmMGjnTiDmnPWvDGI8uGyhxY+CAQDLRZAhUYT8c/rSFrzTe9r8= 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, UPPERCASE_50_75 autolearn=no 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 ocelot_regfields struct is common between several different chips, some of which can only be controlled externally. Export this structure so it doesn't have to be duplicated in these other drivers. Rename the structure as well, to follow the conventions of other shared resources. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean --- v3-v4 * No changes v2 * Add Reviewed tag v1 from previous RFC: * Remove GCB_SOFT_RST_SWC_RST entry from the regfields struct - it isn't used. * Export the vsc7514_regfields symbol so it can be used as a module. --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 60 +--------------------- drivers/net/ethernet/mscc/vsc7514_regs.c | 59 +++++++++++++++++++++ include/soc/mscc/vsc7514_regs.h | 2 + 3 files changed, 62 insertions(+), 59 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index bac0ee9126f8..6d695375b14b 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -42,64 +42,6 @@ static const u32 *ocelot_regmap[TARGET_MAX] = { [DEV_GMII] = vsc7514_dev_gmii_regmap, }; -static const struct reg_field ocelot_regfields[REGFIELD_MAX] = { - [ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 11, 11), - [ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 10), - [ANA_ANEVENTS_MSTI_DROP] = REG_FIELD(ANA_ANEVENTS, 27, 27), - [ANA_ANEVENTS_ACLKILL] = REG_FIELD(ANA_ANEVENTS, 26, 26), - [ANA_ANEVENTS_ACLUSED] = REG_FIELD(ANA_ANEVENTS, 25, 25), - [ANA_ANEVENTS_AUTOAGE] = REG_FIELD(ANA_ANEVENTS, 24, 24), - [ANA_ANEVENTS_VS2TTL1] = REG_FIELD(ANA_ANEVENTS, 23, 23), - [ANA_ANEVENTS_STORM_DROP] = REG_FIELD(ANA_ANEVENTS, 22, 22), - [ANA_ANEVENTS_LEARN_DROP] = REG_FIELD(ANA_ANEVENTS, 21, 21), - [ANA_ANEVENTS_AGED_ENTRY] = REG_FIELD(ANA_ANEVENTS, 20, 20), - [ANA_ANEVENTS_CPU_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 19, 19), - [ANA_ANEVENTS_AUTO_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 18, 18), - [ANA_ANEVENTS_LEARN_REMOVE] = REG_FIELD(ANA_ANEVENTS, 17, 17), - [ANA_ANEVENTS_AUTO_LEARNED] = REG_FIELD(ANA_ANEVENTS, 16, 16), - [ANA_ANEVENTS_AUTO_MOVED] = REG_FIELD(ANA_ANEVENTS, 15, 15), - [ANA_ANEVENTS_DROPPED] = REG_FIELD(ANA_ANEVENTS, 14, 14), - [ANA_ANEVENTS_CLASSIFIED_DROP] = REG_FIELD(ANA_ANEVENTS, 13, 13), - [ANA_ANEVENTS_CLASSIFIED_COPY] = REG_FIELD(ANA_ANEVENTS, 12, 12), - [ANA_ANEVENTS_VLAN_DISCARD] = REG_FIELD(ANA_ANEVENTS, 11, 11), - [ANA_ANEVENTS_FWD_DISCARD] = REG_FIELD(ANA_ANEVENTS, 10, 10), - [ANA_ANEVENTS_MULTICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 9, 9), - [ANA_ANEVENTS_UNICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 8, 8), - [ANA_ANEVENTS_DEST_KNOWN] = REG_FIELD(ANA_ANEVENTS, 7, 7), - [ANA_ANEVENTS_BUCKET3_MATCH] = REG_FIELD(ANA_ANEVENTS, 6, 6), - [ANA_ANEVENTS_BUCKET2_MATCH] = REG_FIELD(ANA_ANEVENTS, 5, 5), - [ANA_ANEVENTS_BUCKET1_MATCH] = REG_FIELD(ANA_ANEVENTS, 4, 4), - [ANA_ANEVENTS_BUCKET0_MATCH] = REG_FIELD(ANA_ANEVENTS, 3, 3), - [ANA_ANEVENTS_CPU_OPERATION] = REG_FIELD(ANA_ANEVENTS, 2, 2), - [ANA_ANEVENTS_DMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 1, 1), - [ANA_ANEVENTS_SMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 0, 0), - [ANA_TABLES_MACACCESS_B_DOM] = REG_FIELD(ANA_TABLES_MACACCESS, 18, 18), - [ANA_TABLES_MACTINDX_BUCKET] = REG_FIELD(ANA_TABLES_MACTINDX, 10, 11), - [ANA_TABLES_MACTINDX_M_INDEX] = REG_FIELD(ANA_TABLES_MACTINDX, 0, 9), - [QSYS_TIMED_FRAME_ENTRY_TFRM_VLD] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 20, 20), - [QSYS_TIMED_FRAME_ENTRY_TFRM_FP] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 8, 19), - [QSYS_TIMED_FRAME_ENTRY_TFRM_PORTNO] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 4, 7), - [QSYS_TIMED_FRAME_ENTRY_TFRM_TM_SEL] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 1, 3), - [QSYS_TIMED_FRAME_ENTRY_TFRM_TM_T] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 0, 0), - [SYS_RESET_CFG_CORE_ENA] = REG_FIELD(SYS_RESET_CFG, 2, 2), - [SYS_RESET_CFG_MEM_ENA] = REG_FIELD(SYS_RESET_CFG, 1, 1), - [SYS_RESET_CFG_MEM_INIT] = REG_FIELD(SYS_RESET_CFG, 0, 0), - /* Replicated per number of ports (12), register size 4 per port */ - [QSYS_SWITCH_PORT_MODE_PORT_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 14, 14, 12, 4), - [QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 11, 13, 12, 4), - [QSYS_SWITCH_PORT_MODE_YEL_RSRVD] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 10, 10, 12, 4), - [QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 9, 9, 12, 4), - [QSYS_SWITCH_PORT_MODE_TX_PFC_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 1, 8, 12, 4), - [QSYS_SWITCH_PORT_MODE_TX_PFC_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 0, 0, 12, 4), - [SYS_PORT_MODE_DATA_WO_TS] = REG_FIELD_ID(SYS_PORT_MODE, 5, 6, 12, 4), - [SYS_PORT_MODE_INCL_INJ_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 3, 4, 12, 4), - [SYS_PORT_MODE_INCL_XTR_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 1, 2, 12, 4), - [SYS_PORT_MODE_INCL_HDR_ERR] = REG_FIELD_ID(SYS_PORT_MODE, 0, 0, 12, 4), - [SYS_PAUSE_CFG_PAUSE_START] = REG_FIELD_ID(SYS_PAUSE_CFG, 10, 18, 12, 4), - [SYS_PAUSE_CFG_PAUSE_STOP] = REG_FIELD_ID(SYS_PAUSE_CFG, 1, 9, 12, 4), - [SYS_PAUSE_CFG_PAUSE_ENA] = REG_FIELD_ID(SYS_PAUSE_CFG, 0, 1, 12, 4), -}; - static const struct ocelot_stat_layout ocelot_stats_layout[OCELOT_NUM_STATS] = { OCELOT_COMMON_STATS, }; @@ -142,7 +84,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) ocelot->num_mact_rows = 1024; ocelot->ops = ops; - ret = ocelot_regfields_init(ocelot, ocelot_regfields); + ret = ocelot_regfields_init(ocelot, vsc7514_regfields); if (ret) return ret; diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c index 9d2d3e13cacf..123175618251 100644 --- a/drivers/net/ethernet/mscc/vsc7514_regs.c +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c @@ -9,6 +9,65 @@ #include #include "ocelot.h" +const struct reg_field vsc7514_regfields[REGFIELD_MAX] = { + [ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 11, 11), + [ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 10), + [ANA_ANEVENTS_MSTI_DROP] = REG_FIELD(ANA_ANEVENTS, 27, 27), + [ANA_ANEVENTS_ACLKILL] = REG_FIELD(ANA_ANEVENTS, 26, 26), + [ANA_ANEVENTS_ACLUSED] = REG_FIELD(ANA_ANEVENTS, 25, 25), + [ANA_ANEVENTS_AUTOAGE] = REG_FIELD(ANA_ANEVENTS, 24, 24), + [ANA_ANEVENTS_VS2TTL1] = REG_FIELD(ANA_ANEVENTS, 23, 23), + [ANA_ANEVENTS_STORM_DROP] = REG_FIELD(ANA_ANEVENTS, 22, 22), + [ANA_ANEVENTS_LEARN_DROP] = REG_FIELD(ANA_ANEVENTS, 21, 21), + [ANA_ANEVENTS_AGED_ENTRY] = REG_FIELD(ANA_ANEVENTS, 20, 20), + [ANA_ANEVENTS_CPU_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 19, 19), + [ANA_ANEVENTS_AUTO_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 18, 18), + [ANA_ANEVENTS_LEARN_REMOVE] = REG_FIELD(ANA_ANEVENTS, 17, 17), + [ANA_ANEVENTS_AUTO_LEARNED] = REG_FIELD(ANA_ANEVENTS, 16, 16), + [ANA_ANEVENTS_AUTO_MOVED] = REG_FIELD(ANA_ANEVENTS, 15, 15), + [ANA_ANEVENTS_DROPPED] = REG_FIELD(ANA_ANEVENTS, 14, 14), + [ANA_ANEVENTS_CLASSIFIED_DROP] = REG_FIELD(ANA_ANEVENTS, 13, 13), + [ANA_ANEVENTS_CLASSIFIED_COPY] = REG_FIELD(ANA_ANEVENTS, 12, 12), + [ANA_ANEVENTS_VLAN_DISCARD] = REG_FIELD(ANA_ANEVENTS, 11, 11), + [ANA_ANEVENTS_FWD_DISCARD] = REG_FIELD(ANA_ANEVENTS, 10, 10), + [ANA_ANEVENTS_MULTICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 9, 9), + [ANA_ANEVENTS_UNICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 8, 8), + [ANA_ANEVENTS_DEST_KNOWN] = REG_FIELD(ANA_ANEVENTS, 7, 7), + [ANA_ANEVENTS_BUCKET3_MATCH] = REG_FIELD(ANA_ANEVENTS, 6, 6), + [ANA_ANEVENTS_BUCKET2_MATCH] = REG_FIELD(ANA_ANEVENTS, 5, 5), + [ANA_ANEVENTS_BUCKET1_MATCH] = REG_FIELD(ANA_ANEVENTS, 4, 4), + [ANA_ANEVENTS_BUCKET0_MATCH] = REG_FIELD(ANA_ANEVENTS, 3, 3), + [ANA_ANEVENTS_CPU_OPERATION] = REG_FIELD(ANA_ANEVENTS, 2, 2), + [ANA_ANEVENTS_DMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 1, 1), + [ANA_ANEVENTS_SMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 0, 0), + [ANA_TABLES_MACACCESS_B_DOM] = REG_FIELD(ANA_TABLES_MACACCESS, 18, 18), + [ANA_TABLES_MACTINDX_BUCKET] = REG_FIELD(ANA_TABLES_MACTINDX, 10, 11), + [ANA_TABLES_MACTINDX_M_INDEX] = REG_FIELD(ANA_TABLES_MACTINDX, 0, 9), + [QSYS_TIMED_FRAME_ENTRY_TFRM_VLD] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 20, 20), + [QSYS_TIMED_FRAME_ENTRY_TFRM_FP] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 8, 19), + [QSYS_TIMED_FRAME_ENTRY_TFRM_PORTNO] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 4, 7), + [QSYS_TIMED_FRAME_ENTRY_TFRM_TM_SEL] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 1, 3), + [QSYS_TIMED_FRAME_ENTRY_TFRM_TM_T] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 0, 0), + [SYS_RESET_CFG_CORE_ENA] = REG_FIELD(SYS_RESET_CFG, 2, 2), + [SYS_RESET_CFG_MEM_ENA] = REG_FIELD(SYS_RESET_CFG, 1, 1), + [SYS_RESET_CFG_MEM_INIT] = REG_FIELD(SYS_RESET_CFG, 0, 0), + /* Replicated per number of ports (12), register size 4 per port */ + [QSYS_SWITCH_PORT_MODE_PORT_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 14, 14, 12, 4), + [QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 11, 13, 12, 4), + [QSYS_SWITCH_PORT_MODE_YEL_RSRVD] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 10, 10, 12, 4), + [QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 9, 9, 12, 4), + [QSYS_SWITCH_PORT_MODE_TX_PFC_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 1, 8, 12, 4), + [QSYS_SWITCH_PORT_MODE_TX_PFC_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 0, 0, 12, 4), + [SYS_PORT_MODE_DATA_WO_TS] = REG_FIELD_ID(SYS_PORT_MODE, 5, 6, 12, 4), + [SYS_PORT_MODE_INCL_INJ_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 3, 4, 12, 4), + [SYS_PORT_MODE_INCL_XTR_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 1, 2, 12, 4), + [SYS_PORT_MODE_INCL_HDR_ERR] = REG_FIELD_ID(SYS_PORT_MODE, 0, 0, 12, 4), + [SYS_PAUSE_CFG_PAUSE_START] = REG_FIELD_ID(SYS_PAUSE_CFG, 10, 18, 12, 4), + [SYS_PAUSE_CFG_PAUSE_STOP] = REG_FIELD_ID(SYS_PAUSE_CFG, 1, 9, 12, 4), + [SYS_PAUSE_CFG_PAUSE_ENA] = REG_FIELD_ID(SYS_PAUSE_CFG, 0, 1, 12, 4), +}; +EXPORT_SYMBOL(vsc7514_regfields); + const u32 vsc7514_ana_regmap[] = { REG(ANA_ADVLEARN, 0x009000), REG(ANA_VLANMASK, 0x009004), diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h index ceee26c96959..9b40e7d00ec5 100644 --- a/include/soc/mscc/vsc7514_regs.h +++ b/include/soc/mscc/vsc7514_regs.h @@ -10,6 +10,8 @@ #include +extern const struct reg_field vsc7514_regfields[REGFIELD_MAX]; + extern const u32 vsc7514_ana_regmap[]; extern const u32 vsc7514_qs_regmap[]; extern const u32 vsc7514_qsys_regmap[]; -- 2.25.1