From patchwork Sat Oct 8 18:51:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001840 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 E4163C433FE for ; Sat, 8 Oct 2022 18:52:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbiJHSwK (ORCPT ); Sat, 8 Oct 2022 14:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbiJHSwJ (ORCPT ); Sat, 8 Oct 2022 14:52:09 -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 DC54C3F1F5; Sat, 8 Oct 2022 11:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UTX5Hdk81YfrJ1l+9nxGy8hbPdx3N+ftckSBw4rq1X+txos5YkovDOhOYPQzdsNnunvc5ZVAhw3NCyjJf7HfRXVx/hot9xE5In3wmWCEZv32Z0oF2AEY7Lo6lsvN+EU4XwLml48+346siTb46AJCSwqZg4Q6L9ruQB1pWzPkTVYleSR3d0cNcvxY9iuK+anLz1Jg4U9YVoMumUhBVXPWgy//1G2ONBBwcQ3mgoWLPq52BYwGpl/JGOdhlK9MJbBeaycinQMFOlAoQ3iLV39B9kLqBSww9RVC9lPFIMhaXpaxr+TjvRwjlsG1kT3MCzd/q5kSA5Zcgc9K8uhltbTalA== 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=KabyPpxqHaUVuLst3aoqtRb3Z3BPXs73xlm3XX/dlW8=; b=Rz5ar7y8N7pftZZEMpQGQNnYgUOd1DXNdTExBU49v4hQjSD9OcYfRS5J60/faeZW9tUyfiTe2OFqP6Y7Wx/GtMbsDJLwm9QlqVJDLe0/jQ75VFciFDZ+E7Xuo5xTlF8OwRXlp3ynPwlwiMhVOuwjQRsx6eQKUc2gH+pSr7cXjr7J1tsnPCNdMR6kRFiy8JJW/Jq9qNhwe5lqilFxmSdWzrBcK+XY95a+xyhgA7u9monC+cF7ReCM+48/eR8JuwysEgpMj5lBrJ+6mXo2/bl4g0dpYveJ3ytqYUFSZwsYJDsAlZbffu7z3Gopi32gAw6zxQdIa1GE5lep4LSber4sEw== 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=KabyPpxqHaUVuLst3aoqtRb3Z3BPXs73xlm3XX/dlW8=; b=yFE44Na/HwPrJJLhivtqf4JNRYN6Wka4EaQj78LCvU/sPP0RrArTMeLkzJeIQlQ3cvLwsiPc6sLLoRUr6BUDBU0RqFxFSPTCdy+9ZCuUFcggyLSV1LCHAhQdOA0OuGcxdvoL9slNHHs3BfftDd6+9kF7SreuuuHbO/+R0Yg3YEI= 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:04 +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:04 +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 01/17] net: mscc: ocelot: expose ocelot wm functions Date: Sat, 8 Oct 2022 11:51:36 -0700 Message-Id: <20221008185152.2411007-2-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> 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: 45c85711-904d-4306-0bdf-08daa95e30d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OgvgygnLVnPTffv+PKytRFnQ0+cowmj+3yfmNCqfRGEt24IcP6/Ztol3l+c8FDdA3WF2/0+N/YuzNDnCWh50WVs0ZPdZmmqk+IzLl7g3X8AJW9Ta2Bx75bB4t2zmqvx7Nu8w0BmZUB21crxlIYhfja50M3KapSkQ5KBGbrgzgyJc68SJsnxGm8XGXQlqEf8Ow3wgAMy0IeD5pFQN1EBgLt2Gguq9/rMnDa+kTIUAXH1g4/dpq8ao1zmKQP7NbWj0IcN7Eyo//Cy10vhLHHGAvk0INyGzKcZ9IRMtsCt/ol0jjhGffh0ybMgODZWZPL3RW1tfhgp783B/5QRtS+95P3PgdrJ8xs3kUjpWyIZ4bGRjj6moOYOAfvaOL56PBCjtCNiKKZ/zbzbSZhEQkI3RuVG4QR1p37Vds5YUb3KmaDlGax5glO/U3CI7Ktrhufmo/2Hej7FYozEIo8ABzFPfIUTtq2Uhvgbg5/tyIaAAVuQWSA+ZfBZ7Bx7WJHKnVIuoTlIWHM75nKDMEkR4ianWwgCnF6giUXyV4+TAu5CKzfiY7824KdrCJXoJPDDS3i1tkON2jUXNK/MXzZqCQQ694TjKZu/89Bed+p7ZMCtk1P86bfj0/AL9i4YuWHua8d1nLRZjIJk2f3VB7VdNvAmeTS9f2mQBefRSkm2rWolXu08RANrwnbHdW89/mM7FilGoXc213OCv1aqNwdJXyHrNBt7EL5hywURShSwKgShTrVpizVFeB39BW0MrhIv+477vVb5ine0qDxiMA/9EOPm30w== 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: 8wvSoL+lXh7J99x5H9SHp5ugetJ/yAtT/mlaBleLdI2Ny0xSg9HK0dhDdb/UZ1NGF91y+ovB/4QO2ksX4F+LONT4ir5Iq1vCcJtghSHCt6z1wX49lPqIKcwApz7Pyx8nFhxOiidmcDUCl71XQk3+BrxG2g4kSP+PVbzOSzI8MDQYuDK0iTGylolEeWHaTD4EeELqWeOws+BFzXpRWZL9IZ225NqzO6kHl5Q1o++zqxBK8xcNpPigKFZj5verq9+za27VXH8M8JR0K5+iwtRGSXujNBtek43i8e+0E0iy7umpdYUS4pZecdB9ucv2DdFAux+3QrJ78Ns48XK6pvFVhgfvSwC4KBJ5JFwHniFV843y7fLi7OrHB9P6h9OwDYExR0VGBYpAS+Y6/7i4PGus4Vn52HsPn63YpIgo8EITK5Tx3fCBT1m1nwg8MkkggiZ87Qq8XFByTYtzOsy9NMHow5yX+sfFREzuCgIL/6YRQPZZV4a6x6k/9rU4FdWALrlQNuGQs269xxh4fVQDc0+32rL0wUihyP3JLPWg7p625kIwX4WZ52XfQ4i9xRcE4mFXCGJ7GE9t8xgNtrblobpFkKcItfAbBGvpIqLIsRTWiNjvOvkm6bHaaJzGBV5++7vC8CtEFVZmCJRj/I6ThzqDAePMqnXZHVSCuLwS1VMkwU4W2qtAeH6KFKGFwiv8uQuATCwUr5GdnJud5Ltj9YawewJjxRANt8xl7wKEUC7li+VBGxoD9dWSCd0rrZzMCKCv0qlbJS5xZlHMdiaIj7s1ik/eUG0n29nH/5AEk4O74mYMvcocJNG9uL2ZUy1toa01L2piVllZmkIagBDX9Ywao2acCTgOKvWc9K4GOpym5OCQUlW0arUycufo5rn3VaI8ZSYmgfggfRWIBaD5sr9luZ4KWyBsLGnZYFhfBowNSaEYc3A2Xn/EqPJWL+X2wCll/JYugqiItf6s44pbeYAxSRiiWCF8iUbaeYn5NuFiDPKVXjBnpqp7ft6C1f2XHkVbPKAybsCyd7ceurjeysR7HSuTJ1MeIugew8zHgkcdghWaBtXbg37pzN7gk+txE3EA/wUrBF7ic7OMQ7fTNIGiU0xzyS7FfGtbguaTXQ+qFxD547SHv7Z3zQwFPXci2S4p9ChWJQDiQHR3X4sdZ5d0zSlkrh5RatPM3VzU7KRWeAaPRCseVvj4dKE5CC8rb0afoTHQAM26qNp78ZO8SeBCKtGSSOn7hKtvT/2QB0laqjPc9V/g9ZfFkUsr1tH4yx+C5oanao+goW49bw4Dfa/oIlLsmabppm39Ngrj2qBrxRHA2D0yi4u+JyCz0F7igSPib/VfyPHiiJxSUn6vutzO8c3q10mTq7CQcI/abzElz7SJn5cknzK1rB302+JBlrja9qb2Skl3SgxDgEyy0E/oqHxB/OO/nU1olBqqonrPlOsnkRAqqveoBZIuuxLqdXGLwyXk17FRaf0ERHhmQ3BeNoNxqadRnndTgJ6AkZz1CCGy5n0x8+2Cy1lT3tkNyNIYMBnaXphDKLz7PlJvD+KvpfzeeT0A5Y4c5ggHcfDoXTvFI11zL4nlEWI11qQXMNRfwbyCfwZFZ4G/MlATVlztcGC89wpeV0B9GRR8Dloj00Q= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45c85711-904d-4306-0bdf-08daa95e30d4 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:03.9288 (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: 8ze5kIzNT78IQRPJjnmyEn74GPcalnpRiUNUtfSfLh4m/flPvXeLiG5EhZoEFH5x65H9Ut8+5CU7zMZyRN9gQfYJXlxjYFnNy/vIjBAq5fs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Expose ocelot_wm functions so they can be shared with other drivers. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean --- v1 - v4: * No changes since previous RFC --- drivers/net/ethernet/mscc/ocelot_devlink.c | 31 ++++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot_vsc7514.c | 28 ------------------- include/soc/mscc/ocelot.h | 5 ++++ 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_devlink.c b/drivers/net/ethernet/mscc/ocelot_devlink.c index b8737efd2a85..d9ea75a14f2f 100644 --- a/drivers/net/ethernet/mscc/ocelot_devlink.c +++ b/drivers/net/ethernet/mscc/ocelot_devlink.c @@ -487,6 +487,37 @@ static void ocelot_watermark_init(struct ocelot *ocelot) ocelot_setup_sharing_watermarks(ocelot); } +/* Watermark encode + * Bit 8: Unit; 0:1, 1:16 + * Bit 7-0: Value to be multiplied with unit + */ +u16 ocelot_wm_enc(u16 value) +{ + WARN_ON(value >= 16 * BIT(8)); + + if (value >= BIT(8)) + return BIT(8) | (value / 16); + + return value; +} +EXPORT_SYMBOL(ocelot_wm_enc); + +u16 ocelot_wm_dec(u16 wm) +{ + if (wm & BIT(8)) + return (wm & GENMASK(7, 0)) * 16; + + return wm; +} +EXPORT_SYMBOL(ocelot_wm_dec); + +void ocelot_wm_stat(u32 val, u32 *inuse, u32 *maxuse) +{ + *inuse = (val & GENMASK(23, 12)) >> 12; + *maxuse = val & GENMASK(11, 0); +} +EXPORT_SYMBOL(ocelot_wm_stat); + /* Pool size and type are fixed up at runtime. Keeping this structure to * look up the cell size multipliers. */ diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 6f22aea08a64..bac0ee9126f8 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -234,34 +234,6 @@ static int ocelot_reset(struct ocelot *ocelot) return regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1); } -/* Watermark encode - * Bit 8: Unit; 0:1, 1:16 - * Bit 7-0: Value to be multiplied with unit - */ -static u16 ocelot_wm_enc(u16 value) -{ - WARN_ON(value >= 16 * BIT(8)); - - if (value >= BIT(8)) - return BIT(8) | (value / 16); - - return value; -} - -static u16 ocelot_wm_dec(u16 wm) -{ - if (wm & BIT(8)) - return (wm & GENMASK(7, 0)) * 16; - - return wm; -} - -static void ocelot_wm_stat(u32 val, u32 *inuse, u32 *maxuse) -{ - *inuse = (val & GENMASK(23, 12)) >> 12; - *maxuse = val & GENMASK(11, 0); -} - static const struct ocelot_ops ocelot_ops = { .reset = ocelot_reset, .wm_enc = ocelot_wm_enc, diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 967ba30ea636..55bbd5319128 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -1145,6 +1145,11 @@ void ocelot_port_assign_dsa_8021q_cpu(struct ocelot *ocelot, int port, int cpu); void ocelot_port_unassign_dsa_8021q_cpu(struct ocelot *ocelot, int port); u32 ocelot_port_assigned_dsa_8021q_cpu_mask(struct ocelot *ocelot, int port); +/* Watermark interface */ +u16 ocelot_wm_enc(u16 value); +u16 ocelot_wm_dec(u16 wm); +void ocelot_wm_stat(u32 val, u32 *inuse, u32 *maxuse); + /* DSA callbacks */ void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data); void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data); From patchwork Sat Oct 8 18:51:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001844 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 B1AE3C433FE for ; Sat, 8 Oct 2022 18:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229805AbiJHSwQ (ORCPT ); Sat, 8 Oct 2022 14:52:16 -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> 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: UqAMpe/9sj3iuJtyiqOGkH+fPeh4a+Ho6Dv5wt4ztOQxTwWQj8eKVxkda3brW21QqX1Kx0+IVU79wcjh5AW83SUtpfrExvc+LW1vCO1ULdoDMxCWCGUCNI1jOsOFrSGCnQwiC5RmPe7+xvvRXm2Fs0rTPZ6IFuurfrcAf4+bC0Y8JIFCHKctN+yrszyB9SABpPyKNePIjg0OxP3pyKxAmRCHd7Pyh+PLhJCCFwJXx1Qxcy/DE996RMwej/0+iR29LPeSNn2L+VsuE2+i9+LhLXIO74t8Wmojr1afZ2JJBLxkZI3n9kHS98VNZ3Z0yFTKJfysWj9F8nxSoBAxpHjRqIzJ0Jk8oskZdKKqwHX/y5fRfat1/M7kjzrsrxjLeR4XC3EKk2ti7azeVNA6GRNyNy6i054BF+s3uFv57EuXPvtIYs1Ru1qOBf3RcKgp5+hMursg2MD9wF9ToA6GJzt26JkycYIqAdWst59fJBvtD5hqgB9e6kogr/ygHD8tz2O8wNbm6SCEWlICcJYnBSoRd3EtPX3B9VdyJ/3Jl+jek19FH0Gd5dDG/FM4osIx+wYm6yxbzg1uPfL7Fs/VNci0XgL03Mc55zW+E43OFx5HQy9SZMzNxtJGZmTzWob2q2h4+/Gsl895uInoPt4iKASGe4D+ro8bstJBlTTa0nx8P1Fy/I5EdakXEHd42rZCdDw+foMGytKb8wbacQ0oUl/3hiivQz6fO7SB8EBBSsTictFachiA9oN+Cnpj1J9QA6hoepcTBTMch5q27cl5K7pwyVDExcE17FRrzqFyKZscOuPgASgi1qczWFxF+FHKSpAsw9lzzr3ltraZ/k8GYJ5y7U5IBxnG/AiwCCWyOXSv/t3N3iHFNmC7icshkNgxoe6dQXIekEU+MVfrpdCB6VtVSGCOL09zLknT1aGl2Ha5mmsUd13bvglwEnRRTZhkdsrJ5mUzCzBucsMsXoqL1Sv0Q/Gwjpxa+6izMP7pA9KnJOCjGsZS60PZ6yxlqJJq0PkO8RuwiXZsVFAjpjVF5tDCgfdqIeV1oZpyxurARKsTqptjRMHrLhSipQy9mhzt2fvWLJu6DioYhXgUqFL+clvP3El3RMqc4fauKSwH43Tm/c7siuqLemlITm1ICMyLc8TqE1Y7yWAzvf/Mi6E8OfMQmVs1UkLlpfdj0uZOKb7CTXHOoKMYk90vMHC1UXMYCx1biKaI3nNfNwAva9p74xdMwk5E4T5A0FwQhFVTjuDqdwqqVPu7rc9JpYEk/fTqlE2KubOirj6wXfVylBdYFiDnLBdWexb+NPval6O3TNx8cVV4lFJUQezeCylu/y+vbEIO9UIlX30QcWBXCCOroHpq/gY1yjo4BgtP8z9YRof5TTjYH+UZ+QjyHCl/680fptPc17rBXWJS1uMGHnQcPGJBRLoi6o6s1+VsfcZWbrT1ITrSwDhLzg9YT7Y0Jy7Y5Qs+MzRK4YBfHs9ZVXLuKoEqFbB1YTMf+WU6unJADBDwOEmPkKvRMK5pNYmpk1Om0ivuNYAeOd34Bl+yheLF/c3Hz4PWRFvsHqyrPsxtCwZ2LXrscz5jeK9/uH18kpR8rQVoANTs2PFDNnX0jpfkii/LSg== 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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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[]; From patchwork Sat Oct 8 18:51:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001841 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 C8342C43217 for ; Sat, 8 Oct 2022 18:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbiJHSwL (ORCPT ); Sat, 8 Oct 2022 14:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbiJHSwK (ORCPT ); Sat, 8 Oct 2022 14:52:10 -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 57D423F1DA; Sat, 8 Oct 2022 11:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a45BY3daUdmjLhJLS7z9d3z4UOX8IL5rT9TlvrmPt3h6i/IlP3xRZLVPNStrGRpRHGbWWLaxzNc8J/ncDwJwiBdtD7gu+80z9vc8wYAmO6vcCRsPyNVNPrT873ZlA0pdSPEQl+TjdY3RjVJ647yMcxFKL+cow+wjiqEybP8VIXMUfStiUMZBjiqzxYz8Bgm9jT8oqRdYqeRkWxeJab+4jhfQ6KIpMRQbJUE1PZwWZd/nr3D/X+r425JV3zeJbxqU5Idyfu9JgkgXnF+lAILov3BloNR311VFsohURRN99Qg8+YIXL4UU2GsAAKIn+zfQ1ZKB+GWG3yUjMcCAkxu9xw== 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=OAo2yqRtU2ZEFfuhn1TmTcFTpyicruheyh3pV/alJbI=; b=kLGaFw66LC+Z0rReg98YRSZDvNI9usqDYODj8UC6ohntmlHg7XgIfEI9YCJHgJr/yGzg/f3DwYNr3ervxO6Gk4muq0SYS/gubzbfSBmsh90dR3J/NaIwNO0Fr9A/nGR7T8bIiW9WmIptyU7yrmBcTY0BSFaM5y3+Y/exeqiovY74AEamS/nxx3qvZo3jXnLQl/RXZIxqEgyR1eCOompZee9+dMWkU5sOK9PCT1MI4TIjPz/jeyP9GYuQAMMgxm27mc2HrIAoE8XGahjYs0ETlabBgRPnzchIfUjaTjz5h4Mrs7hM7aS1WR2WlVgxmIVxY22DBbkMCy/vwruyjW76kg== 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=OAo2yqRtU2ZEFfuhn1TmTcFTpyicruheyh3pV/alJbI=; b=CWElgqX69p9XJSjLfpOfdSd+yKtgA6UJ2IVwODH3R/2IHGT4k5Drn2tx8AnKPcb/GsRPyLN+NvahKvSEIJpLgfk+MuccceRbcROiretNSJdtB49TFxSd8qY8YNXkjHEUbb3NhgsV1Lu8Ztd9kfAe70rxlfHuSzMwfNgjFbW8jaI= 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 Subject: [RFC v4 net-next 03/17] net: mscc: ocelot: expose stats layout definition to be used by other drivers Date: Sat, 8 Oct 2022 11:51:38 -0700 Message-Id: <20221008185152.2411007-4-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> 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: 7a140f7d-ba5d-4ee0-1290-08daa95e31a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1EsWjjbLvnzfQmlyGFIGHWhRGbvGUi1PugvzVHVOwteKzVy2GqfpO0HQEGBIRXOTIKUCRSHPmkXFc6n6VMGBZ7cMq+CocnVXJq/4ymy7e6nWkSD1W2sPFszQUcjs9toz/q0gA/r4902tCvaztKGQwtvr8/V9E1Cy/ThHCA+gI3VI56FxaFNi+HGxgQozidaoAZnEpr/HxZFEtDFbso2d7EBMoGh+x+Qf+0Krg9sVWoNRucO0wS4rRCLYQNAD/p6fbAlYJlmRXPQ3ZM8uA+8QSPtGn85ZLyh8FfgeLtgZIbebjLOeHXL21Tmlm1yejgi+eRMWveFWuWDi3TNdqLyTZX4wf2/OCVDDWrMsWoel4T4KT4xk8iRzkGyz/A14IPm1VSQ9tKB7STKyCvONh/aBED3UM2DRUy9r3vKI5RrsCM9gjJs7xMluxSHB6pbUJFhpnwTVGUhX53YdWOj04YOHGcqtzSlCgUQPKYD2SpPhXPZa9j2I0gFGJMhz4AWZ0CWNOAMwzBks6fU8QNeBw2eQ/8BFHMXkGz4leO9Q9Ke09uk+hK11ZEIva5NZfPAl1x9NyU1gR+3jZqOGzCmTcOHvrO9sc+FNE1hy185rWNH9N91DWhJ242AL974yozqgq0196cNCctZiW1kI6TIkNZcMRrfEkYZVBVzK7zo59VCS4Xgr1Nmro5AAtscAUOAnqgK+X6ojXvE+jLgRLiPzYJByjSL0pYl/+AHxQrbDLyF7sUu9z4c8oAjoQcu5GcnCRPGTO7yhJk3e1yvTxbObphAnGw== 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: FTxLwquaytkF1TiFsdmUvOFJJSUdDbHCYYqiSRbCwIKaTbgIzHWNvTgNs0EPym5TOI5RE5ZB80YYWCAANfPlyEchpeEqsIO+WCDxCVZ6/V+hA8JpBxLuJE874lXMzxXSw4CpxoGSAkg3IFFQMYBaGdwu/RoiprkwaOw5cUNGWpwPW6O2XJQTIomiYONnTgJocELVsHYWBgkxm76INYPdPG0fqzoqX9wF83g683dtYvtXM8nc60vWD1XbLvemRLYntHiqjbo5bj4CaEqIVk+9dKFETQFjZH56cpIPqkB/+/CJQ+9Qgw5hF2O4ZUwYiOyiHo85SS9Fh9cUMmcLamRcK9Gc5zSEOLM22tX5UBgrL1oTBULRAa+u+mPdqS6M1/qiAjhkq0/j7BERUF3oQyHNhgA/+5+w7cZuqV2iJXYJTpVONAPKjOxiaYUfTacQt5nfw1BbBk3ufFtymGBKgZPN0d3XXGFXkxShvDX82i2XxNdaBqPNOGt+djbs2oSWjS0/ktZqTHoIpFHMHLsvZ6dR7w3tsjfzSfJlGaDPAoAewghGvon24Nh4nzunk6MQkBz2dE15hrHeLebRPv0uEM+BYxshEbjrX0WdwK2Ntx2j/hK887Rmhe7jH3y5jJ0B06TF2mvQgQ/bzeUyA0bElQVDfKbnaMGWlOVIf9SkXxwwWHI2mHfHzR+iKRVyPJUtTAp3kcjG9UvcpI6eQmaRwNdvFaLen9cT1W8zqkpJtBIf3T53yPaPXeK+cNKfz3neTgn5b76z9ddUvdpWWoGLevwEQ021injRsD2YKn9hbGuElsq2RQnDs3ElKp5C9j9ncFuYNvnJp7SIU3XOOkj7rJ2l4RcGQYpNnzRHRZ8e9PcIbcvw11bpFkajSe4mkQ1ibQ/FjM0qM4QWIoN3Zw4VRVJd4Ht0JLd9aT7IiWO2TTrlMp7+BehaELYUfXlPzTk6n4Drpg5WcCMy54Y2NrSu5pLgHGCOEAt+cQVWgaCsBvhY8uGZCopNvRbVqFu0MLMr9U1k6XyXH8eUUSi7G2+pTjUI+73x5isE5RXAimBGI9u6sss6N2cALeYWNIoh9DZJW8bCekGyQzsQgp5p8nizdtNkCHwp0F5W2iax7A/lLw57v3G75FxHWoJ3u5Tcz5XXl/y8hPT6GZH0GhRv3T33tS1V6nKJMSgxs5LuRcLMXfR2s19bgP0Ho21tFgyA/wCrDs9ojYBIQPYnIKrmkmXuu1mmmRJkr3zjrPnENuUtPg6paWE1l4HjHAGoWKOjA7n/xatdKSokoQeKKgQKJoQqoZCueKURGeRGrWci9MyDyAhDDm3+7/cai8JNbwINLowvF1EeHZVMi2xmnOs13rmvmwPsFQbVExJ2KIRztDBAk93l+W9u0QXjBjpeG7WtPdsDD9XUWg9s/+K6yD7blZrjxQsG2B+/L/Gy6/Kf4a6qIh2kisVEHpQbyPHugi7cotPPozsd8RhuNyc/OsCVGwCLVnZamtM4xG4Te5KtHkENhDUghE/NPiT7gbv5FDhXr5zDvdgAdNsycUQxTiQBrjSuUntyYivtVj+N7PmEwW+uA7Hk9tvQIdX4j/VdZUYCubFlCYAa08udgNdOK7+HmkCM8Hqbiw== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a140f7d-ba5d-4ee0-1290-08daa95e31a1 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:05.2568 (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: Kbuotqx5cWXaq45pA7HaVPk1DAsptSQA2BwWypiBEykDddhEdQiCZ/LiimOo9Y4lulK7bHbpKI8j2FB2hBFRq8G55Xg4x2dkYO+M9O7p5dM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The ocelot_stats_layout array 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 --- v2-v4 * No change v1 from previous RFC: * Utilize OCELOT_COMMON_STATS --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 6 +----- drivers/net/ethernet/mscc/vsc7514_regs.c | 5 +++++ include/soc/mscc/vsc7514_regs.h | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 6d695375b14b..4fb525f071ac 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -42,10 +42,6 @@ static const u32 *ocelot_regmap[TARGET_MAX] = { [DEV_GMII] = vsc7514_dev_gmii_regmap, }; -static const struct ocelot_stat_layout ocelot_stats_layout[OCELOT_NUM_STATS] = { - OCELOT_COMMON_STATS, -}; - static void ocelot_pll5_init(struct ocelot *ocelot) { /* Configure PLL5. This will need a proper CCF driver @@ -80,7 +76,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) int ret; ocelot->map = ocelot_regmap; - ocelot->stats_layout = ocelot_stats_layout; + ocelot->stats_layout = vsc7514_stats_layout; ocelot->num_mact_rows = 1024; ocelot->ops = ops; diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c index 123175618251..d665522e18c6 100644 --- a/drivers/net/ethernet/mscc/vsc7514_regs.c +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c @@ -9,6 +9,11 @@ #include #include "ocelot.h" +const struct ocelot_stat_layout vsc7514_stats_layout[OCELOT_NUM_STATS] = { + OCELOT_COMMON_STATS, +}; +EXPORT_SYMBOL(vsc7514_stats_layout); + 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), diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h index 9b40e7d00ec5..d2b5b6b86aff 100644 --- a/include/soc/mscc/vsc7514_regs.h +++ b/include/soc/mscc/vsc7514_regs.h @@ -8,8 +8,11 @@ #ifndef VSC7514_REGS_H #define VSC7514_REGS_H +#include #include +extern const struct ocelot_stat_layout vsc7514_stats_layout[]; + extern const struct reg_field vsc7514_regfields[REGFIELD_MAX]; extern const u32 vsc7514_ana_regmap[]; From patchwork Sat Oct 8 18:51:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001843 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 02AA7C4332F for ; Sat, 8 Oct 2022 18:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbiJHSwM (ORCPT ); Sat, 8 Oct 2022 14:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiJHSwK (ORCPT ); Sat, 8 Oct 2022 14:52:10 -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 205053F303; Sat, 8 Oct 2022 11:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=caQYjFfmJ3xG8sEAgcffQx2xvEdwcNMfssChTriB2/RgvJ/ZKyepyOSm2xaq0j61G04As9L5120bYzjwkn7uCR/Ul3HlG9q+dL2mcjf5rQXCeAj/GUsALXMnXW4GNR54hdtV7dDR7bRjqLuJDBB6qjhLrOgtamVdorDZLbJ8TV1leQFvGVB8SQA0XZZxaCYiFd06mEKBgbvrJEuffnQgtKxipdnNU8ZQtavsWLX7g3EJyQje/6qx+N3xq1v4fQRhnfhdqi8byiWgMUO9bZVwleCpeooJ9uVxCO4/1/+Q/hWRglAn0boSOnm2auZR568FU5YVSRNZccrSE/YHRmh3XQ== 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=V9X84gh9vCThnj4/kp+VyOwhl56grnNW+bYMKvfayrI=; b=OzoXrXhAUncAtsCMGOkUzd1Cba/57u2xLVZna9Fn+2y2apqFRale8iuc48HuWWBz6N3XY28dYAFVhyIbfMiLsQE5yBPzaTGlN+l+rislUOr16HYaHlmmwZaplhAwVUcP+mf8u3aoUlPFvuP/gfx1mY5ee+XoH/wdJAbB4guTwrmU35npH/MRktLXe9qYrmDenM3Hw4/W+ABKSWqafKgNRSgFmK0xtxcQGz6pVCkOcnhX7rLpv0qJH+eWAbNWFNuMKonybHOMqw9AuCv5OgGRD5zQOtu5ue7KBNbtk4xsxnXbvqMRQhv2Cme5B4NiNkcfKoHj2fidkAjmyZdjjvQp5g== 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=V9X84gh9vCThnj4/kp+VyOwhl56grnNW+bYMKvfayrI=; b=jO3ahK/hJTcbpMc+BUpzQHf/8v9idv6kZfZJYr0XTHOOTRtAuEI+lRXSY+OLZYwMmmriFkiEBaB4G+SO/Ii08HW5nrqdmxgMNlqqxXqzC2HNbar7Fd37TUC2qAJVMxsk80qjS0CECnz0W2jgZYgcAkDZD8Afoifg48U4vXVNFK0= 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:06 +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:06 +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 Subject: [RFC v4 net-next 04/17] net: mscc: ocelot: expose vcap_props structure Date: Sat, 8 Oct 2022 11:51:39 -0700 Message-Id: <20221008185152.2411007-5-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> 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: 1ec486f4-8b98-4e88-bec4-08daa95e31ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O/xpbww8oENWK4/ADep0oZOwqo5L/aFwEVMRRHK/ypS0YcIH12XZpR+mjl5V8JFaRc8QnOkLwVAcv6StwzMo5SQAduH+/pbyCYvaP14sawOrPk0aipbT+3DjI3T/rIR4pV7PQvQbow6bNfhSalS9WQf5aQAz/n0JUEmolKsV4+ofkaqICQELKjqei5QPv96u8taiX/4hel0zialuyNXZJwD7T7913a8al7m71GRFIrI7w9FsEwyIckpbawUYtjhO1AD0p67Ga9c+334bi/4B3A4+ew3qt9uL3fdXKrtRBK4jypxk4GY4N9GMfbdPVw7OIv/qrWf9PxwSvy8t0Z+a7CceCBd7nyXeZQFmH6xfZqmNOryefJ1mkxSyQXibN/Oh7xlPhELbZZoy5MHr7HbiuGQJEkVnFyvVr0i/7IX460Gaj/ezk9q9ZPF05xwduyGuFyNWrs4dya2wkEol7MP9LWjdQ4jwcNo7dUZV07XIEgYeUG/0x1XJdqtdwrs5ss1oJxWWg7oLO5QeBtTySz6tRWcBkh8aXdoRRFl49UXQcC159S/oa+FnLjUzSQUOy6tTlMrO8IpKX3X2dyEtbKIxNehHUrk0RTQZATE6U5UL5ZtbST6JBUuxpgBUfica6zrs8Jy3Jt5i4SnXGczgq0JwCUXLtKqbYRvPVwKGMz4+nxRJ8R9xy492/c3Ln2uZuNFg5ygF42FacVPCqY3PjAorYGYY1m9GSxkFeGkb+QyuNSBveBSQ5ys+UCMwxOVu4X15zBpNwhfVqCvqNcsnqyvdRg== 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: nsh9aT1vOr7aO26v4YiAkC1/7VrKaft2+5uNxmDr/qrCI8fDbtHLD+lxtf3MVjWx+/DcpQnEPWTGhTdOtOgSzz127cRkg2YCJwclZjYu8ruSzF+T7Kz4OoMNq8oQtW5DJ5SzhsA1b7iRKwHxk/YOAF7SxtRqHBV+1e/6O7JQetSNxSjULxLQhltqsiqV5zy2CViSZo4IVREB9hztAryYfZzwydrATZ+61a9+lmjv+LjU+uyzJxEwEAgwkscd/42AOstJyYhoWqe9fmCxv7J/iH7PKq2gsElXdK/NsJ67lApu9SVoRT6ojWdZgaeGuazBjaIFiOdEeQpkxqz0LmFYAXofMfMkS3KsSWp/ErIjVCdX5m4MDo/y1osZ5fc0J+oGKm6IsI3xnjRS7vcEb6Q/dFeC2OqTb0qval3BrlHdxJ29yePHXoUrMCnl1R123POcJv7c/nC4ccy27CvyWe/ZuXz5BDOd5HBgNH0Fr2VVjZImR5mMCfE7HhCGS/cgOZBU/sAZYZrHQE9Kq4e69HOhK9UDQ7iyZQYZWDk6qidYqNnIdRmXMnQjp+DMoa2sa/RCiwMpUoXIwQHwkfs42QSkgOX0cKaGve+1LTjQ0mdZS4EwdA8F4WfY4Zf811GAPfVI0Se+qQeNm3Sht1zjWpwZc2TpQJyc0LrRC1fdn/+irY5GtbZCBosAXBuiNM93cRaAbiXQI7OFXvirXEPVUq2hC2cRJv6zclCkUy3lkyKa4aUSQ+04qxZamqe1oNMLqf8aNNeFa58lqKkyq9GFtteVaMR8lPdCliTe/pKMPu06HMhtir+pdNIn0KgR4XyP8KrmlNrs6YVirTASLbZ+zSVPguhBaSAj5LQpRsj7x6AdBnHIPOsjbMCIowlCRIT/cVtXgJFWDc30jD/WgElDzWbA2NYHS7Gu3mu0lnBrIt4iwcRtacw4Y7g0hYpymjCsxMUgeQwJtME4lBZu0wXDbgTd5F8OLKQCI+YwywlmsctmQLFe6uWoFRBT2i+a4NtQhcJsJbOETGoacHMm/TZZeHZDzzUNuA4hbsIL/WIcGYeA/vQi+g+zT0Lgz/OW9G5gvW0grRlSs//z8k3hqezfv74oLMveh5ESJuoV7fl9XmA+ZDlktZkhbAs6FL/IMfpEzxGoFGD5UguqHsHaHc5rpuA79OOm/ThFqJ8SuaWs2+tbhcmng8Ifl+2lnvAx7EPyvuLW5oPvwODEIhlkAzN+OAYOlP/pK9tG66kjVzGVp09H1zOfW+IodVgld8w/JF5oV6qwZ3w22eJBOtaLMOMo9LHijKm/PZEoPZf3mmixTFF3XJJNN054VR9XeN8Ltdsv/DTprOkrNu6P1yl7b6i+GBitbFKNvf1twuT5QBkrpeLlvG53VzpPt59QRSEaznqKW/pXYsUNwWRVCEXYIBPsY/RvdquG8KJUsh2i+uRnf0mjPDHIwx7uRga7HMySdPrMcz7oQL+APsKdupq8+/ROcua/0tVrvoVa3qYTGdnjAQuPy38piGXULXT5Fqw93vjUZgZDrLTdzfyFCJDKZdmdRaN5iMGEVGlLJBUbty+4IG3QS6DwnqLnP12YHJBt7FSl5H8sXiheHMkHsc685dLdGhDpMw== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec486f4-8b98-4e88-bec4-08daa95e31ef 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:05.7568 (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: 54HsoY6HTUHEvx6+RMbPuAILE8DtcMj01watjroucQIvEl6QEdq70KBdy5FPGMSsWNl7GSS8FU9KjnHDs393GyO8P/0daZzqEwEQGRsrugo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 --- v1 - v4 from previous RFC: * No changes --- 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 4fb525f071ac..19e5486d1dbd 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -181,49 +181,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 d665522e18c6..c943da4dd1f1 100644 --- a/drivers/net/ethernet/mscc/vsc7514_regs.c +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c @@ -644,3 +644,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]; From patchwork Sat Oct 8 18:51:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001848 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 2B266C43217 for ; Sat, 8 Oct 2022 18:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiJHSwY (ORCPT ); Sat, 8 Oct 2022 14:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiJHSwM (ORCPT ); Sat, 8 Oct 2022 14:52:12 -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 773433F303; Sat, 8 Oct 2022 11:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ehff2GSoh1aXWRMV6RkMrpAWjge6wMfMp3lYrx9IjH16Dw4+Y6lPUVNzHUKAeZpHy+fR+ZCQCMgLoJoeLswToML9q8Fu1yBO+cqNdUu9KKghQD+OXK1bBl8s7N1Zgd5ZGTbiI+kAKwE7HvtVnkvOVuhUfPHHe0P2GiTC4B4eucfl4pShVeDSoxy332GWjn5fvfmns3WA7newF02eEbC4uIIJGTK32g9s5YTR0ChfgW8RuoVPeuVqC+0/bTI3PoSCWuLpq6+5ajCZ8B6/fRSemj6Wk1FQ0bUNlv5VI/YD2CJnESqYbvI0pawn2QBN/6upo/FX/SwxowMopQ2cBE6o0w== 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=QSsvqZQO8172AJLA2gQWNHd+JAH1FmOhkhhr+HGlpN4=; b=gICywi1nWD40nZ5GjwdnXFlTPZvmoSy1TgRUujOvT4O6CK4sYshDHlIBBH1ia785D2W0i3ZxImvDykfFpfnAhUWi9TksJXnCnniBR5geAEQzLrwE1pPVw09qmv/eqly0mD67p98ZMeelRCIYPazshXZMZtjd2R0jDRd3cpAU8y7DX1VgNEd/KqKb7KNT1Xv7D0t+LWVf1+3GLiQOxFBA3pVOAXavbZRjypAe45cCbTEpVGLh9dR+zlylsomC9p760VcG+rR5pEexKsGcPtzsh1AJkRaSIJ9MNO6NfuKOwv3CfTaqRETNrWUzCFwxDUWteZUflbcOa+aDilcCi+DqxA== 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=QSsvqZQO8172AJLA2gQWNHd+JAH1FmOhkhhr+HGlpN4=; b=F2gIpQ4kl3FzL4vs7YbJGldBrRwu//FJjfMI4f7TsJpOCoYv81W3ASG6oRT5gLZLyhKh0PRQVGnsBmHGQWw2yYyKZxhXsMcs7UAB+OpAta5UtYA0qq1rk5vRe6ORrqko4F3S/rQdIOg8rOgBo9Zhks+Xd/0Q+1jLjmYVPpgeRAU= 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:06 +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:06 +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 Subject: [RFC v4 net-next 05/17] net: mscc: ocelot: expose ocelot_reset routine Date: Sat, 8 Oct 2022 11:51:40 -0700 Message-Id: <20221008185152.2411007-6-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> 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: 55aae863-2e74-46ad-6af2-08daa95e323e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yo9N80e/hwacVFQ82Wftd7bpyU6qzCb/+7oN+6SfGhEAVzMSCePMgPyrNr4me1sdXUWI4rYrnHSqX60Ds9lgPPAsO9vfIUJvDwl0NWD5cKqNpFBsIfuoBA+ajnFoK4gyLsvciroJ1IDpRdpLBozFzGhpCnDiQawr/DeWjcfzDia+IgK4Id0KxBRrpic01ANhLE9bOioh4LBDvMMszy4+n5C6BLz1q3W/JBqyh2aSR6oaewYz9vZnreWf7ZS4LhXfax8QR7jdenm2D8gyNVAi+cBThSm2CAeUfTM/Rt9KVl9xS5dR79YEmslDDz/59fZlF/1iim9VIF/bhhax+WEbvRrxEW18LRJQIML81dFcgO+IErFehjzYggYVw7fAEOQOdL12I1xP/6OygFQfLnZed9OfNC+td8WFDWOD97S7u+3QTuWeMksu969BxORpDTNNeFC1MRv4BZ2AxXUbd/LFscxdm22HMHdACGDYoVbIUOcnZf1+sKOrY7e2uaeDZuPVRIcGOQ/ayTvQghphrZ268+3Q77HaSWh8GbpSAOo/0/KFLjzizwxj5RAIPaUZXh6AMdNmL6hscajhVVnCD7Az+HMQOiG7awlky+AbjICDBhNkwN9VNTuiPs/XsNQATFkPXnv4ePhcCiuwo0Uyog5hHV+wrJ/2JHIe475Xikdx9yF1M0TGLrUitD8wEazjU3ZO6kgbf4WtodOTJr+SnqKxJL3LcBc9TTdy/3nLy1h3fuFChzNTgz2B1gcA8uikmv/y 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: h69lWA8b6IT/eHqV5vdKnWkrYHXUVF1+NjTeV5gWPc3DVZNkxTnMZkb3fiTK90kZi1y2B/HqGrtG+oFCVRB4udrYlz9dqBFvPlll0DIAIUlMam++9Iq5px7va1/5TrbRNa6fnzhJ6QOYUx5i+4rUprgOn+KGQKP50ML7JWgbiP4nn1ogzPEzciuyB1Px+sz6fGwQXXLmK/AqwB6N05D5ur06E+Q6eINgNtxN366pVWBgqdkLFsLmyNd/sYotXsaXBLjy3oZWGCE/VoqTXBt2bJzL+sUjCLY23fvzxztzAkyMQxrvLVbOkHu4W2V++NkWHuG683Z8jHhy9soBlFSMmKSPU76AT5j9h+UlcoRB5f1B201xuSS3egCJ5ePYuOoMaDc5JjQ0pGpqCisM7RHOBb0Q5fb7SD9AYONiet22O5Po06r/FLiYwwGePxw5V3JWiQ48zlrUN2UFfAoyVxbnrSqci7n59UHvoUpXiCio3CdY5+gbS9bWUvc/TU5Zh+IAw5i7mchNRcF3TQsI11WZh3+z4Ey4WMXKREVo36OlgFsJFGPIPli7xsnwnLNbGwqIk2nsPMEk+CWCMge7j8J1YYXGwchqMOSk82zYju1liGndIIV7QluiCU+vXtvYT/YwBM7Z8EyEe0cx/ZjQ1/t3oKFzih2F4sslGXM+bPr/0KJ8+F/d5mLlE+K531Dbn7o7L49sIedmu9AXxJMSQp+vSUooomBzxfxKRLPByMQKTGDHHX/LSl/hXlTlBqAY/6BK0IBEjwhKjLQhQXDV3z1nLMbTJ1TveoMpOiB9Wf06pU195SESt6smUTiTcvf7GUy40b3OsQyqxM1jPtqMFkzs/5r2j7roQYmJgGhVqPuXA2Ay0yUxzOpfRv0UeNYM7gHXNSRZ2McZ0sIKc6cNwjnK1TENDZWbgi6PI/BGk0a5m2AKoT9bgxtYd1kJO/L+gjEd7j9E2ReaVrB94lQgirCmkiGj78AWhne661zqSOpUdhRWqlheViEmw4zmKrqYaSYHlg9+2lvx4nJpDhGjb1cu0OTZyaMsB0QrlSQtEojN+RQp8yptFGbz9qAxFH1i0JETMxwNDHgS1j29Yul08tcBelrqmf1f9MZQfKnAko7GFuzMVHFy3qeLyOjP6pFiKyjG+q2QD5b1ixB2ZZsHpFs/PXLh7/bIEcG3vytYLzkgyZfwxynA/63DJ6B3y5KrM+xBkBsay95K/7H3BzzL6V7yIWyL0Gr7Lf7SaPXccQlnFSItdU5O1PTUCIQaGvqBCfjG5B5Iw9sdWt40H4MmW79WrUgSVfVA091kuKGLCRo5pxSbgQMuS+1JC70bumixpDP4d0kriSVwb1O/2JDp88lGI5letcI3SwoMgumK2EDWbe32lPaHb0QEe4m0ZCqWDy7zZwX8RZbrFPtKqzjZ1peAkWoMEHpd/SPlGDBe559vgVNyzT9x+08Os0mZm5grjnp5OzXhCvIEFo+v9uvxkSBElR3Py3I6lZosBs1HnmiT+EdTNZKtxRNUZrj1LbjepKtsqf5shfTn/y4Mfo6cSZ4V+0AMvRa4uS6ym/cfHyhswIAEXIyQPwYv/irJCd4Kg7B4Vu9rS1PU/qYIwWZm6+mn3g== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55aae863-2e74-46ad-6af2-08daa95e323e 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:06.3348 (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: mdMSilP/UbPfAaREjV+jUhZyloPdxvmYllvZlHYxAfo6xYHpfoiZ9105wfQr/SHIkm+EoX6X1LWNlmUcRcDOUXlUg61f8AB6hXk2dYSys9g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Resetting the switch core is the same whether it is done internally or externally. Move this routine to the ocelot library so it can be used by other drivers. Signed-off-by: Colin Foster --- v3-v4 * No changes v2 * New patch --- drivers/net/ethernet/mscc/ocelot.c | 48 +++++++++++++++++++++- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 44 +------------------- include/soc/mscc/ocelot.h | 1 + 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 13b14110a060..432eca7dcb11 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -6,12 +6,16 @@ */ #include #include +#include #include #include "ocelot.h" #include "ocelot_vcap.h" -#define TABLE_UPDATE_SLEEP_US 10 -#define TABLE_UPDATE_TIMEOUT_US 100000 +#define TABLE_UPDATE_SLEEP_US 10 +#define TABLE_UPDATE_TIMEOUT_US 100000 +#define MEM_INIT_SLEEP_US 1000 +#define MEM_INIT_TIMEOUT_US 100000 + #define OCELOT_RSV_VLAN_RANGE_START 4000 struct ocelot_mact_entry { @@ -2715,6 +2719,46 @@ static void ocelot_detect_features(struct ocelot *ocelot) ocelot->num_frame_refs = QSYS_MMGT_EQ_CTRL_FP_FREE_CNT(eq_ctrl); } +static int ocelot_mem_init_status(struct ocelot *ocelot) +{ + unsigned int val; + int err; + + err = regmap_field_read(ocelot->regfields[SYS_RESET_CFG_MEM_INIT], + &val); + + return err ?: val; +} + +int ocelot_reset(struct ocelot *ocelot) +{ + int err; + u32 val; + + err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_INIT], 1); + if (err) + return err; + + err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1); + if (err) + return err; + + /* MEM_INIT is a self-clearing bit. Wait for it to be cleared (should be + * 100us) before enabling the switch core. + */ + err = readx_poll_timeout(ocelot_mem_init_status, ocelot, val, !val, + MEM_INIT_SLEEP_US, MEM_INIT_TIMEOUT_US); + if (err) + return err; + + err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1); + if (err) + return err; + + return regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1); +} +EXPORT_SYMBOL(ocelot_reset); + int ocelot_init(struct ocelot *ocelot) { int i, ret; diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 19e5486d1dbd..822b11d33288 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -6,7 +6,6 @@ */ #include #include -#include #include #include #include @@ -17,6 +16,7 @@ #include #include +#include #include #include #include @@ -26,9 +26,6 @@ #define VSC7514_VCAP_POLICER_BASE 128 #define VSC7514_VCAP_POLICER_MAX 191 -#define MEM_INIT_SLEEP_US 1000 -#define MEM_INIT_TIMEOUT_US 100000 - static const u32 *ocelot_regmap[TARGET_MAX] = { [ANA] = vsc7514_ana_regmap, [QS] = vsc7514_qs_regmap, @@ -133,45 +130,6 @@ static const struct of_device_id mscc_ocelot_match[] = { }; MODULE_DEVICE_TABLE(of, mscc_ocelot_match); -static int ocelot_mem_init_status(struct ocelot *ocelot) -{ - unsigned int val; - int err; - - err = regmap_field_read(ocelot->regfields[SYS_RESET_CFG_MEM_INIT], - &val); - - return err ?: val; -} - -static int ocelot_reset(struct ocelot *ocelot) -{ - int err; - u32 val; - - err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_INIT], 1); - if (err) - return err; - - err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1); - if (err) - return err; - - /* MEM_INIT is a self-clearing bit. Wait for it to be cleared (should be - * 100us) before enabling the switch core. - */ - err = readx_poll_timeout(ocelot_mem_init_status, ocelot, val, !val, - MEM_INIT_SLEEP_US, MEM_INIT_TIMEOUT_US); - if (err) - return err; - - err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1); - if (err) - return err; - - return regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1); -} - static const struct ocelot_ops ocelot_ops = { .reset = ocelot_reset, .wm_enc = ocelot_wm_enc, diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 55bbd5319128..9c1c9b8c43f5 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -1134,6 +1134,7 @@ void ocelot_ptp_rx_timestamp(struct ocelot *ocelot, struct sk_buff *skb, int ocelot_regfields_init(struct ocelot *ocelot, const struct reg_field *const regfields); struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res); +int ocelot_reset(struct ocelot *ocelot); int ocelot_init(struct ocelot *ocelot); void ocelot_deinit(struct ocelot *ocelot); void ocelot_init_port(struct ocelot *ocelot, int port); From patchwork Sat Oct 8 18:51:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001846 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 9B8D7C43219 for ; Sat, 8 Oct 2022 18:52:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbiJHSwU (ORCPT ); Sat, 8 Oct 2022 14:52:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbiJHSwM (ORCPT ); Sat, 8 Oct 2022 14:52:12 -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 AE1BA3F302; Sat, 8 Oct 2022 11:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/3wjO3dWACW+jLwKHCS6Z8LpqJY+08ZLyL4VgyrxbTz3zH9E7DC1BE73Sy7frjh2lRsXEuZ4P/Zh6ToOp0X3Oq28Q/U/5EmzmvsJ+Ay/af88khLQbtLH0SkJv2pfqFvRiV5+cbwqzV09UbHXVPBB02/53EEfk7CwLAqT7E4KeOMkzI5GLdEXR5BJMgpFL3jhmN/KL1GCI4KQssowIMSHbGifD/3jZ75wjE159r00CzNRJLKtSaoCpGBVwDusvbiJ57BFLlP/yH3J25X/Hf4fq+u04UWjbuvPuYNKlJts0GWFPZ1wY/jqKjN3zphJtHyH5EzvA1VKfV8Jmf5OhKtGw== 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=eRtS9ifcETFXDbwozHn4pI37mZfnaWmxzS8rFhcLQqU=; b=kZoY+vH0tN1FhTBlrd8aOfRGEUe/OOndE7C8LJzfw+kGu7sHQKKYLZtSG8GJZuGzfewsnYWhRHxYlyeIRMlqNDZPO0pFKcfOBC+cyCtpXcRSwbu2ZqT5585JQ6ATyr3j4nGolYknSukQTCuHP7s+445krQF9xeJyBxAbIlAmRCEX3W6cUY70QL6ND9YzCA/K+kpUc0riNgJVAJMW1UQAXMhfeqHvMH11rgaX3rJ7Dayond+q/GtjcKdUMIKhiKti8lY8/5vi0b4PwuesINun50KeOMTXXY2j2zI3JIa7+uO53CewHijNDuvVF9zImOfDlKEdxUZYRpGbwq2Oapm8zg== 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=eRtS9ifcETFXDbwozHn4pI37mZfnaWmxzS8rFhcLQqU=; b=Oa3vEhkXtz+9ulh88FZIynKcX9xbH5Of6wq1v0ncwgN76AT3vVZ2hJguwhVANNI50W6tNE5PbITFS30AVsw90RWkeiYxqe2LyhcVY8kHnVZ0nXTlIB5DvO8S9KSQxtu6xlyY1PsrzGCNDJjUfhDEMo6poOOGI2pFTE1N77Ivc/M= 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:07 +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 Subject: [RFC v4 net-next 06/17] net: mscc: ocelot: expose vsc7514_regmap definition Date: Sat, 8 Oct 2022 11:51:41 -0700 Message-Id: <20221008185152.2411007-7-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> 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: 1a7ad9ff-37d2-47b9-dbce-08daa95e3291 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d5WC8uz1fYyRHLYAud2b/oFDQK9H9SPNIGkJtuwjgtxAb4i0VSQEn7vrHsgPs8tq0OZS4Dg4WsYIRaA56yT1ejE5ZCb1hmLl231YFPDbgO8bWFElA++5vSmPA6O+bAKScTaGWnX7K/qEfspslKi+i9ZM5eYd/lfSdNpLhu7vi7HjgS17w0c5n/RxNxl+ZOgD+z1aMTedB+bCL0S1jGcOFkGyFfQZd7JbRJWvBpU8ujkQ2pH/5uai8Vh+mg3FMQAeWRoGt9mwIFdaP+UPSYKwYk+jAcmYMVOaIEvbhGr14DdZ9shPnQvfuofIqokNG9aNPYV4NFzG4e2EyEv/1OlvPod3xOWFhxpI+E4LuMxVMDVpGrR9WAU375dUKnqMQXvfdZeGq+E2tM+AicRWOo0dFxqVcQlTD5/6QNqZKy1eg0CBV3Xn7FuWA7DIWhnTh4RsCcySwreEwX58SuvAsfobUwSpjRpGUy3auNQODlxaWpkg30XbsrJKmqZj74sjabCYIG0lq9y6hdai+lQh6M2SOqH7xKZ+FnAvvwdqMEgfDvuKX8MWN0LgbPMibMPGcFl3+9gKr7QV4kXGO8bBTJ5hVnoycrKSkIGoj9rtl+OuHBfSbip8t2HQOIHdefC950bfn/0qCYB+Mv3/Ev4aYocvOJ845/EnDCpsj5Xb2jILfOZp6ZE3UrNxMRi5DkoECwMKSqGjIoSGiFKuVEWI2ByTh8agfr+hVi1vcb/11oUjR0yICsFWQIvxqISGnr0btTluCSPACN6zygIrfTuEuFG6WQ== 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: fWQK+MMfykQPulg+bEgC/pFpHn3rGAfSLkEatmz6CU8HSxluDVMuf/2Dw0dPaQiqxieMCG/Dhkk0EGoyN/T3j8LMRMm8SW9VovamWEbMkmp18VvoPR/wn5MRkirnAkQXBowtM1fNIu3ZiZxWTIeZZ/y+YLmTsixxw2jfmQNKmnFL9Z1Hps7hiFhU5h+1jrijNCX3lV8lnwBSB0Nrs5YlMyEM755P3O0Sn7EMbeXKFdlqQgwh2pbE+9uSrZgQ+nR/0lWgQqoW7sWEyCxT27YXybiJFNrituWXvtFVhokQC/3G8snnRXLrwD6pwfRIjaI2LqCBm5COy2RU2ubztxIri8NRyfNy3VjqvAhWSCQCNztmztP3NNyOssxRzO6ikzoZsUEMELjVD1xVuRI4zA6+NJS39v6KHtmrgSgt2cQeb+nhgsyQk1t5gXoya8DYv2z2LK37GBBNIVH6OycBfP7BYOzX8qloPSgxjh8KOjtFofNqtdnNRhyhjxw1YrokjbkHG7zQSjX/6QBlQfuiBLUfiOQCPYh4Frr1RJ4E1pheoYjNXLd3zdtK/vKQwg3BSATZB+bN7ujhhRuPjiNVpPP6PMVIkCGG9Q48hSsa2eE3xQwpxS89666mw7RsZNtXIDYzgyQK2YWwdY5foJnqufoAGsQfbRhdcX16EzCW5ouWCqtlwFE5AYE1t1Vwn3NpNP4t8brDpXLynVdXfBkpn/gvS8SVWzhLIY+7Gs9vQlgBkV/uFdSOeVmUMcSg4jLjORA79y0h6Q94qCJtVpAxlHzZ/3lvDfqC4WHlG3ttSpljO2UcXJmumAzKStwyEtOvCAn3+vFdwSK8dwm7jncXGtMa4WzQBxHsyngZdkMOkjjkEkMx0dqQpHGMlkla5u20kpFBPa51su2gbJ3A/QX4LoDt1KvZDb7KB25ovBrJcd5Outj6ameIQrJ+PvMOKuUcWOoHjjew4DlUJQUhdlQCblBEtJafvJ0tu3uVzOzEBIkaD41X1OWY+L1XpY2pMoSU+dcFgNmNSJOidDwOBljcBraPpQtBIZS5wCbWft2ADHtsJAoT1OxCYV80NCCyMMeci2dJ/UVAfFrFje8VM0/qHl63AOY0cVkmq4x0a/A0Q6/86b2r7gxDWE+/PsvulIaEsRh+fDl9owynvKMMhAE+ydmZDYQk+HHjBfBry9VQMG8yyJTZpsMCy6h/T+JJmY09nDSg63NBopPz8bdPobw/ItAWzFMyI9+vg5WSq7UH+oQ2SfrT1rbs0RuFjBgx3LfZYPTSK6b0PO+T+fEUOIeUglz8rKE5mzgXDUbgyJl2q6McFsd7tlHK7SJZxk10enjNWPPZ7pLo+AtY1nMYCEeIn/gRkPULomj7jg9OCzXVc4WrrTK5Gxt/0h9hSRP+V9ay/+9zN2KOr1Cfx5Ahrhv1IJ4t2553nQm1g8BbELF8BVNzXvrD6lzhPDCxtrwrOBUsOxvHR409c+skLfq1Oanh/p9mqK/3jV2HoAgjCJXHMKJd/f1xBAgWwjbB/Si6Xrv/MaXMuDTxdmF96Eyp6IqQY/CxOa477iFlgwlQtvEABeLFZCMGLkaJVyfSlKCo+IWI7rXIpYvBvTu+6Rn/DqMhVBKf5w== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a7ad9ff-37d2-47b9-dbce-08daa95e3291 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:06.8036 (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: myAcTGQVmRD5jZLHAPzXQ1aTJV/ykof0mpRzbTPWi3udUNnEgQ3kisvDTiFucNgrDEUGOdNoChgI+DIeHyaAH7Q75qDmK9zLas5aS3RMCA4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The VSC7514 target regmap is identical for ones shared with similar hardware, specifically the VSC7512. Share this resource, and change the name to match the pattern of other exported resources. Signed-off-by: Colin Foster --- v4 * New patch --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 15 +-------------- drivers/net/ethernet/mscc/vsc7514_regs.c | 14 ++++++++++++++ include/soc/mscc/vsc7514_regs.h | 2 ++ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 822b11d33288..a30a3694f200 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -26,19 +26,6 @@ #define VSC7514_VCAP_POLICER_BASE 128 #define VSC7514_VCAP_POLICER_MAX 191 -static const u32 *ocelot_regmap[TARGET_MAX] = { - [ANA] = vsc7514_ana_regmap, - [QS] = vsc7514_qs_regmap, - [QSYS] = vsc7514_qsys_regmap, - [REW] = vsc7514_rew_regmap, - [SYS] = vsc7514_sys_regmap, - [S0] = vsc7514_vcap_regmap, - [S1] = vsc7514_vcap_regmap, - [S2] = vsc7514_vcap_regmap, - [PTP] = vsc7514_ptp_regmap, - [DEV_GMII] = vsc7514_dev_gmii_regmap, -}; - static void ocelot_pll5_init(struct ocelot *ocelot) { /* Configure PLL5. This will need a proper CCF driver @@ -72,7 +59,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) { int ret; - ocelot->map = ocelot_regmap; + ocelot->map = vsc7514_regmap; ocelot->stats_layout = vsc7514_stats_layout; ocelot->num_mact_rows = 1024; ocelot->ops = ops; diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c index c943da4dd1f1..3a0b6307a13a 100644 --- a/drivers/net/ethernet/mscc/vsc7514_regs.c +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c @@ -434,6 +434,20 @@ const u32 vsc7514_dev_gmii_regmap[] = { }; EXPORT_SYMBOL(vsc7514_dev_gmii_regmap); +const u32 *vsc7514_regmap[TARGET_MAX] = { + [ANA] = vsc7514_ana_regmap, + [QS] = vsc7514_qs_regmap, + [QSYS] = vsc7514_qsys_regmap, + [REW] = vsc7514_rew_regmap, + [SYS] = vsc7514_sys_regmap, + [S0] = vsc7514_vcap_regmap, + [S1] = vsc7514_vcap_regmap, + [S2] = vsc7514_vcap_regmap, + [PTP] = vsc7514_ptp_regmap, + [DEV_GMII] = vsc7514_dev_gmii_regmap, +}; +EXPORT_SYMBOL(vsc7514_regmap); + const struct vcap_field vsc7514_vcap_es0_keys[] = { [VCAP_ES0_EGR_PORT] = { 0, 4 }, [VCAP_ES0_IGR_PORT] = { 4, 4 }, diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h index a939849efd91..38efc0fa73b1 100644 --- a/include/soc/mscc/vsc7514_regs.h +++ b/include/soc/mscc/vsc7514_regs.h @@ -25,6 +25,8 @@ extern const u32 vsc7514_vcap_regmap[]; extern const u32 vsc7514_ptp_regmap[]; extern const u32 vsc7514_dev_gmii_regmap[]; +extern const u32 *vsc7514_regmap[TARGET_MAX]; + extern const struct vcap_field vsc7514_vcap_es0_keys[]; extern const struct vcap_field vsc7514_vcap_es0_actions[]; extern const struct vcap_field vsc7514_vcap_is1_keys[]; From patchwork Sat Oct 8 18:51:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001845 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 B5732C4332F for ; Sat, 8 Oct 2022 18:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbiJHSwT (ORCPT ); Sat, 8 Oct 2022 14:52:19 -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> 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: UZsGjsfwQVWIxY3gugyL451+9HDB7bDC4sX5xVIcfQaGXJsnymTWIXhnU75PqOVbcM+34Xy4rbp3WvkzARsJUHjC3eytTdvec8Ov3nOwX2lB75s47LSA88yBejj41kAtA5Ml9S8oP+zn+peWaw+q/am6sujBjXgO2IYwsrBJgSDSj5LpwuqeBGuNHfUK35uom5u1RsXSBX+MTyXuNNCT4iAmlIEZB1MzdDhar5Quo7eDRY6T8vKcvMxp10AVPr0MZqCxhetTevldw0PDnCYyRaKrZ15vNUZnvvSIknxXWz9lYWQauuqWtrJYq405QyRdV84m7oCcBUF5f+NdQffuRKtZkrgNasDvZoC5Q5Xim0J48u+0aWYMFDAbLxHOAZt92Jgt1kkF+i5xttLduHyTWle+gSPyYVCglgdQYMenqNpcsSCMh1Y9Cv1UJOa4mvT7gGd48XEkEDaOblw2NzsOhtW9OOS6YrvJzxvEPC2U/f46+2SN41LoK7/WsTEjZyD6xxkvblmkS0R3oWrBEtdouRjtj73i9S6+yPFNn0+etj/AczNYaAyDFIwN8eLA2l5EO9i/PJGL+43a9cZWzuX29JU1L+0DkA2tBf9HEwROeZrtTfnDsxTyWOFf89L5CBUmBgM6SbX8R6XwbZRcEOIs+tfYYPopJ/RVuCMo6/HAO7K3lOtNtAt7fBGdCjJfxkEZARsyN5d+a6KohQ59n+Hc/NTucmthj3BirHJOxMg32jyW3FWms/DmmgcgAApDs3mEszg5ggF0rhlOciPJDtcf0FuaAPsaLh/B0aX7XtII8/bunYMaYeNsM9CO9Fbx6P4YhGSeRgrYy8qRRSKYyBvhxB3pdjFWIgqheWz2Js7CxJzHNUUKE0Rl0dCR48RsnR229yhzNlLLxQLrIVv53E24d0EgPqENnoIpdbnNRVWkhdYap5WxoiFYse+9LL0p+NlyVVlIZrYmP5dE5yZnLgJK/vKU8M4cDsjoaQTNxXSwB9JlBlw7smEXTUCE4fcqwcVvZKepG5LnO0N1nQ+t09+CE+WkaSU+74RCYHSLgY51Xo2sCvgVXCZaD3BF6tawPyA2X0auwUCGykuk7ov1JA4RryIJKM2VQpslJD2/DEXeYXaRaTbcQBSTEtanVoSIeDJ60UNVOhvkrr86FlIbifb8HMjCMq0na+lb1Eh0b+kxS+L1Oah4iga+CYJfNaT1AxEq74mabaUq6Bs9EOOWmmTGX61tQId94Q2rcVVPzetB/ijDvMomTaTRL4HbR3wDPBLhkGssOqaH9V5ATxPy/hoKt0ObhI9hFVMRNkPX/8x40B/LWWhMHvJXCgNjW+8nKIEmOG9/LceDrLHZcNRHahB1eC/+kDJSwe/8ftrWv7nAsYD/TJ0vO5zJMBcOf2cCI85BkJWkTZ0Rl5QnzVCZiKsCU4l3aN9tqzXFs9TiYm2uU6clY7OZFKz+pTp1Tj6eVG3eyZcmhwaEk8IF0RZoHVHUWlrb8WIoCr7Czhe8k2Q0TKFPukXNqq50MeTjrU4Wz1uToLiq0frJ2ro8zEmNRJZaeT1Nwi/Y698qDwUN55vVnIPbbsNBR3DLmqoBWRafl0IJ2spRyjiaRUNzHVKlTX7RQA== 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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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, From patchwork Sat Oct 8 18:51:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001847 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 53EEBC4332F for ; Sat, 8 Oct 2022 18:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbiJHSwX (ORCPT ); Sat, 8 Oct 2022 14:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbiJHSwN (ORCPT ); Sat, 8 Oct 2022 14:52:13 -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 8FC833F301; Sat, 8 Oct 2022 11:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PqRhLX+GsjSWyu/b4mX0rclg01vGhiFQ/8DdT26RNGMOk/PdGyM2MJVQVv529TRtwvzuC55RhouCo9Qj/iPuEoUAGJNaT740zwmMmq9/8pJ1caqSVcLygoEbmdSl8fqzZSoReQFHN75QyKzpWyFxGBgRn1HY8k17vYfG/8pf4IHBsW2VE5uYbKSMaKDnVqxrf2zFF4+3r4uzxWDUHhS/MmkPZV53JAVHbNjx7wsxZRqdOFPM4XZqWdu3FZNFE1Si6fz1saTl9eqcGuuLLpD/gUF64PTewwjdr937fuWZL3Z0o13z0NQjaSoyGmN7R1CD+o6LgL7zHGLUw/ztdfuU0Q== 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=4Q0cd1988MgNh2C+zlYXtdN6JeXoqO2yw/CVK5lqrOE=; b=QDdlQtmIpUz5DtR8/yMlgpViCgqWR/l4h3dU9v2dviRG6fSmn+r25r52DnsDTP1oEED1WXvsc0N/xNrFUCyT60DZn4QfeCfn+UZBF0MGmAKTQjrvw+1AmV9Z4jHWggjzh/gUBAulfnk5y6Y3mRCko44+cAmnK9DvlQGRMCyAKMNhFxSeCpY5watquq0DeqFCZ28TxOjK9L98Cb2x+HsSh4NR2prn7GRcnZiPBxnek/pXrcYKJZDSXk4/6D9FMBXuh8pYyqEsowwtPkEj0YD6XlOuZyXj5XLymb4tcKbjIRCq5+yCVvQPN27q0lOpbp5XevKDMNMIvnW9kcHCp8vVJw== 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=4Q0cd1988MgNh2C+zlYXtdN6JeXoqO2yw/CVK5lqrOE=; b=mG9jyGPpRraqnSmenAsEeCXKLt9oWx6qyZkh1A6g/pQ9Bt+/IZNOWORpHJEaks2MMZiNTmfM8489nlPpe42TG4laeHZ71iTqvCztA/fBnsBTWgw5jME1/1Xj5aUzQmAeM5HaHHbZQnQnCTBs1NuVZDfmDdMSizXzQAEf3PtHIIk= 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:08 +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 Subject: [RFC v4 net-next 08/17] net: dsa: felix: populate mac_capabilities for all ports Date: Sat, 8 Oct 2022 11:51:43 -0700 Message-Id: <20221008185152.2411007-9-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> 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: c9fb9a7c-2a02-4cd1-5b21-08daa95e3336 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7uw4zGpvb12oAlJKoGdiRRsfLh1LjxIO6EzHifThDPAyLPlyJmdXkKH0wY34H1ad2dsAfnfZENRPKUQusAPjv3zCKEFPbpDMNkebNSED9X1OExiUUcS2vNXwm2b41SzbVvWarumBu013I7sR/zXbKAmnM9DSoChfZqPHFQ9FtCHvFl+WCN8dP1rzBvvViv1H3x6pTT6x6H52nBADsrzCKsV7Ol0FkMcZaMKVcCnpaVmEx0yn6dCrBrEiRDZKFlmf4swZo4VzZ5sanBUugGh5NKuz6f6YusKbUWjm9xat1kqRQOQkwkpgHiYdo/v3K25A4dtgBQ1t3T4HbWsn99vSToVKu3IWDyjiIyiUMCXKKd2Ua9QdM7oJd4D4BzLFAOr1B9XqF+Be4rnxik//OjgCeY+UXGCQuicbffwsfMJCFIgTbN5ztB7B/cjhO+qlI6fIQpSB1MjsDGXuT3zhLj+xdE/4iN0F4g9pqhItQoUd7Bl5p4bpQ2M7rJiywqQcQgmkrhM0RtgaJgOrc5WxyZTXNNLSNcXAKq/685w0HF93f7chs1dCVnoK5h3NEhQw4kEFxTVcwMoQqh2Al5CtlgOHXHXeZgcBqFUhhA7NdZ0tdL6bBBM7900askXA0F1SvAliO5db0ktBiKhQUL8DYRVlQwk6g40Y+uVjVTbMJmVTeEZIZsb2QfTXtMFGuTA8jd8kShYtcwqROxkN2M1OkOY7KkT/O60b/v6+q4dn6mrsffNXYyiMaPIzTxm1NbSRQX+c8MbuGPCTP4r6tqVmtPs5RQ== 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: gJMaNkYtOmEQjPZCCnbIxyx8NY7fSCoZ+ia1c+9zWF5co+j60AkjkfA1UIfZsVyM+SiRDvJ7FWeAC7HNRCcv3ILz+0HI+KlOOYUP7L28ZXVU3XrdUrl0VNBx9HTcZDQdPxrvwOK81UyPC202P4dnoIf1QCDfab+PpXTEnihcxFZxzUc8bk8+qb8TsUBZUPWs/xrJz2yFGAMXR+0Lpif3AfrZ5FFtONEMtbznifK7ANXzPFizAaf30A5IweFfo/GpGgM1yfjW/5yHD8mSlcZ/nzoj0azthVYg2Q+cyPfS+lP2TB+qq6ty1HqoXEZNSSly0G/JS5NQ8BGbonSFjEkiXoDiP7TOBFPU6XwCytfM/PNhLd+gund+OxTuQqc9Mc3pq/CNByRk1eULMdfJZ0v/HU3XaNauVqUn1HYauaxtSPlR9tTvZ0gvK1rcdgcHT3K6rq33c0egcK/SykBNLxkp7paq3XBmVmGEv84shAfh8gp06fbZO7u3s83mY3GaYnX7R7ZFYuUOAkQbqrNl+4eUP0nYyixPE8azzYmSNFeS0nCMklZkYqyjYwZHXA05bb31ugRcxK/p3G7d7VJAbg/AN1vh6txfuipLi9ed+oR3inKqmoWFv2ide/mllncgtJw/pCwdNejGN+DMF8lkR/uh34DRnjN0eENtBCXVjInJD0oY0TyRNv8GmSKHtwXHY4GAOa0genZGHXUSw3JNHAuNh93j//6ktKZvi8UEvzcfUFsZUynTw8tLOwr3uv5pjqf10WpxaqVpeUNpErpnVDMNGw8Xu4Yyl0NFdMFYI5bpfJFah8Qm6pzByOTK+HOk8VBIxL0Lp9/bF/kMWCIPgkzk/Fd2DCmP4wGqIGfVb7d5TBWfUFAyszyEnbNMY9b1wLVJv9jnh8GsN3YfXO1pTB0sf80kNJs2gtQh9pziaYS0/e/XBbYycM9OA9YNp58PiYGFGXn+ZClgURaNFhv6D0W3DOOaomFbrymILyfuorqc73oGdHIGPuXi58mwI84b7eALXxkEdkoRvw1z/1WzUk1vpubjeIxQoHFFqgUHPnfN+87KVao8adkFnbNsMHX2TizmyMqIkA9IdYnpsrCtLwD7N5ki2E627DtFqPVNanNyMzg/HR3drfh+UiMqs+/a5InZXmVtfOzwfiDblikPw5VtNkcc7MYNGQpKLRThX/14Ovd+i31ob5Vdg2MpPghVODVf3CzW06oyaClFyEfoQtzNazNPx1iQc1c+olcvIceLc5NeJqAw+1G/UrOo/VZiNs5UGYf0qZHnzDdbg01K2RMQH6nbIukgKmueO8upAO4H9QEXOLXYK8ZCoVbhwvXa13F+HfeEmUSeHqBlM09uJfD7YSy1+4DIiRlN7DXpotTSDgzAnu/54N+kxdQ+PRVLnNNH135rzaXexlasHblBy3GO9E5LTKoZ0Odg+W/Fd895mjEaHAA+bzymAT+Yndb+oTvZcHNtz6jykQ0XPFqQAsTRAOmfmK4GABoScfl7xEVPaTNOx633+lc7iJA4VGXXdmTFzpzdaWbGhjlSsTpUeXeiSujeuXlIBnaNAIQshpmegebewsbnq/idY7dzcSLqMAu3OuTrORDcbBzQzKqggA3oRSg9A7C1O4kisG+s+YUJNaA= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9fb9a7c-2a02-4cd1-5b21-08daa95e3336 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.9129 (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: h0Rm1lWymZVujPG6i0ILLMsSYz6uRDT5S9mY08z6N7piTbwYysUUzZXKuVrf1dl6jGPIFLqEVTAG06KG9D1+md1QjcMDI5eseruR1KVANTs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC phylink_generic_validate() requires that mac_capabilities is correctly populated. While no existing felix drivers have used phylink_generic_validate(), the ocelot_ext.c driver will. Populate this element so the use of existing functions is possible. Signed-off-by: Colin Foster --- v3-v4 * No change v2 * Updated commit message to indicate "no existing felix drivers" instead of "no existing drivers" v1 from previous RFC: * New patch --- drivers/net/dsa/ocelot/felix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index d56f6f67f648..1d938675bd3a 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1050,6 +1050,9 @@ static void felix_phylink_get_caps(struct dsa_switch *ds, int port, __set_bit(ocelot->ports[port]->phy_mode, config->supported_interfaces); + + config->mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | MAC_10 | + MAC_100 | MAC_1000FD | MAC_2500FD; } static void felix_phylink_validate(struct dsa_switch *ds, int port, From patchwork Sat Oct 8 18:51:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001849 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 30FCDC4332F for ; Sat, 8 Oct 2022 18:52:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbiJHSw0 (ORCPT ); Sat, 8 Oct 2022 14:52:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbiJHSwP (ORCPT ); Sat, 8 Oct 2022 14:52:15 -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 326053F330; Sat, 8 Oct 2022 11:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UK8YSbhbUK1McfBEBYPqigpeW2PF7o5ED7+LOqb6r8VVLvjKWbCC/UQXrM6kfKrXQ5RmfQnFiOQoHXQepS1It7U761xlBKP/n4JTafTapggmOAPvL2l/ezueY2bh+k6A8r74LfcKb8aTF0SgI6MnYX+XpoYdCaHJgsf9ycvwa8jN9JD0MTJYGScJTf2SfLJFdiPkkeTBrWt3zkbibtVxIsREbuFmFZvitmJlFHPwLQkgiXhtv/b0CvVauXImOead5rEIDKaPoLq2N8uwZMwtqQRQhhhfBchlshQKwOiTo6sUkgya1ibr4S9rxF4clCXWs8STcVXKYwyXJhnthv0jvg== 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=sx6uo+k8oxp1Me10hVVjNIFbJRnKU3QiS1p0xRQWsDw=; b=NNFYT47o8EvSHWPzWnQN2PH8t1IKgstLCOpXQR/EkV18f4jvFs7eSszeMyG/8W3kpoWvZTueIE8wL0vYQ+sZJyVItmeA6GKocMk0KgoXzBFF+h30aVbZlRDZQ7FnR+hZgQ9pt+KTkGpj9ghjJ0t7Dg0j6WqrvEKT2ZxuuFy1RX2E2Fg0x5XfPVt3TuAxcf3lJfqeNwoI37tsoPgLoziYGd+CW1M2efIWCJc5omSGVlO1OXj24jA3FP4xaXP6KWC8JRx2QJT6v4X8/7AHQ3zko2FYspxqu0EiPGcuFuvX7E20z51uJY1Y9QiHiWJAiNrOYypQTo2n6D4X3dQ+DAupew== 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=sx6uo+k8oxp1Me10hVVjNIFbJRnKU3QiS1p0xRQWsDw=; b=ehpfOfuTSYQc6aygODKLCeQ19Zinz7Y0BeLnJRtGM2lBeqD+7u+4H9TBYzHoqzPYnkHBw1/PkSfdiPQgSU+YArYZO2q/fYTkVVplsoTAxyTH9voy8xvovCaODJVfFHCTzEGzjxfUj/UBwwAfkWMIl8XLvrYu+u8/dSJwj6Tlod0= 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:09 +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:09 +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 Subject: [RFC v4 net-next 09/17] net: dsa: felix: add support for MFD configurations Date: Sat, 8 Oct 2022 11:51:44 -0700 Message-Id: <20221008185152.2411007-10-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> 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: 62010382-8f5c-47c8-a519-08daa95e3382 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9K7PSjnfptsj0i3HAvY0okp+kopvpV0ILIth7JouzLBPM1YT3WaQEKVjcVNJNN1blNywc/KB3rBEvEH+dqFDpX4KkFb8JazIisvSopKCpgKESxlIKTzZ21T7ATfjbbi90l6RolkDjM9CeAPFeJgMN3nad+vlGrz+T6v0UxOicCV4Ri/5bbwILej28iadZi9HJ8BpNbhLbUEibQ0EXD2+45jHLkUHG+PHnOn6h4bm9XPDAiZW5CIWwhWNYB4GE1L1m+9AiGPDsMe6ajRSv2cnyie6KPcJIsNjDEs4QTWmeV/EfC/Hzq4rRhACnEHWLJIt+cfUp5LVzPdQz5lLe3Dlzyiw2YyZJAHDsfcPmYmSiqo7scuK6BLgS8qaATQf+PdUeJ4AEQ+1M8cwycDrYuo1fi+w6kRPX+r6Un/IWyaNg5v9CHlWQkiK2GAV6+q335XhFbpgZ3ZEJqLlgswTn2Of6fut8+ylcmwKHF9puoHGhEk5B3n/gG7+TJLRlHZ9L2uY4jXivrR6hIQEdgKwaYcHfg9EKHhxtOOfJDE8tV6cEiRUHb6KAQUEguz/CSLIsWuBV0VSd8KmHrfdZzzX+LcttfeIZbvF8XDKk83FmgotcBe6IYGY0D/SFEwk9Nh6DZyBP5v07Gaun6H1kjPbVQU+atKxXVouUZWrqnL8iAgZvi3u6ivizwPRIZwPtjNm9tZuShcPUswgN/nnG1HdtsloSUGgaYsLWw+yvIfVvrVXSHiQ1NOXWw3dVk5YoBTXsHV7ycidZI5xA3gUVhvgFEBdOg== 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: 2P8rKP6SR5hNNcgNjkcjpEUmWAkGtYv0a31rCe5QE9JQxYQLxkYBY7TazRkfqT1YSYb6KEjpy5Oq3KhgbF66CE4Y9qoKlJ8c+CIMs72kzh93ZJcH+qXdPFRpkGWl3mt2FC5GL5tp5PtJygndRJmHttrIVg/OKcO+i2XVU8J+JkG389J1XNWzCcxFVIG448MenBVI1G9aLAfqTl8qvtxHlbnxv35vgv+BtIDCWbxUgpAsEC+rvNZ3ojW3NrsdRt80uaEeKofc6ZhOOLPUz1XCyVsgxYhUIk1H9uWUgjyNGEK43heINEXdQxUF13DjNadrHLYrDdSZ7WG9OLAc/N1YAs6+Nfch9mhC5IrA8ZQKutuTKRWhQhXc7PujTjS61Z5OiR3ktGr8h4tg/FkNE4bfjn39vFWBB6uCZD1AWm738hwr9gKuNj7CecxmV/sryhvpecsYr4FCTKCRL6j+ogFuwwY0bwsRIqd2Ec2HwPiL1BcNF66fYKNbPw05VWvKWrxPzzkZunCMG290Lg3e3I7EPMFii77sPw4fjx1+sJ7iykl19uu7puMsVq6QIKf32i3r7q/b+5n8krZDML8yl4WvrnRJ7HkLQmd417IfjS+kgLFAH/+w0a9zSDqQkxpJNm+ytCJ88F0ihKB9rzXA3aeZWbsScpAejSbc0NNuCJ649os3TpCfYf3TMoLh+M6OboIra/NlHOhlKm8XuObKFsQuuKbWPRmnSGfAk/ihN8bq+34U10R1EOex8124m8uYNX/eHry7OwOtJF8eoF6uhcZ/elhlY1rRawnAvZoOGsCDdbgrXttT9vvnPdk/wMx43quNVkU+MKNDvhx17jVVwskQ2PUmsROpNABtEtTAtWEqJ4B6a84N8yUZRvqh6VCUDtA1dtc49csvQXBKfezJtbtwst/T3Bc2/Pc+CS1bLLP/SKPNYpudi97/p14ryOMBl/66a/5ZSvgDNLEojKqjbykum96B9grL7RsqmKth5xiAX+d/bN9CvgINkViJLpx3XwlsJ6pYeUCT7OHzoYgp6jdYKfw+HVC5UVb5bBnmFgb3UVW+OWfCja3f1gjdf39w9yxdQn0EEY7RqQSDtjjDJflpHuA3cX0mliL+fwchrMsH0pBGcd5FE47TV2akVppv0JHuH5B7zlRA5oPWfxtsFqQdtdT2Xjwl97eO76bZhJeJ6wjkuIqFEmAJQvaBM5Ds15DKxJl4PhGe8NlLsKmF2JubXYm5vca3T6zlG0/oLJzwQqkpYGVbDRlyZkcCP1nagZ3LsD4IzujTKJ/yPPYW4eGDj8CEINjyD17jMFJy3J1NWnSBR/dmuNmahzN7cBXlOTCfwzDTqC1CoHig6cnBSahWkxw6BF3gCONCJ+uxTCaB6sXlOElbANc5N23k4R5yFkbaxzDn14ygVZ8t73YmILvtOiOnLo/GT+KL7qvgsVddJm2xbue8y92UPzTzPm2rdbgwYOJ9vGIJiinJhOOwyHPW6jEvDlTJiMWKljwNPhG1xPTN0T464nmhi0/PH+sibv2X8UqNZQmytaYfoTDo0dmxuNSJ5AWiaLK2BkKN8RcwdLVix0C4qJt5IsX3c9RJyPv6Y7CTyYggBAM3F+9OnzxKyl9EOFmrc6AD2Uy9kbpZSYo= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62010382-8f5c-47c8-a519-08daa95e3382 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:08.4285 (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: u3tgrZabUOJbyeKdtCE1He3MB7miL1ZnSGFOYU+2mPbWvQkfffCBFkt9SFH5nyS1pEPbMYbxctZQ4cgQzYEcnsHgFLsAUwvdwtcsRQbT4iQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The architecture around the VSC7512 differs from existing felix drivers. In order to add support for all the chip's features (pinctrl, MDIO, gpio) the device had to be laid out as a multi-function device (MFD). One difference between an MFD and a standard platform device is that the regmaps are allocated to the parent device before the child devices are probed. As such, there is no need for felix to initialize new regmaps in these configurations, they can simply be requested from the parent device. Add support for MFD configurations by performing this request from the parent device. Signed-off-by: Colin Foster --- v4 * New patch --- drivers/net/dsa/ocelot/felix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 1d938675bd3a..fb0a0f7e42ac 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1325,6 +1325,13 @@ static struct regmap *felix_request_regmap_by_name(struct felix *felix, struct resource res; int i; + /* In an MFD configuration, regmaps are registered directly to the + * parent device before the child devices are probed, so there is no + * need to initialize a new one. + */ + if (!felix->info->resources) + return dev_get_regmap(ocelot->dev->parent, resource_name); + for (i = 0; i < felix->info->num_resources; i++) { if (strcmp(resource_name, felix->info->resources[i].name)) continue; From patchwork Sat Oct 8 18:51:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001850 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 9DF02C433FE for ; Sat, 8 Oct 2022 18:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbiJHSw2 (ORCPT ); Sat, 8 Oct 2022 14:52:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbiJHSwR (ORCPT ); Sat, 8 Oct 2022 14:52:17 -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 D09893F315; Sat, 8 Oct 2022 11:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CjAvYLK8nmPkkuiQPOg9e33CRGCBkQ+ENJ8qhXUh4FJbnp8f4lkPH9In1J6E1v4f7wtf3BuuTeO6yOO6E+n0chnDMhSOMnqxKdh3cjpk/yLE9pkkcQv4BPKeu+dhhgr/KCP59VG+OG2vOTfqRDsJNYD8scfkVQqcRGth0praYyXGDwEfD2aDcs1bfl1LEGLmw98HRMrwI0tZ/RuGyiGEutwUV7ynFUxN9iAhtgASiDPL0UteR0gil6j7YCNpRuuqzJTJowK69A14jVfEGl8NiM96OMSLndmuQe3uepgtNxESK74e6SeD/ncynwcDNbQHsFGZE32wly6AE19mQCv9hA== 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=s9C2cB/cNu1wPrGU1Va66eSBDv15hq/BGirkJxced2s=; b=PUXrn/65u50nZm+YDZ5r9BVxHM6vUbZwZarcLhJVYL1C3hG7FxDEoc35UZRYvWTqvqk+k1+Lp7Gr3O1joeEhsy+mFyZkGq3Ugm/X6vYa5eJ09U1NngSvTONiBnXlT1CS0BhqOrimF7EdvIBlMulCUw0hzD9rGy2JghbVf1/Ozr695XkIHcyKDDPMmis/Q4wXEN8oXrEtRIpm/tkcYRJ0uDz1PmiFs3vTJuf4aEkJv4ombr9z4Q06RqNvLwLsmQkLGvvNy09c7gP3RUutQWyKg58dlUnD0avx+tV19Lbls+xSjoj/JMAzLVn+93G7+vWq0DfFia6sm/JwTGQYfFTZ6A== 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=s9C2cB/cNu1wPrGU1Va66eSBDv15hq/BGirkJxced2s=; b=PraPQvh8uUE0ay8iBkJmCsNgH6+rNALbFmPjWcbjs6GR5Pj8H5wVcIM5MovxUHJaN6hEi19snz6atuTeO8q3CT92jzTqbt6/ReAxX1SuYmoTeSx6+HBn+7f62gGdQ56e83ZUwlOH9+nq1loqsMnPXfAq8wolvoRK5/C+dY9K5bA= 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:09 +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:09 +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 Subject: [RFC v4 net-next 10/17] net: dsa: felix: add functionality when not all ports are supported Date: Sat, 8 Oct 2022 11:51:45 -0700 Message-Id: <20221008185152.2411007-11-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> 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: 8a2e67fb-0370-4004-da78-08daa95e33da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gXzwuwxnWbJPvk2o9FAY1Jw4BXx4rLZgv3mh3gXMO7bgQWJr2DjaLg/P/SbrRdedHaf2kVCPkoR3B2odC2oFZyJPeA4jw2H9YPfxcIT20r3kvsdjqoe/JHt3Z6Ia6T97KhNoTmCh1EOUf6xdt3xG+OFnmpS9YcEsHuXhqGplBVFepkdBlW+91F8Cg/9n1DpHMJ5hUKKKCawuXavXKYERv6+pJr7xp966lk2zt2i/nDSG1V4DUpp1e/5AaW4YteyYuMXhqSvlaYcUFoVPWEDM2bH7wdSxKlbhT9ibQGvHJv4kISB63eLs5IJfLgcEJAHdajPwx8IWpl8yxE7soPgH58JBQvdyn4zuzGbtBtFrzyldlzxU/Q7ySNJfU2hKc91b+8OLy3HMIqDCw+ElNIyo6VKobXtBdLEOX/wHxwbnf5U+V3HUPkXCI2iUfv+dzFJGcZMsKO4NRS+c0NhZb5QeVNuEtg3hybsrO+HgChafrX4u3zGLRXMOB283766CNujSzk7rZ9ZK5okY9NX/fXqL0VxmAzpqVgUIe3Tmb/XWgOOegBEl4Avw0UtcjM9VO3NXPC9n7UtavtXwcVPbdefN3NkLPi7XS6m2n5ufPyIV+7kddKQdcH2g/ptE2CCfHvddZiTUHHxEAUhl7wYpRey/BI6Qfl470Tpqs3Qw3dHyT4bFLLKXvNWtvfpLNcNDA6ITJfz9YZKe8Zcy0Ma04hztMEMt5kVrHW+0Clr0A1QA3T9OaJ5eNi/9e+TbFO90ZgE8YrdRyjaSlsVgvFE7qiyBtA== 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: o+ivObe4GcEr2uvSPWKjB86kPKXvKB8eJtjEoItiIY5PGNvF0A6FBg26LfESlPGpZTF+oRmWe82RMZiv/sHIJWGVNDKd9saDHj9Tmb/MZETWZGZAcRF8VXEos4FhRK5Z1wMOiSPejM0eFPyqzuvOQq06u2r2ZvTQxCygb1tyG0QlsIE5YE90uEUKAkoGJAP4qtxGXJskV7BKKKYc7A2zzK1l755+yoG+9Iz59Po6V7sIHLOOfqRRT65GfC4gBrbCfoojek3WE0LgHZb+VX6bQEs2vGbncyWKLhAJKAsfB61eUxXrQ6tvgs8Jd5MCkAPAo2hr5iaEPdMo5N6kjNsSPVntI0I7Cj0aJe9jtsbkzUR+8m7+CoJPH5gt+pDzsbyeg0dPjev2R9aoR/NLf0ec7PProrGYUW3USxGJJV54X/EHBFqoQJEIe/6mlt9tdgfUFno4ollbDcQDFj2EhSO0rrDta3EY5CuiAGTsuQ28TKfdDBrEkTLmC3P+jBMDiEJgCBuCwPWh36zhZVOWruJ6Rp0l7q7WNHDDcy7j++lXpBBEIT1azf2CxCek8gfDPkRwE6W7NhalsgrVJUCgRWSaxvjimGedZKZw6crkNg3O7kVEJKy/qJFWYf497mSuMjR8x8y0p7eQW7JlH6Fvw7FVXQSuhqUi3xDs79U5hqIpwoY6U9QTe3tNd9mtu1f7W3Y9gHC5AEOasM1HElVNtGdQIBCJBgl8eGSRTj3sszjCMncbLbHNqNchsFB84dTTskBwMQMdw28zvWj/gLT1nAo6iKpOrcFDin3VrSehmv5lr+08CWEwxkrXJgqSkPdJ4Kp06oKs5FG4BHq0+LPflHj4VJG1DDUKSi6IqR2FX7cW7t0rfEkp1mqhG006J17ZGMMxkdEWM9wnyI4iQP+lGhQiIALab69twd5SZ3Af8DEvs6yUqa8hHO+xNN3/2xGf7dURVNElyIhHbvDK7oNOpSeQXRZOOtAURCsBMozmnB7hVGSIXiJEeooRGDPsJTyAgcQFu+gEClmwW/N5i7R3uoTYNqEiFLSIJFOVRbNMlKJDnY1ri8x+eOPCBymkJNIVsX72f9Hg2ylizlOt3ijmldIGFnrxIOldcR4gdBviDP9OR2I4jVe+JeMNdmsoy+9J640QmUXJBzdDSZchYXO5gW8y+TVGELj8kmD0NUjrQplyfKYCLM4xD8Z9R0xU05vQd2XrPKthbA86Zy6upq7FMpMv1SFWWFvYKxciMac7aUSoqPb8fMZkWd5RtxPDMJHl7ZWUwuTyhS4/6y7Th5N4i8X2VGiDG7n7J5pAh2Pm5qzA1HApgAn5tpXFWLGulMCpu63HzMvFCeD2LpBWAJOLuz2fRnipFSXUjw7XYDp0xv4zCeGmEnwv8SzpgS2I2VYU+LmDfPpdNdFepICtFF+EXcuVjwmPBVB7Dp0TxJXkuEiEVPFDMeRVhzasGxUHRASSn/CjcW3G7SjOHcwMzTGK9djPVfZsE1yO4Q8MXcVjy8fmxyfaIdeeI5ZbJM1I4RmD8h8ScVXsyuIoYCGcye8eIFkMkurLN553TOzknaghKJHoDiDE4PjcyUnzKInnhNdUkSNBpxqMgeKK1ETEVq1r1UnRDgdCsTbFhINShO4d//+NrfM= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a2e67fb-0370-4004-da78-08daa95e33da 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:08.9909 (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: +r4dP3YC1gERAUxi2bk2zfczWsCJ1yFpDWmGpv3XJVM/XsHfrRmqmdA9YjpfKkpRBjBIGTczEthTtKzyxozWh9xsj2ZwlmTkD12VpMmbWhQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC When the Felix driver would probe the ports and verify functionality, it would fail if it hit single port mode that wasn't supported by the driver. The initial case for the VSC7512 driver will have physical ports that exist, but aren't supported by the driver implementation. Add the OCELOT_PORT_MODE_NONE macro to handle this scenario, and allow the Felix driver to continue with all the ports that are currently functional. Signed-off-by: Colin Foster --- v4 * New patch --- drivers/net/dsa/ocelot/felix.c | 11 ++++++++--- drivers/net/dsa/ocelot/felix.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index fb0a0f7e42ac..70c3e4e203c2 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1283,10 +1283,15 @@ static int felix_parse_ports_node(struct felix *felix, err = felix_validate_phy_mode(felix, port, phy_mode); if (err < 0) { - dev_err(dev, "Unsupported PHY mode %s on port %d\n", - phy_modes(phy_mode), port); + dev_info(dev, "Unsupported PHY mode %s on port %d\n", + phy_modes(phy_mode), port); of_node_put(child); - return err; + + /* Leave port_phy_modes[port] = 0, which is also + * PHY_INTERFACE_MODE_NA. This will perform a + * best-effort to bring up as many ports as possible. + */ + continue; } port_phy_modes[port] = phy_mode; diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index e6b7021036c2..90e04df0276a 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -7,6 +7,7 @@ #define ocelot_to_felix(o) container_of((o), struct felix, ocelot) #define FELIX_MAC_QUIRKS OCELOT_QUIRK_PCS_PERFORMS_RATE_ADAPTATION +#define OCELOT_PORT_MODE_NONE 0 #define OCELOT_PORT_MODE_INTERNAL BIT(0) #define OCELOT_PORT_MODE_SGMII BIT(1) #define OCELOT_PORT_MODE_QSGMII BIT(2) From patchwork Sat Oct 8 18:51:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001851 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 DABC8C433FE for ; Sat, 8 Oct 2022 18:52:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbiJHSwc (ORCPT ); Sat, 8 Oct 2022 14:52:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbiJHSwR (ORCPT ); Sat, 8 Oct 2022 14:52:17 -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 023A63FA25; Sat, 8 Oct 2022 11:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N16kqmyKJl4iN73YOzG45EtUO4jRms8tiqWSwDoqDw5y0FtNRc5b4goMPmtzYecx63TkWlZiu7z/EzHGfR4+8zo1ZAmmu6Fv4pEgtZrJVFzgEXwN044gHq9oQfCPNyrZ15QcmMZh5V7zT5W+XnDS6yvZnW06ehL6jlcu++MPplulVoZHkJCV73N/7o0I47bgUmZgTr0RmN5U+mJNM3xjfFsLLu9kMspdOunl5TXh+JV9rRFuk+wAbbwyWITtw/9v6zgBuHnWFckhuwDtBccMpTlyc8OTG5/IGML6P6ntu3bv3L+gKG/qNc17xirTp+MFxkTfWiAsY95xw/jd+mYoZA== 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=0cpMbOVw6uh87QImc+X5A0jBc16Ci0MxOxYuoUUx5Ig=; b=gW2Y6U3F4O6G7brDQWlMOQKDFwFq4tHNcjEr9aFa5Fnhu7xyFVVkbNuSZjR5nmrjgV0DLjNES89W2ZkAOJb5bQ9pGZlbumO+LKSokS+DMuRKOwpqLkVSqNlQFvPi/9j7l3S1iQcjxyJ7rmLf2OgegazuutB79irKIlt0HHDupOahElyCy8dqovqKuHQdujqvMPnXKXbpizmAFPpWVt/HGf+SyaaD6H/nR/XtLNRiQYrRHnMBrisPcBBsQre7t0d2KV91VZbotGNu5bUBm3paNfomN3UUr++iQfXoPX5eDQMN9ct38fTM6YGyCY7s2IrUlOW6NVrJwVzYO/a+fML2ew== 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=0cpMbOVw6uh87QImc+X5A0jBc16Ci0MxOxYuoUUx5Ig=; b=OqUpPrmY9/M6L8mVxKFyWDzi2gSyeSvaaY0fx0r+xyBgsanVMA9WgWqTd2CNKRQKi3PjhbvVQD0lYDhLcbrPUeikn/kJHVHPu7+XuvzhTSr9eJ+qecPbzfqLrmteFTbrYCjtACVgunk+TSKUWL00btL7JPnNCQjlyoI3zw4uC1Y= 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:10 +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:10 +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 Subject: [RFC v4 net-next 11/17] mfd: ocelot: prepend resource size macros to be 32-bit Date: Sat, 8 Oct 2022 11:51:46 -0700 Message-Id: <20221008185152.2411007-12-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> 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: f5c7a404-4c10-4588-4b4f-08daa95e342e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XSkboECQpOEGma1puHvtB4XAv7JjUATKqzA1MTZNuOh46jurPY1b2mcoFFhD9Mfp5vwRQ/T2A6sDPQxsTUEZXVQyxkOsP511G7QmlvyjT7m0YFuCUwnYEXEwgTMs3rjZZB+BEF+sRJaLohsTN2EqlVwpp+hUVesKFYdKbWki18a+pEfYTo875xuaEIrxYzQbMAyWJ62yTNTpfi9J1kJ80Cg//J+g4EYvS4aSSzEkvDHGRvXZ4ztsYB9ep0nhdEouhwalkcCygLAe74uE8BmxWyH+PDhhbFLnet7LzD1826Ccw7ivXcgGKNeJX548cYvV4lA5RV7zfiGrTwbsZVirRO+bEAUU7CqS38Co7ACSriE8kob3Vm7VCnC6U1xxr5H2i627CMrlfX+4RUFJDLfG1NHmMmYeINfgwcTuqD4tnRga4EtjFaZ5+SSnPHjG6zpRvAK54MeQ7j97RE5XCcJJQoPeB1stu7c2s9DLCo96MzUloNQfHeDU4WXkUxbMDnNhJ6APvDDAi9X+o8/Lvj0uWmGd52jZy36lioxLyqaDISeTlantCIkhx3t8SqasReGN7BdqqDooS65RZPKDCZpZLGlFxG5RZZNZTLvXed+Cz7qszThZRPhymQlxOb/90suFmJOdLMPKnSD4sIUTRSqjJrv2R2y4rqUADdDXbyEXKSbJ4rFxwGRzeOLtahuzGeKog0mVJdPAjZPbyprP1GICabjNlBq+ec8CberybAUoS1Ga0HYfxjy2k+y4ysa9kKrUFlOEr2ceVeIbsPCYjFEz7w== 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: NjaxF3yGzH8EijYf7rVu/5OpUYpkRbOQcgRrCciG2zDU/EQO45euCLA4CtVfCc9WNejFUQjBOq64Ta4e9XZ8xlNFC9B4Vtj5WiXq8WqMP8qNKgl4XoqTju/dUyovVViYEHdXHzCWW8j8GJk+YlhIMd7POALPzG7nwOgSvgERkdTo7r3ar9Qa2EaY4vJW+K1Cu9IDgMWe+TjLMuQpHmQC0swyCasPuSXoh51MZmpWvXHO8DYYuhDy1lrL1a2DeoagzwCWpXimJ36eNsoLgm4ih50EjzRu6GuqJudlKyiFLAcsA2xTAIklOIBYw7jsyjZt1Dt3vfzS0pixHB1w38QPSAgtO2ruhFPutCGx0SDgs8nhPrrNIvLHDHqV9dxF7hewNwoUBHRCUXUUEAIg9BJVk0+bRANgzGKTGY5bsRWreXuYOIjIj9FIfOV9JGcbeGMs9OvBvqR0RLi4P+bnxxAQAO8pTEqX4VSAqW/RhO8i/zkq4JMUO/to6gub/Ci8I1V3JtK5bIebqEBo9vlxsUJYBmx/6Qcvk3q7xfzOkeUvBq8yAiuFoMLcAkX6xBJZGFw3HZOjbt0k118WWY2+BOHiyXpdA/g6jKpwtdkVvaiFdx6F47mEyBV5+OSL8/u3bRinGx+8T0GFT1h7X/dQw0KYJ+wh0hg15+9dx72jkZ2G5EvWac2DOzFyvios2pfs0FdFZRzSpb0bcioHaAMZ0DKv71YF58Sm6aNGFkHupln5U5olHDfi1DtMkYMtrdeSRw8yfLnVoWthuhEiMm5CnkyNdR9FRX+3l6ZdZYznaA7teVa+AhemllLGYqASoZxMF119ux8Q7R01W2jFXH7qdjfmJx0F2ZGbFBSQrg7V7mBxA8wX0O1yk3NpghHMXBszQ/MmL47hs7yLSyd2dPFSxsTpPUc2dJ3umq//XIDfyyR9cQzvChRv5xTnSBENfYyZnK+ib7N/5kA1lZmoJ1xm7Lx5onAGJV0HfDmVVCv/d70H2Hv/TM2aQID8IrbzEA0bPvWgKkE4OeZ/XkGuaCqjygfOaJdntjs7pCRUrINTjmFWlSuEIuTZSQjqo0sv4HjpGh1O6tW+w01XBz0wo47F34Qyqbt7Y+Yg4JV/Q58UAQw4k/UdSnS8QsH4wX+XKbiDMum1jqerrHHGNeAqrvBrw8L2drSDLS8ZE8zfdV7khmcctRKVkkeB+v+22SMecThqWUAzW2qjDNqJlqyhFL3US6lvfAcT9ipuQ/PVtLMepSlP7i9d0aTIHd/ANm/8jScxWoFMZwvheKGfm+FZ/ScJN8oouFgEWcu7pMGPyXIlS14Yz3TPVftoJvjSAIAlDDjtlfBiQoR9lU0n5NiKCEN1ZCeB4XJ/tSoFt1aNnQCgQ7FOfi2FbSEaMgHMVZmc3/J5pms/GtfyOJtEyCjAnCz+EJ73WkBO2ixtev02dsU0EByuFCmohTNZr/218GNMif/I+Y7G7ND9L7fUF4NEiJQvNSG4+2LRdocb0MtyJ3N4rjQgWozFcR1Sz8s1o9ihdx+EIrR0Ql8J3CFHSLwm9rJNMqKIGYMDqPRUH5ojpo5e/ki+gERx7Tu+KLXUOT2veVaALL6ojDRB9+GNTOyZ7/6x1HfLJ65ppAsxbTBSUPyHKNn8ikU= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5c7a404-4c10-4588-4b4f-08daa95e342e 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:09.5534 (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: RVLbqWnue57uiRZIW7IfvHhbW4DQ2ZgaVo0HFHIWjXDZileTzsAoxA1acFSuLjSJ/4/zoHJrNg77hugslIuwyQlGk3E50dNcfisN3iHGpQQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The *_RES_SIZE macros are initally <= 0x100. Future resource sizes will be upwards of 0x200000 in size. To keep things clean, fully align the RES_SIZE macros to 32-bit to do nothing more than make the code more consistent. Signed-off-by: Colin Foster --- v3-v4 * No change v2 * New patch - broken out from a different one --- drivers/mfd/ocelot-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/ocelot-core.c b/drivers/mfd/ocelot-core.c index 1816d52c65c5..013e83173062 100644 --- a/drivers/mfd/ocelot-core.c +++ b/drivers/mfd/ocelot-core.c @@ -34,16 +34,16 @@ #define VSC7512_MIIM0_RES_START 0x7107009c #define VSC7512_MIIM1_RES_START 0x710700c0 -#define VSC7512_MIIM_RES_SIZE 0x024 +#define VSC7512_MIIM_RES_SIZE 0x00000024 #define VSC7512_PHY_RES_START 0x710700f0 -#define VSC7512_PHY_RES_SIZE 0x004 +#define VSC7512_PHY_RES_SIZE 0x00000004 #define VSC7512_GPIO_RES_START 0x71070034 -#define VSC7512_GPIO_RES_SIZE 0x06c +#define VSC7512_GPIO_RES_SIZE 0x0000006c #define VSC7512_SIO_CTRL_RES_START 0x710700f8 -#define VSC7512_SIO_CTRL_RES_SIZE 0x100 +#define VSC7512_SIO_CTRL_RES_SIZE 0x00000100 #define VSC7512_GCB_RST_SLEEP_US 100 #define VSC7512_GCB_RST_TIMEOUT_US 100000 From patchwork Sat Oct 8 18:51:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001852 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 A3D02C433F5 for ; Sat, 8 Oct 2022 18:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229844AbiJHSxV (ORCPT ); Sat, 8 Oct 2022 14:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbiJHSwW (ORCPT ); Sat, 8 Oct 2022 14:52:22 -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 B9AAC3F32C; Sat, 8 Oct 2022 11:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZqDuPi+1dATZGwOi+9qGG+1FoS7q/fSEap0NXOKWgqJh37r7b+VKnRIuer2vygKUhPbgIlQT4Mds9YAGRDDtoVnAzee5LzrTJomYyiy5YgzMZgZ0i4x01STgqOMLCHi1GxAQKABz5I3zA63qnWy5xiwpZKXljBFtisrPuwfQ58hu0UgbDo/lNZGy2Bug8f1Ey7OnLqEsnXiX9PpgCPGRhWebuvmZmVJQ5Lm8YJ04kkeaYiZ3OGZOgx+jvXAdDIWPXuuzn+b58/ihY8toRbBx3Ha4oei8vgB9iL8qrLZe2yjFLzd0tcPGvL4c8HqRyy8Oh/tqJYAQwM7ls/PLfD2cBg== 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=9zyYV5u/Nm8BrvODZoTnkVIm6v96W6ineNJjBrd6Els=; b=A/Ka8PTcHMdsJGdC6ccG+htaahU0QHLMfJQCngXvRVTScyBcFN4fhQxslKCxTOV+AH5ShbSAoQYs5PMpvg8X46DBhuOlnCq5L1yUI/l3I9YcVRb+nKsJvB2XYa+nBFnFGCa2KSq7HTSCgFeHKAZenuruU69NmEtK9wAZXoDOUZ1XWbWj9DZ8H3XPv17cApNVFqYTNvZ9zB0MgGC53IRJ40jpG9hlBRVZhLXirUUPmKKgvTyUZZ+N4jalLPZ4fhXM8kRORpmA/C1nshoOszXI1WrUdN/Ml2XIxBoSc4YcI5LFu1i+/WLjN97McxyPC3mHJwJszrLxeja8Jlj1/Iysiw== 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=9zyYV5u/Nm8BrvODZoTnkVIm6v96W6ineNJjBrd6Els=; b=gB/AZ/9/qLIkGGWWiNGiiERUYtkRBMVgL9CYmxNQ4qsWppNTtBnj6k75Rl3meKm1Jc/l1CmZFKpPZkjEFfPCJ+0wCo3Jf60m/uyPOWS5xl9fVT4COotwMxiooZKsFb4Y6MoitbJYRgrO4ziQajvgYEphUGO6EiXsazjvA3yEguE= 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:10 +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:10 +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 Subject: [RFC v4 net-next 12/17] mfd: ocelot: add shared resource names for switch functionality Date: Sat, 8 Oct 2022 11:51:47 -0700 Message-Id: <20221008185152.2411007-13-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> 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: 97d1a924-8894-4c01-1e7a-08daa95e3484 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vXUIknj4h4piNdlMFhYq781ZAkEE5qPeIYsFLRALRmJEXwbAegkCRuQTKJjZ8TEJ2vS02LQqLcxfZaonXX6QnTt3K5cvHbiMz3IHi1DaklrLCTCuBRIi2xenfD39JmCIWpUne9/n0/eEyqiw8S7g5NFlJlt1UhmBGXeMvoetLBTuu3MdJDSsP92+vYHkOupJCHShmoVBtk8ticNjGe/JGe0xFtDB+W7Hf3QV1fSdtGgDHdWGmMzXUkBfT6b99/auoFxN/tcH8U30OqahUw2fGFeqJEyAFZTnPN4sN3qDYnPClfsOXgYsvtE0d8/0jGT99iTWp4bFVzOt35/HRbNF038Rx7SDQf8HORydHH71NjF/YmMkGWdMj5KYfjy2zXMU6ToeXA2ogrGhto59yXSVfc/vh0G33yT8quq4dA8eZl1XIqBgZuME37LAg1+qK7dVhz10wDyJmz5CkVT/6c/QIs4ELnw2+ToZxbhakG+av/QxavIQRmuR/Dw81QMuo0kOkTwIUIBmDYFiUBZlbcZvsugyKRIfmqsu6IFjon5wHjiaAf6tr59WC2UXwkzQKrXB2h1IQ6dpbIcL9wUQiLYUgAQmXtFO6FTA4PnOl6SqF2kP7uJfhWC4iZHrdzO2kf+Jj2tH+j1p6NCDirySHXqN6hYW5im1WZFwZA8JAa2b4dmMmLrOQpY6CPMBHvvTOp9yGAcT1EgvB+G5/Hu7k2PN1iXk8bd6Iayiq7E5JsR4Py0TlgYUqxP6GF//4FupZtYTCyCGunzL9X1qaReNrl94vQ== 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)(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: o2rMSl/4d+4xMX7Ud51axhE9/u1P/YBTXfI380lkuVYeSH7JBDfsn87DN4kVz7ZO1W1hJbd29r1aQq0BNqFHey71y7eDAQpXbLN1ndMxJxaE3M09MAFYpOMSL1fexKrsyQP5buCfuY2jVDc+yxO8QJVrwXtrXrZescp37RjyEq0e2Jq1wytT+wh0d6hWkx2Nwfq8Yb+rgICre9oQiqUdNacNjgPEwJbVUw2YuZJO+xTC+aSYoWeY8OISi/09+m1esxFdyGlRtjMKAxKsot15gQvIoDwqcQ3kYngPDVZtiQm9IWAtlF7OK0I6gbFP0xKK66xFsAZfl2W15+5jkunQaCrKhmFGFBW4GyF//zbCcAQorVTZStY1nG00lRybhOHdwtFfEjuWvdVug630s52lcMykGCrYlsuN1mNi37zBS+BG8xAR4/J+ez8h5A3WM1KdS2H0zh1LZ0CLsGTI1swE+Hg/haO1i9B8eLm7lFo6fw/PpejZdLmZr4T7ltwTwJlxDEDN2hmBO1YZM8nRRRhWIlW54LnIzDbj+JgC1In+oCFATpkhdyBf7L/uRQMqmmsgzgwB0bvdkYSlrRNXodTEIx9CUM/xDFKo1R1ZgZCFoD2nw/6zl4krc/2vWzbL8TISY+nmTk/TVFzf5r2+jkP+I9Fd0EV2Jy92OYaZe5ZZQLlliKVfqa/KX2y9Mvxo4svNSRQZen3zoZcnP+kizz3VmVaMwbitIDW9a0UIyWX660q0dLhX0rJcEgOwU2Uk4bLviYbajdnWmMGXdu1lgxrJIMc9xlDC9RHv7rbVSHac2ddmaoPlDP6wmnspjfpRxELjdjy7Lj27ksFlaV8XblLYYt3JHUdOhpNfdh8QQ1tIeLCn9jZmcrcytPdYgw2C4TqrcGEVXh2Sv/WKU7OzAodQCxJZ8Flwj9Xtb1863yuUN4OX9nDh5rbYoF5Q5dlq6UaMo4FUHbT/INZvkXFPhacTD1HU+86xpocgGz83HnrJuoicmc3s0+Ps3WODo8NMnV/TxWRW561lRLAV3r2WORcWGOWUYWIvglphOIE8FgoHRxKRH0SXZOUDL60/YjN/a4hiF/yFau3mMjKgjgBEmWK9p0YKIrztF+WgEQYmTizAf1AiBVnwxAKRKs23WAb7N+wLQ+7vuPS3yYgj8Fh9vSxd32vvhKfCSQ1HkdDQLVsWnkaNSkGToXDKQDk3hNTP68aZoQDHX2w1UfRTnn6U5VvNVY4ZCor1xDSyAZxrOMP5UH0xT3kCZ0VEWbB9C+Q+l3Zmr4cofI7dEIzgH4byiNixYDbIMr4E0cJlqdBFuHbyhyUu85oGXYwT5g+qlj0aBGOO91ycDMZOKf4uvO42lWUltdQoW1s1rTUe9RId9wH0VLZkxGSWrZv8cQlSYNHQhhdsAxOx+Q4z4iX8e+OuDjzFnwjBYaHh/kdN67+oXOVeYHnZajdZiUBauYDKCzQPMKWfR2WiQHSPZtjt3i0ABut4eT2Mg3LYn9tRzALU2IP6PgLXkaDat9CExrgbJYf8Nnc2rAToqhHKqyEii+hRCbQJA3jSFa90EwHcl5G5fJoyJ2H7qatyah+lNAZRdB3VUqmr+9b3DOAV2fyJLEoxFEFyMOvNa1Fcms0kxLrXHJsBN+o= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97d1a924-8894-4c01-1e7a-08daa95e3484 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:10.1158 (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: 7+eBhdviUp3xvLSIzj6n0ttDeDIOBFwERoFTYFWJyPO1gllfvh4smSibmFFmgvRs9iQAqirq6XrwM+txEm07q7/ZJLMtiS2J5fNZCsyIZYY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The switch portion of the Ocelot chip relies on several resources. Define the resource names here, so they can be referenced by both the switch driver and the MFD. Signed-off-by: Colin Foster --- v4 * New patch. Previous versions had entire structures shared, this only requires that the names be shared. --- include/linux/mfd/ocelot.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/mfd/ocelot.h b/include/linux/mfd/ocelot.h index dd72073d2d4f..b80f2f5ff1d6 100644 --- a/include/linux/mfd/ocelot.h +++ b/include/linux/mfd/ocelot.h @@ -13,6 +13,15 @@ struct resource; +#define OCELOT_RES_NAME_ANA "ana" +#define OCELOT_RES_NAME_QS "qs" +#define OCELOT_RES_NAME_QSYS "qsys" +#define OCELOT_RES_NAME_REW "rew" +#define OCELOT_RES_NAME_SYS "sys" +#define OCELOT_RES_NAME_S0 "s0" +#define OCELOT_RES_NAME_S1 "s1" +#define OCELOT_RES_NAME_S2 "s2" + static inline struct regmap * ocelot_regmap_from_resource_optional(struct platform_device *pdev, unsigned int index, From patchwork Sat Oct 8 18:51:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001854 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 B85A5C4332F for ; Sat, 8 Oct 2022 18:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229898AbiJHSxd (ORCPT ); Sat, 8 Oct 2022 14:53:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbiJHSw1 (ORCPT ); Sat, 8 Oct 2022 14:52:27 -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 33E7D3FED7; Sat, 8 Oct 2022 11:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iInJPKg2CEx4brzMqrmoxjHV8/WhOzNa+K5YXTUx1WxZA+xiyUvMoUdC3aFqz5XUOQzErHLR2cXWWhccFbEXyrzTZY0nhB6XNeT72TNj1pSAMsRFPrBNB0PqP12TUhti7FJ9BEFMd9TSbEuK//XezAKzUKxYsIMwly58yuanlSrmZ9Kouxa5qeJZk1yy2dVc3nAniPFczxOWLGEwIuL/9teIXQDWsoI7eYe1OOFNi9v+Qcqxa9j6Rac4OQUczEGDBTdSI//OnrQRegk0jSO373KfkqjMKv8V+FMRZRlR9PqrT6qYxVfc61wZp78yj72VrVkg1ia2o+MRH5xmJlYZyA== 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=okL9VnPO8i9vqZ7LP3v6oWOx7k6OKnAwW70b5i26q5o=; b=DtJfeg+ltjyApeAaumaJnjFOtaYfCPFB7PZ9cn6FQfOKQuu8oSbqAG5mrEDHnDrCs1WWaAZfN1w8Tk77o8NrpJwwMMxcAUT4vyYmynpebP84gXenNzW3duq4HZBFY1zaoxJuxCBjnQjU85dsNzCsCL/rWcsT1AbXgPSIJ3cy4CPRCwCT0ZamAjrC+k3vnZJwlboxmaOAuTrFNG0xYgrAT7qNM6nXUTSH7Yx4xIO76Zn5zEk/cIivb79YChKhl8tZ020Fx49cACReFtSaSeTOLuatV4f/Uv82bcDG7hnVNTDvAQApqMznxSDhtKs48qAgIwFPwXJ/yi9Vpwr0unRgaw== 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=okL9VnPO8i9vqZ7LP3v6oWOx7k6OKnAwW70b5i26q5o=; b=GFJb1U2XAlJ2xLmmDT8zfbXNBlEEVwGndgoyfnGA2/QgAB2PO9HvQjEm7B7sTRX2sn57j4uT05Ee+waCFuZ2OixR9fRwOauDOVqqNPMx9X+kDiY1g2n0/T8qUEzyC3z3eMKhovQhW5+fAkRQS4WHddv5nDv+SHYB5Brq8bdpvYI= 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:11 +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:11 +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 Subject: [RFC v4 net-next 13/17] dt-bindings: mfd: ocelot: remove spi-max-frequency from required properties Date: Sat, 8 Oct 2022 11:51:48 -0700 Message-Id: <20221008185152.2411007-14-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> 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: f8f92a57-150e-44b1-f19f-08daa95e34d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h2/4aallhnQhRnPgM5nsrMdWOjOGLJHbWK3O7IWjdGn4hbRmzOZSIApALQCD3P87Upi/HaN8Itv+C5kTeuMqa3kOAdzHq6b91lI8YH+M9nWmetPN2v1HXIjYHX7bEsoPnORfIGGdLAVnPaccoVj2Xo/fNzD2xPVvDzGySctyto/dE+SxcqNdSNZy6Xrjkji5mOn+Lw7mlhOAuv4eONzb0Wc022elFZ8gXJYkbUah2+HjWct8PGRwJkvBeDxs9mOQF9IY8vnK4gIewVrXrMjE+H/hjcF+tMccuVWPwS5of3U9QjYvKvE5jC0B97iet8y2XGZ94TPaqlDZXvJKmGkkpwdA1WhTZ+XGfAjCzHkZ2QTOP54vGRxPfGIH5aCC6Rv0ZulCKsQeyrBrV//650Xu3VralSAuoin1uGyschdrNbZ29bNs25ju2ZQ7pLrcp+hoUB+OhfHOhI7BAhqJR+UhIFOJqEU0G4UT1simgQiO1x0AJXxIEY56X+RLP3d+7n5B8sHuqSb/d9MaWKho37Bdd6jko9qI6LfuTCcHL76F/ri4MOqDcCnqXheB5xpoDOlr5ammZ3RgAOr69S6s9pCVQ7GTILrEvINKQDI3AvSLzK6xCyIxpHx22h9nQg+ifYh2c+fTWVosCEv6LkEHMe23NOAaLD3I61d/IaePWS3R+1lq+oe+iKKEi+Ugyr2bocobUEOHsGHw5xVUbZuRedFx0j5OJ1RLTAQO8LTj+sqw1789atZq52LJAhxHPY0/ZVQGMggTYNyKsUxxAl3KivVv+w== 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)(4744005)(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: hFMNpFmpkTl89L+/bUJn3Nx0K0meytxsOioAFX6hdc7wVtXrdkiOS/K00vom9BSnEQrxOMOm0Itx7tN+oHTRsK4oN7DyCLb+jdkjsrmwqvM2RaWLyeu9JZMYdb0nsBqnPfslHrjKTergXF27DwURfa8ZMwnmb2J+Tj+q8CIa+pgOo1rCkxNDnjx1K+JQSdwFUsIro9IZzGftfej416zXpcA/vM9cvSTphS4pPs4Iajlu2KSR8qvtslHts7M0k94e9Nvpwne/UUW9zc1vfEIbjPlIIkiEEjBr9RA8TaM4de1CPhNVZ4I77Wq4Ka8mOkMeegvJWkRRltJTPyrmLhXaqh5FK4pfhtiren4q9+DbknKQbQkV9WnnNcMhrQlFjpxGnNm7j6XbvSKk/WC9eOhYQlmj1QcA7oMPEcX9TIS+jbLjN3SDgyrpDyUcNWm2k8xQDg3wZo2djjns9QQd5Vlzsw+G9dXGJL1dFBgE2sjVLAqymkFn1+lEFHLJyJcjtt/Hryss9ZtdgDnUpbhSUKWJDqq3DJLtdoCCbcFhz8Jh4N6ngKzxx+3iYmN0o0fi1COXBwR9uHAmD3BndlNJEWys7bB887t2Ktu2R9jHQE2jtTJ9Z/ACX2H1q9BAGE/iPVynAm8pNIOdURh7NAPtxP/viUy/l0M1KlfcXOUHv4iAvk1qQVNzXBb1ucJzsco0XgvMLPwfbEgfwXGHZ1wl6X2N9oYIs3PIHMcajqBnvkVNEs0f5r3f3ISsWyojASxLS7Kg7AOG4OEnBQZ4xZZq0zU4thGG5TEPtQHhnzt6Eck7cx0XA+phjd7OrA3MG+AoQKrOub2XZQ/yNe9pCsnUrvzhSuHtv+0ZaIhmPOpAnNZ4thw5Ad8VGVRpwPSohhso0ELcF8OsVY7s/YFaxFwdCNOncpBoK2FSjjv6P7aWDxPL8MCDlPlAeP1EoX6CvkHodemqBnNa3U1zif6ILxaJcyqew37Q1xanjDSxEG0i13FSWJDNRiGoES4TQLESzq6r2FfyyykHyBsCK8UEJiQm1xj5LSvCiardXVfliSCuaM6J1DD/RunghSGpoT/rxjktTecKqtnxT0GJSvhpRHEBTT1aDOmGoipCQznzxsdXkzl6v26U8d0InYEGsWn6gCP1e2CR1ITaTifnPMm2pRwyVb+4IYv57TMm6neRhJnnLe9H7Lbzv5KST08tbBucpGoueLU9VZm1ey+6xsF3FvfqaA6nYmB8uR3xVzD/gIcL+LG0HHy5hEAFD4lz3S/1TCoDqgfrFIoGk6Jow2uqijO2wa2Mylc15tFHT7pL/BfXt1YyenBkk4mbsDIGy38WcU/Bf2XA+IoZjBj8LkIk3dF7oBu4/Qo96PElKTXqS74XgiIlu2oHWI6dtXDpmJHUfPtRHpaD459J1/iR19mL+wLk2YZYW73F2DrTvv0jx7PU2Ox/bwothpVTqpCIu2s9MFcEOSw+TTLoQ2kgu7t0QLL1cxmM5engKE+Dj54bNIGjG6HuPFs0D4lVd1vJkJE9yrtZbdyNRKljyeILrA6tOW4AAQRrJOq9qQL0muB+pQ+dWuiXVWwKDMTSQ7EvY5pwB/V/Y/sKXrV7QlnBL5l1zQqW9J9eW6z2Qae08EBFRJJU3P4ivag= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8f92a57-150e-44b1-f19f-08daa95e34d9 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:10.6471 (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: /bkXZVTlQuGvglKFENrOZxLr0LakXjb+jVIT2vyGukC6yEDjkAXdfOnz+6edIa3GkG1FkCez29JfNooPXZgjSSCaqEmpYY8Gjq2g8RVIBho= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The property spi-max-frequency was initially documented as a required property. It is not actually required, and will break bindings validation if other control mediums (e.g. PCIe) are used. Remove this property from the required arguments. Signed-off-by: Colin Foster Acked-by: Krzysztof Kozlowski --- v4 * New patch --- Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml b/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml index 8bf45a5673a4..c6da91211a18 100644 --- a/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml +++ b/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml @@ -61,7 +61,6 @@ required: - reg - '#address-cells' - '#size-cells' - - spi-max-frequency additionalProperties: false From patchwork Sat Oct 8 18:51:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001856 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 E006FC433F5 for ; Sat, 8 Oct 2022 18:54:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbiJHSyx (ORCPT ); Sat, 8 Oct 2022 14:54:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiJHSxc (ORCPT ); Sat, 8 Oct 2022 14:53:32 -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 78288402C9; Sat, 8 Oct 2022 11:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HiwKxR57DOaLP7+gYvPUoC4ReJe6HTPCgDOZEzGTLJ/0uCL3mFhAywMyx7eyTlaAznK6UUuQIkh4uCeHihcSCIc9xgWSuAODyFErT0qv3WTe5VwwyY/CgqaFSpNPuzgKrH4ciboTymyVluE73Sw12GxZd2ueBqRP6ot5rgitFA26BYGh3juxEGAhHAZfkm0qaBiN4/d8o7byNRByFTpFjC2vle4QjjWIKth1rS5JstkctTIwzmXRQ28gdJWEbCLtAh3LqZ/8IyXrlpSvvMeamxoEIqRfEdA8pImG91NLCBquH2x8J9QPSZyFdsPJkSp7BsOnStu/fKbufyazfDjhhg== 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=ipgiLXPDFyxA0eZ2ZHTJPTiI4br7AlU490iR6iem6T4=; b=SL4lqcRt8nQA6aa5XyqUCfXy615kWGSK7j6ErUHVARUoKb9I3nXShQuSUsoj1G5W6BMSrWmA04dBMnN4L19EjjR6V0f2i4bo1yq1vak3MoQwFgAoce078CNuIXFKQmgK9KTxKLr86BXTXGJnsg4gy1WwIBw8O4upvbnyVEoW672dWIQiAEGW9LQl+rA3LBmuf3Ynd6LT62k8a4bwhrP19hzOwyduNGfojyNd6kXKPc/8v4D3duVbx61rkSZy2S345iRkEBeASMRWtDpNPPg2KsZnkqv3O16ipMTbZX4vEgWloTubyHNaTL2pIlY+/cCNePecDofaVDwuJxpFO5Gi7Q== 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=ipgiLXPDFyxA0eZ2ZHTJPTiI4br7AlU490iR6iem6T4=; b=y9E1boLAthKCbkuosUvTm/vyIuVzUnJrEXXkisipnv5wsHTEmSqtEHQbPIOSQ9GgnocLrdff0Ep2N9UUNVFsh8TJ6IW24o5SeE9Y4mM8heQrJMX/vZnY81ocj6OIfEKiP+8WU+rYJUm037FuVQuxfIjiXzb67r5RF6Y/IWioSzg= 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:12 +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:11 +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 Subject: [RFC v4 net-next 14/17] dt-bindings: mfd: ocelot: add ethernet-switch hardware support Date: Sat, 8 Oct 2022 11:51:49 -0700 Message-Id: <20221008185152.2411007-15-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> 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: 43c03faf-194b-4269-0020-08daa95e352b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C93U5a95nqQc+TfQbcjbTB5N8OQY6TATROj170u4X6kzueu7nMe5aZ0RZFytCSm3DToMNrO1CRYAfwt2kEcAyCXth4pCuBQOhbiDqO+4+tuUae2jyIDfRD0YBjfTN56wCuXn9PPhyWNmNIDQQLFPkqTDUId3OQ01iClXFqnjP/LKMAnCkxX46jps/NnDPyxRZRJCKGl+zNPpUaqcNw2RLnJWZkZVUZ0cj5UcCWaGPqaxwddv6mAn9lQaw7+VUBwn6x+43kv6TN7V2PJYvgP0Ayo12qv0/37cIyVUsMcg07b27awF+NQOyWh8afufsxwxPb7uhTXcDqC5KErSRRQwgG55XjyEyVW+/R1Ol0OveYXqwH93t1FSoHDt8dutnOCxa5o0NHxMwg560HEo76ZAdbDPt+jHwF49BwjtTCST0e0d7azYf5YB7AZVzrnYf2dwnBnw1K1Y+JTahbN3iY8SyurulDbE+LZ22Qgy3zEGNjGkF02l/XbKA0mVFkRKMD+AMHnhXoJt0ubup9I5yDM4ps4Lks/XpO4lxZwp6Wl0JXO/y236mWZCl8Y3rKpW/zZLIxroNI0A2ocqNOySFONVQiF18mkMP00T79dsn+XMP4JnZyAq3mXTNfSIg9wGjecxufN3fimrc6hCMuVGMM+P/XQeytBR6HV42zO379BED8BzXu++j3NwI0WDjOtONCfEQBjAKsg1YSX/DMINZRxBBDMTIZkmZzDrqWQ4Wv7P4LpQwT9c4SM3MsrSmbYOlTKAB0JMwMHBoeBhbYo9OujjqA== 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)(4744005)(86362001)(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: cKrF0TbP4xhZgfrqAbVpXynEvDQp2My9a6dwl06aL9d1xoRmzzIFjHHDAV0Eljj41hvHG6sFGXF31UkhQkPLv/q+T4gXaiCrTAL66t46JbM5EKvaEdrjMIAGXy3RAd/W315aXeA5aYAvuDN9kzxYHaqCg+pl5zPwQaLWt28xbEG4vAdCEszma8TcBY0V000n8IcGVS02Jupwav0UtCR2HuyW5m4ed+N7S/hf20MDfOFxQyaqV+EDjXbzynoVGuGwob0EcYvPcoaLLuBlMX0FDcqMdEEzs0DqLxDzXInlOqbI0CQVWpNO6KbTZSfLL5e6upMiU9aB3orL1XgdGZGi5mTryb6kU0otxHrqSCUrlVwBzD4z1YJ4zlYMUodqJMuCX5Uh2jk6PvhK2dnbGLftQfXLW0fAyXwgBfZDGY2UAiS6c0LxkO2RP02V+Zear/cqc3SirgZrqSSOP1HUdcT/f7sE5r2xuG5fqzU33dqJWO3OZd0AV3cCpVtulyqqTCUy4E49XYSDaoO5nbvmY10vsS4ETEeUou8gh7/IsefNRLj0kJmwLXvsRnVJb/eermAanOdjkWgVbnZRhdchwTz9T+DxR0JPZsj/4SuWDRRX2fipwiLeBFWUB4jvN3qg3GtCI+52Cjf7UfIZ1hSomR5dlNqZ+j8N3e68gHCJsQ6DIE5oIG2md2Ukr5D78V/QRoqXy48llTQi4DXl1NTN/AQgVnLkUJlasaqQJINt2tlyB/bCiidtSwYhKJUl0s/3KA+MzH3hJJx3mwqEB/gJSqEGUN4qPi+Ysk+afvodiiHOSrCbCsFK69kwQ+4GugKrLU86GyigZA/eQlwUe6oO8JD9D0Rgm5hMWUiMyS2e6N0vlo8yoEPLi0/16c2nf5upgaTyFe6s+iRteAFixKtWA12GRGcspukB50Jzh/GeaMZCbXo0yjl+GM/qOX1DvQjhMqoATmD4UaqpSlCp+X/1K9Qij7vWqqFSjPkUMhNalLYjryjRpuICOmR9G5HYxTpDa04wzCPYFl1nc6YsZJBVZK7Ve9CeDYrPQhzgs9NY4BSyeQlF2ElM4MR0/VD+0wgShlQdXl8vQHTUJbks4i1ipz/YU9RM5/raZTYgiahBgDHAASVMvaxpJSzPxaTHhl5xKaOHtVeqYkgH6lPZNrEJsRghUK3hdAiEKKE/8an7Lzv3obhrHyIcogLhxeH5o661EgKI7HoToC7L8G1AKA0lVARFBWK0ke328EcfoF+BhRS4YjeRc63FqBKzt0dxHHLXO5FNVxlSx4wKDoWrrJl8p7RaGpHactbD5U5EqcflTvmuDCmL/VWv6s2cgnJB9llyvuY1c6UhXckw6tMAKQVKjfA0Hr4bRMCnLvxzcQLWvSsyPWzjFy0i/Zmq3bPQIpsgXY0jCtNjbpeEPkmQUPi1KcPeWP6NAl+GzW0wmGwxVZTQPHsyR8tivrI67vyrSBrtoDoADBlJTkavi3eYlnvoLktTgq38dXZoy0Gp86nPjmNroJUEL6dpsopSXgxkndyBEKnsJORQIjzV0FxB2pwbf34mOUasg09QEDkvftVWF50S9oUI+fk0y8f4zIBR757U0cHjMOmwnki1BoouT+2JEX8I6KvtgykJTLNv618XcirZBP0= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43c03faf-194b-4269-0020-08daa95e352b 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:11.1939 (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: D6A055hEO8v8DSbpnn0Y8NrCdkypWRZXbLXjC8V81TRaQYa+fY8417JZjZcxqU6xVTzF+6QWRJWTb9IGLL8Fp5qowx4XXwM25e/8C/aoYmM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The main purpose of the Ocelot chips are the Ethernet switching functionalities. Document the support for these features. Signed-off-by: Colin Foster --- v4 * New patch --- Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml b/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml index c6da91211a18..9ad42721418c 100644 --- a/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml +++ b/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml @@ -56,6 +56,14 @@ patternProperties: enum: - mscc,ocelot-miim + "^ethernet-switch@[0-9a-f]+$": + type: object + $ref: /schemas/net/dsa/mscc,ocelot.yaml + properties: + compatible: + enum: + - mscc,vsc7512-switch + required: - compatible - reg From patchwork Sat Oct 8 18:51:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001855 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 2FC49C433F5 for ; Sat, 8 Oct 2022 18:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230023AbiJHSyt (ORCPT ); Sat, 8 Oct 2022 14:54:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiJHSxT (ORCPT ); Sat, 8 Oct 2022 14:53:19 -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 C179240558; Sat, 8 Oct 2022 11:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l4ETW4afVnC8Ij9vC+PlSqBJP7fZcNYlbzLafyFweSQXFgfgIK4nylS+2ceqSvClBMmgByPs1hc+FSS9nyrHLimxlu76uvGfVU6sgIaIV73TUe65j7LUHFNkP0hetED1hRqlBKOslAbfYGX0XYj3i0qSLEnLMULmvze3HdDdiW+XwdkCFfq/CT4YZZJBH12HqTpcop3wVuCj0jI+z5w8iSZUS7+3JuRU2jtAQIIzvpUAbK9tgsRw88aKpZI0hUiBM44VGiQw2kjV6Hxh3DnKXSbsPbatfibQLld3+tM/8CABsQD9Tc9z25cj2zV6ISRyUm5ay7VRJuEfdupxTt1dlQ== 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=26VpA92xAKD+cZaWdvqccDDCM9JYs2eQYIi+bHfkP4c=; b=gNFCbRH+As2RPjOuxQ60BEpP0uA7YngCxuJw5LSYCodWC9f66R9goEUDPYf6l1uBBnSQH0rzhe4JrYz4d2Hjs3IMmZ9IIclfZnSbFF8gKvUR+DbAnWZ2DxXose4iNPu3QW6xltEeTS46xB33XLr+iq/CkwTM4bVy7Opxe407mP47tPkb1hDe7qhDGrVOf39qIx1brHTlkNHERQU1ZQIy92JVms6ofmFnTUaQCPMPSKnbkT3y1ElKtPF2aCffCeJXjrZcpgTOq5Dnm9/sRxn4IN/GJsGFk8TwgFk9YQP0EXsAyn2MVeRGTP3XcYbR7QnDeHR2ci5YigvntuZJ8h3F3w== 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=26VpA92xAKD+cZaWdvqccDDCM9JYs2eQYIi+bHfkP4c=; b=iHbPAj+QigyODurN4xMpTiP0TgyjGw+dWXUO/32QkFL0tFaGwKUPlFMBoBb7fNKY6DMYxw4sL7QenBFoxgB67i0pq4LA1mV6SIUBHz3Lnf70ZKjvp84vp+ofLwHTkYAITAI1CcTdpQ5Giwt6E22KGNpPfZycCrGQmZZT499Ihxg= 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:12 +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:12 +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 Subject: [RFC v4 net-next 15/17] dt-bindings: net: dsa: ocelot: add ocelot-ext documentation Date: Sat, 8 Oct 2022 11:51:50 -0700 Message-Id: <20221008185152.2411007-16-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> 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: dc4dd732-f0ed-4596-ac51-08daa95e3579 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vqq18M3GayiX79Qla//LYEVQsSYSBVYisaDDvTEhd8ydOCqgMvi46F8YhdtOzKUpKsvGJHBW2yxLtHeogmfs5UPm+twTZZ/IUoV4I7lv6AT1L/JefAGcXcIORJ36yr+No4pf7xhdJepRjKIz2p15I3PXG1F61D0Emep9Nc4vxnk58/auSYHEyVpw8CDHx8V6Hhi9mDAd6sJ7ogd1r+hKLfcJF0yDcb1BOCYrHYfMg8GdMsLHfJoHWTfATjaXmz5QZUaWBEZvgCJuiiONd0yK63A9vW7Jjm+p4nGMmNdyANeEQDI/DwH+jzYw85rkpd7jc4KraZadyLgLuY6wuOrUZ9ccilQuVwwVz2n/6qQRi+4JSVxB/I+EYKYucYwzVhGan8sShb2uknQ4FoiwFNfdnU+fpaEcFPpeM2GSOOSiP1AC3eC8rnA0I9owj8Lrcr9OeEDsQzwDndU4GMpWENIhpwtAZrJpXid0oWH4iKQEELDnfIdkbg1pjpT7BSnz1IGXSaFvu3ZvIAEieIvufqCM2ngoywEhPEYkr/JC9vc8XAP9G6g5mUQdiTV2QrMkgQt/204n6Zl+E+hcTZA3d1nUGldvPN0oUpm7oUkZz/qd+AR48sEs2pCYqIk1MA3eYtJqQ4yoQop10yp6lgZElgJnwbv0aP4cHpyLfITapMCsn/7BLC+NA0Xa51qp2TgiKlRDO1WARkASHKVtOd2AZ412ZmfW8gsjZbVsisEl1wvPwL+10MfFaK5UXlTiyW+donNs 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: 264/04ooVpybNpOpN11XVRdCfoTJAI1l+Vb3gO9GWjxhjapL8EuAUTMQ9x34iDqTgeaiuRHN4FjWGW3S+b49SX8NDAs5iOZKN6lj9Rg8XBlxMSZASawBY618F10y4fDO+fD7a16WUP3yEvzjuAZPO8umqRDS2A/k26ierIPud4w5E3U4UJLnkMmOVJFS9x1HekSyLqfyK+SmPgmzHQbAOtchaWCo37L0sE2jBNVKrRB/dAq1vYZfyF99aWDORjkNsLZiJv4AWQ9Lo/rtVoYbcbECDdDrU2+N1W+LD5uVsh7PsodFOI7hCOmW1aPRj+dUSLp/A7bX4F8cfDleR1z8JwjUM7dvxlKfcp7uqVnuBumPWiY/Uz28g2gChdyet/RKU4mhZSi8tl+GEQtZW2/cdsfLB7nmoRT1LGsr117LFCIYRZNb5uT2kIESGHYSiWFb3P3+UZp03q3aQSUvACg8uml3qHqFbjWQjUEoYWAns4vVgdTRWj984Z3e8TS3jHWEHGJBEbnL1yuWl2DSbVde8WZxKT7PLbVqFn5oJyvYbcSv2BfQVETN4WGgrKYGheBaWNYSuzhykSxE9Vz38j5/AEGWZ/ntMREYPoFnHNztgoZLZeEyRyDfCuzVhOz625QUCEG7l2mY00RKdeheDr9fc/Klr0wDqLPvHQwT4sM7jehHQRzh8ZDpmMIfpSfsjY/yvS7x2f2HyluyuYn2Hqs2XdJTpo1ZqtONJ/SpePMiK1OOq4WR9DPvdzjtXRa+M3LLSnD9QKuvxs+0Mlrq2bqh3pDmXjT64/5K73yFfny9JYEsd5PMddvz/s6RZsnZTChT8rxIfvxw7aJnv1how2fU9EKJN2VjEK3RiNZb3L5JEqIchg7X6vTseOHScYcJTbsuCuzRRQAhYSX/IdktjLH/UY/ieTtBHmVMFgf2a9kIZq1eAQl235owj8oTsmWtwv5ykDqxWWoNrBQG6Xq1Trsj74nW0lZq6myhf5hLVgP2o0uKK/LJGskxlCZUFHS793dgVxm5Zjodp28WR88EjYuNODgJvymE10qC3l87nCYzA6+84ZSNdiRqLQIprIHvEuvmVUhHoEGegfqMczepda9RmqN4PxHhB6dLhUWxlD7VnVLjsK2uNXplIEtev0uHEnSA7zaaMBB2uQ2rfiO7BwMqzbjh+StcQ+qgSTLhYVql5z1sbtgq+/Hx0wT7UF1kInnGymaAZsVnV3sIX5Dlwm+ncAYJslLJN/t6Knib6E1ZfOQlhLbm/HhEm3Opr1Wt9OZm5pPGKBJStOZd9bx5p3JXdY8u1WBL2p1dlMSAWhIGI6MYFuT7lTh9JVcdMcAinVzCPMHKfqn1ERlK2LCtu7/1/XEhrqsB46EqZ8rN+Kja6tfYg1yD0pVGAznSEnNfaY6+zvPsw9XeOWoWt6RV2XtfVbJtB/vz3VvTk12uUSCYRhQnUBjEX/CiVSH0Je3X2wXmAy7j0nUygxKgUJ6yByHliV8bePhHz7F37Ebfw0IkLjseGgo3hSl8XMdgPyeYErNV16PKwuyefa8UEqKoUzSv4NN+hR9F0RGsC9IHvKXkYLuMRkYE26Kt7OwzMEmVXpoL6iy8Izhbms6rSFndvb29sdPqM64Q/0VUt96kjezfzcU= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc4dd732-f0ed-4596-ac51-08daa95e3579 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:11.7095 (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: jWKfRcM3ANODeWvHEUEc2YBKxhzTA1kzhn3qnQsVrVYHYmb6Yr1HnY1vuqMC0ALL8iDItyu7vGIrACtFjz3Te9DjFF0+2JF9I6LYB9ECS84= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The ocelot-ext driver is another sub-device of the Ocelot / Felix driver system. It requires a register array similar to the VSC7514 and has different ports layout than existing devices. Signed-off-by: Colin Foster --- v4 * Add documentation for all supported modes (qsgmii / sgmii) * /s/7412/7512 * Changes to match the VSC7514 device tree, including: - Replace ethernet-switch@0 to ethernet-switch@71010000 - Add all reg / reg-names entries * Add example entries for ports 4-7, which requires phy-ocelot-serdes.h * Add the last sentence to the commit description, which replaces the phrase "which currently supports the four internal copper phys" * Remove "spi {" node from the documentation * Remove "cpu" label from port 0 * Add "soc { reg = <0 0>;" to fix dt_binding_check warning v3 * Remove "currently supported" verbage The Seville and Felix 9959 all list their supported modes following the sentence "The following PHY interface types are supported". During V2, I had used "currently supported" to suggest more interface modes are around the corner, though this had raised questions. The suggestion was to drop the entire sentence. I did leave the modified sentence there because it exactly matches the other two supported products. v2 * New patch --- .../bindings/net/dsa/mscc,ocelot.yaml | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml b/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml index 8d93ed9c172c..8a73fc9dbcaa 100644 --- a/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml @@ -54,9 +54,24 @@ description: | - phy-mode = "1000base-x": on ports 0, 1, 2, 3 - phy-mode = "2500base-x": on ports 0, 1, 2, 3 + VSC7512 (Ocelot-Ext): + + The Ocelot family consists of four devices, the VSC7511, VSC7512, VSC7513, + and the VSC7514. The VSC7513 and VSC7514 both have an internal MIPS + processor that natively support Linux. Additionally, all four devices + support control over external interfaces, SPI and PCIe. The Ocelot-Ext + driver is for the external control portion. + + The following PHY interface types are supported: + + - phy-mode = "internal": on ports 0, 1, 2, 3 + - phy-mode = "sgmii": on ports 4, 5, 7, 8, 9, 10 + - phy-mode = "qsgmii": on ports 4, 5, 6, 7, 8, 10 + properties: compatible: enum: + - mscc,vsc7512-switch - mscc,vsc9953-switch - pci1957,eef0 @@ -258,3 +273,100 @@ examples: }; }; }; + # Ocelot-ext VSC7512 + - | + #include + + soc@0 { + compatible = "mscc,vsc7512"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0 0>; + + ethernet-switch@0 { + compatible = "mscc,vsc7512-switch"; + reg = <0x71010000 0x00010000>, + <0x71030000 0x00010000>, + <0x71080000 0x00000100>, + <0x710e0000 0x00010000>, + <0x711e0000 0x00000100>, + <0x711f0000 0x00000100>, + <0x71200000 0x00000100>, + <0x71210000 0x00000100>, + <0x71220000 0x00000100>, + <0x71230000 0x00000100>, + <0x71240000 0x00000100>, + <0x71250000 0x00000100>, + <0x71260000 0x00000100>, + <0x71270000 0x00000100>, + <0x71280000 0x00000100>, + <0x71800000 0x00080000>, + <0x71880000 0x00010000>, + <0x71040000 0x00010000>, + <0x71050000 0x00010000>, + <0x71060000 0x00010000>; + reg-names = "sys", "rew", "qs", "ptp", "port0", "port1", + "port2", "port3", "port4", "port5", "port6", + "port7", "port8", "port9", "port10", "qsys", + "ana", "s0", "s1", "s2"; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + ethernet = <&mac_sw>; + phy-handle = <&phy0>; + phy-mode = "internal"; + }; + + port@1 { + reg = <1>; + label = "swp1"; + phy-mode = "internal"; + phy-handle = <&phy1>; + }; + + port@2 { + reg = <2>; + phy-mode = "internal"; + phy-handle = <&phy2>; + }; + + port@3 { + reg = <3>; + phy-mode = "internal"; + phy-handle = <&phy3>; + }; + + port@4 { + reg = <4>; + phy-mode = "qsgmii"; + phy-handle = <&phy4>; + phys = <&serdes 4 SERDES6G(0)>; + }; + + port@5 { + reg = <5>; + phy-mode = "qsgmii"; + phy-handle = <&phy5>; + phys = <&serdes 5 SERDES6G(0)>; + }; + + port@6 { + reg = <6>; + phy-mode = "qsgmii"; + phy-handle = <&phy6>; + phys = <&serdes 6 SERDES6G(0)>; + }; + + port@7 { + reg = <7>; + phy-mode = "qsgmii"; + phy-handle = <&phy7>; + phys = <&serdes 7 SERDES6G(0)>; + }; + }; + }; + }; From patchwork Sat Oct 8 18:51:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001857 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 A225BC4332F for ; Sat, 8 Oct 2022 18:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbiJHSzY (ORCPT ); Sat, 8 Oct 2022 14:55:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbiJHSx6 (ORCPT ); Sat, 8 Oct 2022 14:53:58 -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 7B04F422FD; Sat, 8 Oct 2022 11:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PFx7nWZJwo3BzJEi6DJCdiLVw/itZWEEDZyrQ0yCJAmwmRgt0TRLO1ET22/d7PK0hVnvGHF6F5c6RyRcVomMHEzZPd7dYLpf1x+7Yx+klkACAN27oD5nxjF2ldreZsT/Dz62dyURt/yoVEvvaf6QhWSjAQrvdqn1lLNdea/SPGZSyXH07Bj2XhL9u02s6dzRJ6yTX+Yxq57CK7RLHyZfoOkDloa4JGaxkiSL4EvkTS4bbvaMu9aDJIe+BP7GehGrppWsMSsEjIuTdtySE8FlIoVLCWKAuD4r8Me/W35+nxpyRv8r4+YDZFFD4H0ysr0FtSPwPuAvZmheM61X+Tn7IQ== 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=kPXfZ6EcLhYgHEYlqt5FkHlGIt2b22r5aU0w6tD1g3s=; b=CJRbKkmbR1oQC/taHK17Q5GRVTv2O9Av1l0FCdfaO5/ZAnzcoYsHql8M0wZwXZLl+ngYnx94+RR3dVoQKysQAgsGRGz3Z4loT1FTPo0CYxPXHSODK7loghwjCNZBRKYNcWVsTyq+5fJ+vV8/LSXCw3qf7V592Z6/bPmwYIxnDZC0WFDwSXRc+mT5pgCsPMrLYWYx7mw4nCk0yQwyn5vlq+ETFnAu+VHpn3Wbi3mDBYwg8+bunwoJTa1OzNhm9FFFjEewxTKtJLcGGwtx7bBbFvETVmzM1An5uabPGfRYN3kJnLuN+5+LEFvl8eBhMI4DcSznUwTr141QIzOo9ZdpTg== 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=kPXfZ6EcLhYgHEYlqt5FkHlGIt2b22r5aU0w6tD1g3s=; b=AlcIJoXFgIhn/S84APUU8aN+DehMe/kFBUCVuZD8VNMqQCvsE0CoGRbu/vlXDv9FCHzIw47UH3O2yUEqCouuPKObin3hnTPM6QvoM7GBFEbTAWEIDTwNBXDp/8LzWT/0AJTKpZrz/V/M0Png8qZNW8QJulkgUlFgklxp54qhgoc= 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:13 +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:13 +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 Subject: [RFC v4 net-next 16/17] net: dsa: ocelot: add external ocelot switch control Date: Sat, 8 Oct 2022 11:51:51 -0700 Message-Id: <20221008185152.2411007-17-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> 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: 53b2ca1b-20ca-48a7-f642-08daa95e35c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jGEdreGmvOyci7Y8Vxtn+FuBmeCEVBZTe0viVhVwXuOnczHNVuXo59ND0kGa9yx7hd/Xkhb7rHqdvKQ6fclfQGc4BzuBa57Z0RKpyPpB/059A5KjEx2Tru29veATWUBIUNP809oSEi+uG8g16JOX5WTVT8PIz0wlPZKROeAwpsVPHZW1kvzDHnVgrBe9CDaIMZYbUDHI4utVMC/qx9bdEXLdLF6ps/cqVdVb3mj7CU9hK+T6ruFEJvHXLi28SJSWk31vR9BTZZDtKxwwRIf4wUThpoQKPvlJnYWFCJdqLzmXM0n21T7RceNPTpTHRRKEwYIdZdOe8VQHttduPCvclKKjxRY9/KjGpLvMRQvfS/e18WlOi6Yo1/UVCdO7LxeAzIo7B3FqdzoE2XF0AZfydwzro+HWrpCa+8A5+vf073L5cnsnTsvzRkRk2wUygDO3f/zJboMLAU2kbZUS9t3LOnIx9pYHLOAEdf1+NUmpRIeuYalO0Q9UZlQzaLYNZPTxvl8Igji+B0iC8EMy4jZzyflTXjJOl6NLlY2CTXY9Op6HqpFhsfBzTgzCg0mlkurDHnPF6bjE09ANHOngwlhQiZiaQMDEJn6tj6q9pxmQhYERX+xhx01pI2cKNM0DVMDB6lZw8faYYyumRBsdgLU0lSey6M3VmmBazwfb6M23nXTU4Gh3tPKjoQhF8aWIL3ZQgIWJbhudycHeppFfQOww0kSTQJzcz4wclZPlAXJj2AVSoN7tG8bWElss1bIZeqhppnEzAB4ZQGWCTI/cJokGvw== 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: +kzoSs6m9qHOktNvwjFYZhXirUpBwHg/rJ7erG3oRePW6EOwlvnNvRWTNh93WGr94f8aJuuQxZnPsIKXYSGU9L9iB69QH2DToBgkoGlrwD09+Hgivo0PvI7FSUx0++bWRW3viwxeVQLUbrf9cLEzpt0SrN5YVNIFM6H1pjsE4zU0GcXvWzZvNy8+Uu+ExAcJKvmhGo5ihBLA6WHs3rtZdO+qsg+Ct9DqJSjXtdcFiDJvcjlFpTsjiUgDNWOeu6opR8R3LRmUTpvm6KZyRWb33mj4I9QfGySSPR/ljp1+eSOrrjTOJLxKhJCU2U8R9aRs8mM+kONWAS0O0jH7t0sfpEE+keN21D4sl03GS/2f+jrdE6xZYNGs4nWH9R8FDp++NW6HN2HxMeFCGXtzNdBZmZbbubTA3uqqL4oMtreHL/UZbZ/BGudACei1IppqZ3j5BTZedZGZ8rHxQ3pqQHiNrUPmXg5R4R2Igrz6SGxL7X3Cy/hQRmfowZqPnVMpBtJgqJ0YxEwzo4h8jXHRh03Sq+bkFA+XcZqEeuxBQVB84QcGbJADQhbxIz0NZ3lnRNmvkvVPt1qd6gcGp2xOxFlXXMdfKDPUscMa9n+QlP1Ed4h6e8EykJAiKFJl1h8Hal16/IAnCI22xbQ33YyyZp0XG905vVWql/sgWKVdqRcAxIRCutK1gH6JYoZUvmpGr9QF6JMwiyT/cRilj6lr2mvGw/P7lHHmokBO+E+nP7sw4JL3FQBEHTqGgkoHy6aH/5SVWqjgJLSPebvX7+aRZmraGEgOFFuGIP+kGOv+zhmRNazvqbYkgt381piXDAA9nObsmj560qkZ3qAe4Nfh8o9WD/au0IQQ4uVE3VR7GdBOZKyTuAq7zIA8BmXtsm+I9OT5LtHMbITK58voGRGKM35Rrq+zutZvXCY8BvtLdC1MB9t8U2y0BApmoXtWsvxZvkuDrlhNmrOW/Ir9/GThO04/PUd1F1YsqTZvDvqf7Bziel+IuqBKvza+YA1hFiSpOJOpUBe9j7Kg0V+MXIvw+nWMgqv+WoHfXY7BHjwxhuFtXogsIO2XJ9vRa6CAzTJNymeyQVJUNhr11oLoVeE++ZGjysReCF5jwyKmLdZq+JYyfDXfSnBaNKBpIz6N8ro6q0voIgVq/R5swyRNNsB8HvHEK0oWeViU713QQuoxl3MIby4oLKABJQwkBsKLZ2vzCLsX9qlRMbv8/WKP7IfOeWX8O7Aw+YxazkpJkwTCFxR3GDbhAeVsAIODxm7kZ5X1u+OaEZWrCW2AHs/VjrZ5Ok5bKNGMFi2/fCpwu/nBJO/kyQrjv/ppEYxIogl5uRQtrrVITHxXfapJTpnKsLi5lAK/a1GXp9XoGmVOhWWcHL+4pu3sxxob3L65VrsypHcEtc2Hw7kxXNLVkYy6fu+9s9SbcAbJBF9ielajKvMdYAD9CGnV0QpehRPq/Kf4xsxE5qkDMcBDOHID8zQuAxeP+QRjROIp9bsPAzXLL+08bKt5RCDyKOBQAg5o+7O7EBfMX+8R341ZNtO88FnPHb5yg+hW48Ftrw2qReZok0mo6bxV2Y8rS4lss10LLySEhmPSaEXiNwSLxS/vulNLaGG5JsrI6vKBRfK7w6YLetwcaCpGiVI= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53b2ca1b-20ca-48a7-f642-08daa95e35c5 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:12.2094 (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: 0vyQj0G7ErD2Qxs1VozuViR3vmYTwYkTHhdz3Y6HcaWTWGxDYMk2lJjhwbcljRulkROyVG+DztdTaFApLVhouMGlVi241VLFeuf76L6FriI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Add control of an external VSC7512 chip. Currently the four copper phy ports are fully functional. Communication to external phys is also functional, but the SGMII / QSGMII interfaces are currently non-functional. Signed-off-by: Colin Foster --- v4 * Add forward-compatibility for device trees that have ports 4-7 defined by saying they are OCELOT_PORT_MODE_NONE * Utilize new "resource_names" instead of "*_io_res". Many thanks to Vladimir for making this possible. - Also remove ocelot_ext_regmap_init() function * Remove dev_set_drvdata(dev, NULL) from remove() to match other drivers v3 * Remove additional entry in vsc7512_port_modes array * Add MFD_OCELOT namespace import, which is needed for vsc7512_*_io_res v2 * Add MAINTAINERS update * Remove phrase "by way of the ocelot-mfd interface" from the commit message * Move MFD resource addition to a separate patch * Update Kconfig help * Remove "ocelot_ext_reset()" - it is now shared with ocelot_lib * Remove unnecessary includes * Remove "_EXT" from OCELOT_EXT_PORT_MODE_SERDES * Remove _ext from the compatible string * Remove no-longer-necessary GCB register definitions v1 from previous RFC: * Remove unnecessary byteorder and kconfig header includes. * Create OCELOT_EXT_PORT_MODE_SERDES macro to match vsc9959. * Utilize readx_poll_timeout for SYS_RESET_CFG_MEM_INIT. * *_io_res struct arrays have been moved to the MFD files. * Changes to utilize phylink_generic_validate() have been squashed. * dev_err_probe() is used in the probe function. * Make ocelot_ext_switch_of_match static. * Relocate ocelot_ext_ops structure to be next to vsc7512_info, to match what was done in other felix drivers. * Utilize dev_get_regmap() instead of the obsolete ocelot_init_regmap_from_resource() routine. --- MAINTAINERS | 1 + drivers/net/dsa/ocelot/Kconfig | 19 +++ drivers/net/dsa/ocelot/Makefile | 5 + drivers/net/dsa/ocelot/ocelot_ext.c | 178 ++++++++++++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 drivers/net/dsa/ocelot/ocelot_ext.c diff --git a/MAINTAINERS b/MAINTAINERS index 9ca84cb5ab4a..15593f0dd128 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14751,6 +14751,7 @@ M: Colin Foster S: Supported F: Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml F: drivers/mfd/ocelot* +F: drivers/net/dsa/ocelot/ocelot_ext.c F: include/linux/mfd/ocelot.h OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig index 08db9cf76818..74a900e16d76 100644 --- a/drivers/net/dsa/ocelot/Kconfig +++ b/drivers/net/dsa/ocelot/Kconfig @@ -1,4 +1,23 @@ # SPDX-License-Identifier: GPL-2.0-only +config NET_DSA_MSCC_OCELOT_EXT + tristate "Ocelot External Ethernet switch support" + depends on NET_DSA && SPI + depends on NET_VENDOR_MICROSEMI + select MDIO_MSCC_MIIM + select MFD_OCELOT_CORE + select MSCC_OCELOT_SWITCH_LIB + select NET_DSA_TAG_OCELOT_8021Q + select NET_DSA_TAG_OCELOT + help + This driver supports the VSC7511, VSC7512, VSC7513 and VSC7514 chips + when controlled through SPI. + + The Ocelot switch family is a set of multi-port networking chips. All + of these chips have the ability to be controlled externally through + SPI or PCIe interfaces. + + Say "Y" here to enable external control to these chips. + config NET_DSA_MSCC_FELIX tristate "Ocelot / Felix Ethernet switch support" depends on NET_DSA && PCI diff --git a/drivers/net/dsa/ocelot/Makefile b/drivers/net/dsa/ocelot/Makefile index f6dd131e7491..d7f3f5a4461c 100644 --- a/drivers/net/dsa/ocelot/Makefile +++ b/drivers/net/dsa/ocelot/Makefile @@ -1,11 +1,16 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o +obj-$(CONFIG_NET_DSA_MSCC_OCELOT_EXT) += mscc_ocelot_ext.o obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o mscc_felix-objs := \ felix.o \ felix_vsc9959.o +mscc_ocelot_ext-objs := \ + felix.o \ + ocelot_ext.o + mscc_seville-objs := \ felix.o \ seville_vsc9953.o diff --git a/drivers/net/dsa/ocelot/ocelot_ext.c b/drivers/net/dsa/ocelot/ocelot_ext.c new file mode 100644 index 000000000000..1340b017e37d --- /dev/null +++ b/drivers/net/dsa/ocelot/ocelot_ext.c @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright 2021-2022 Innovative Advantage Inc. + */ + +#include +#include +#include +#include +#include +#include +#include "felix.h" + +#define VSC7514_NUM_PORTS 11 + +#define OCELOT_PORT_MODE_SERDES (OCELOT_PORT_MODE_SGMII | \ + OCELOT_PORT_MODE_QSGMII) + +static const u32 vsc7512_port_modes[VSC7514_NUM_PORTS] = { + OCELOT_PORT_MODE_INTERNAL, + OCELOT_PORT_MODE_INTERNAL, + OCELOT_PORT_MODE_INTERNAL, + OCELOT_PORT_MODE_INTERNAL, + OCELOT_PORT_MODE_NONE, + OCELOT_PORT_MODE_NONE, + OCELOT_PORT_MODE_NONE, + OCELOT_PORT_MODE_NONE, + OCELOT_PORT_MODE_NONE, + OCELOT_PORT_MODE_NONE, + OCELOT_PORT_MODE_NONE, +}; + +static void ocelot_ext_phylink_validate(struct ocelot *ocelot, int port, + unsigned long *supported, + struct phylink_link_state *state) +{ + struct felix *felix = ocelot_to_felix(ocelot); + struct dsa_switch *ds = felix->ds; + struct dsa_port *dp; + + dp = dsa_to_port(ds, port); + + phylink_generic_validate(&dp->pl_config, supported, state); +} + +static const struct ocelot_ops ocelot_ext_ops = { + .reset = ocelot_reset, + .wm_enc = ocelot_wm_enc, + .wm_dec = ocelot_wm_dec, + .wm_stat = ocelot_wm_stat, + .port_to_netdev = felix_port_to_netdev, + .netdev_to_port = felix_netdev_to_port, +}; + +static const char * const vsc7512_resource_names[TARGET_MAX] = { + [SYS] = OCELOT_RES_NAME_SYS, + [REW] = OCELOT_RES_NAME_REW, + [S0] = OCELOT_RES_NAME_S0, + [S1] = OCELOT_RES_NAME_S1, + [S2] = OCELOT_RES_NAME_S2, + [QS] = OCELOT_RES_NAME_QS, + [QSYS] = OCELOT_RES_NAME_QSYS, + [ANA] = OCELOT_RES_NAME_ANA, +}; + +static const struct felix_info vsc7512_info = { + .resource_names = vsc7512_resource_names, + .regfields = vsc7514_regfields, + .map = vsc7514_regmap, + .ops = &ocelot_ext_ops, + .stats_layout = vsc7514_stats_layout, + .vcap = vsc7514_vcap_props, + .num_mact_rows = 1024, + .num_ports = VSC7514_NUM_PORTS, + .num_tx_queues = OCELOT_NUM_TC, + .phylink_validate = ocelot_ext_phylink_validate, + .port_modes = vsc7512_port_modes, +}; + +static int ocelot_ext_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct dsa_switch *ds; + struct ocelot *ocelot; + struct felix *felix; + int err; + + felix = kzalloc(sizeof(*felix), GFP_KERNEL); + if (!felix) + return -ENOMEM; + + dev_set_drvdata(dev, felix); + + ocelot = &felix->ocelot; + ocelot->dev = dev; + + ocelot->num_flooding_pgids = 1; + + felix->info = &vsc7512_info; + + ds = kzalloc(sizeof(*ds), GFP_KERNEL); + if (!ds) { + err = -ENOMEM; + dev_err_probe(dev, err, "Failed to allocate DSA switch\n"); + goto err_free_felix; + } + + ds->dev = dev; + ds->num_ports = felix->info->num_ports; + ds->num_tx_queues = felix->info->num_tx_queues; + + ds->ops = &felix_switch_ops; + ds->priv = ocelot; + felix->ds = ds; + felix->tag_proto = DSA_TAG_PROTO_OCELOT; + + err = dsa_register_switch(ds); + if (err) { + dev_err_probe(dev, err, "Failed to register DSA switch\n"); + goto err_free_ds; + } + + return 0; + +err_free_ds: + kfree(ds); +err_free_felix: + kfree(felix); + return err; +} + +static int ocelot_ext_remove(struct platform_device *pdev) +{ + struct felix *felix = dev_get_drvdata(&pdev->dev); + + if (!felix) + return 0; + + dsa_unregister_switch(felix->ds); + + kfree(felix->ds); + kfree(felix); + + return 0; +} + +static void ocelot_ext_shutdown(struct platform_device *pdev) +{ + struct felix *felix = dev_get_drvdata(&pdev->dev); + + if (!felix) + return; + + dsa_switch_shutdown(felix->ds); + + dev_set_drvdata(&pdev->dev, NULL); +} + +static const struct of_device_id ocelot_ext_switch_of_match[] = { + { .compatible = "mscc,vsc7512-switch" }, + { }, +}; +MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match); + +static struct platform_driver ocelot_ext_switch_driver = { + .driver = { + .name = "ocelot-switch", + .of_match_table = of_match_ptr(ocelot_ext_switch_of_match), + }, + .probe = ocelot_ext_probe, + .remove = ocelot_ext_remove, + .shutdown = ocelot_ext_shutdown, +}; +module_platform_driver(ocelot_ext_switch_driver); + +MODULE_DESCRIPTION("External Ocelot Switch driver"); +MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS(MFD_OCELOT); From patchwork Sat Oct 8 18:51:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001853 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 60E24C433F5 for ; Sat, 8 Oct 2022 18:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbiJHSxY (ORCPT ); Sat, 8 Oct 2022 14:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiJHSwY (ORCPT ); Sat, 8 Oct 2022 14:52:24 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2097.outbound.protection.outlook.com [40.107.96.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 713B53FD6D; Sat, 8 Oct 2022 11:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k+xE2HsnaV/aMZq8RY2TJ2cdkUC5KfC+SEscpel/In8MnMyuRqWwq0OjP2zrKm9v4OZzHRwr1evd+O/MoYAsElCGAQpZdKuDPtRR2tZQe+W3+6aMewf/0h3dZPLGME9bieeWJmLpNia2UK/BVsmb3/cVLWPqlwcRH2nQ00aqXG+7ykIdBeAWdz0mEFKLf+8utBuBQZMfRnh0x4ZatZoCy/WifLD5upEyCqQF8bozaDQ+9pqDrEd5+edfY8vU3LTEL7nyNNqLV08JZAK/U85v7oupDfHjtmldE/c3OaVLtqXOmwN45ZMTEP4tavEXPZyDOKxE2BYbmvgI2YljtCN18Q== 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=td9QZP8dox8JlZXIYio4EV+Ev1mj2gxb8N8BrwL0F3M=; b=EoYYIl3vY0lhSrqPCOAKfkVlyKjKFoAGjKZipuvBXEUDWeJIDv7sSkjvkVatn5kMhCayc80AfxNvV7aGMARhxcIEp9yOuUaybFTYAL3IbpeTjYt31wvyijr+K91pPvG23J33PDeNPZLdME3BEyLY2DDfMbgjAD5KSsbRvAF6SjT5PxKlYDw0VMpFs2RcB9i7fqw9oVZF8Bd22NMjHVtvG31e89mHeUHs5IdC9aZuUYeOQy0ukrYdLmAkRhwAvz4+FkIaTUB2vmePYOXOx8UWrr9F17rFvjzS9fF9H4RrBJ0pyboVUEGr9vk5cv4t0HCMbvmEckm83BGeU1Z+xojYqg== 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=td9QZP8dox8JlZXIYio4EV+Ev1mj2gxb8N8BrwL0F3M=; b=hTKcN6PonxcNajPogoWJ2lnqpRcIyDMvnOuQI/h4Mk1rTlrCXoi7D9bcIuEFjWX8265AfQK1TclAL/JW2TGvJUKACSX90J5z1/c57XyJA3DR5voMAC1B8oIs24dei5idf0KOE1/3FgE+H15xywSqtrUoYOASOEoRX5MRxrifMoY= 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 PH7PR10MB6506.namprd10.prod.outlook.com (2603:10b6:510:201::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Sat, 8 Oct 2022 18:52:14 +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:13 +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 Subject: [RFC v4 net-next 17/17] mfd: ocelot: add external ocelot switch control Date: Sat, 8 Oct 2022 11:51:52 -0700 Message-Id: <20221008185152.2411007-18-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> 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_|PH7PR10MB6506:EE_ X-MS-Office365-Filtering-Correlation-Id: cb37ee54-4735-41c9-04ce-08daa95e3617 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6aXf5tkYEfUxk4GvMt4Ta91qEfUpFLY//1vlQYoTuUtWWAAAzl0RdGj8KUk401b8Bmg5S7QW9grjieKEtF4N9XrT3W2C3PyNXm0mx9uN8TE2MNaYRvL7cfTzBQdlEybZeXYizsM5CSlylHr9rEe5lqBdNOoOAaJvRMh3XhyjrYKfqBexjU518ata2vVEAgoEBfPYVgIrEaCAerxIVJTXciztpEfvy6lSQREgxcO/vi6YyUlLI/6J/BJItgV6uBlzxnFVdXbNPp4VOCwoNYFspQqu/O/HY+TbVC6utKd1MoRk+hWjnhK2mbEJ7wbC0SVw0srtO7YqcH2kzVgEzTij99VBmWioLiB/v/nk7kxJTyfZafKIclSwCxD6Y0/14KddmSvPZGC1VDbWz+7G+q5YM0JAAjjGnfkhl8zurH5PHAAIezk394lCg0h/XOhnW8s3xK3RMaX3l7GeO78fzVDWykCNy+el2BXOTfunpopWYddclHVXXmtGcQsNdHCpKBwWjvOvnbz5yxOomGyyTO6woidxCPEMzE+MjpS8NQnNiJmisGF7KodWC0ZsxQ7nqo0cdLhNToaM82kNSProW0xsZDAq7Gvict/ECXx3MPj0L0J3T5NP/smZ80mMgK00mCyUsnRiva0VImg3er86KTTRKGa8fG9ErLMHwtqzIKupQMQidslKe11dYc33zGiUQzzJTQlJqF0NNT661GoYjUU9QKF9IfyPiDBsBHEe65zI//Fpo3IVaAx9SZvMTyyJvryL7vBURVSM7SmLQcs2cSbERw== 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)(366004)(39840400004)(346002)(136003)(396003)(376002)(451199015)(26005)(41300700001)(6512007)(86362001)(1076003)(36756003)(2906002)(186003)(66946007)(66476007)(4326008)(66556008)(2616005)(6666004)(8676002)(6486002)(38350700002)(478600001)(54906003)(316002)(6506007)(52116002)(38100700002)(5660300002)(44832011)(7416002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sjr42qKEc+jBc7gZd9D23XgRt5agneV7yJtW5jaD8Pv+8+neY0MXTabykVYFlb3DV0N3MYGshiaub+rItoozs2M6hZerre25eVEQIFOykIqKJgqUPYl/geOkDdwEey+ueRIy+jVGQRrD/cABr7b4QcJofFDQpNiNFUxRs6gwmI2jW5zvXiGMlZ37yz1EWFzfFsr+n/fd1V1FReaQDLX0Kfrjvv/Zs3rQwhTbya1eOZckVXIkTjC0AgNhVHLI7lSaGWqVWDDjkpSK1ThzgdQe+doU/vGPcGLY8yKAAxUhInJTnMv7CBHfMrUBOM7ssOLrM9LS2WFR04prU1mZVRi03MfDpwE+5zKhoBx22lCIKVwP3vwu4JEjNkW0m3TU06k7KI/mQWeinlNjdorPKpJX8opcZsnBn2WZWjTb0lp+krURwWSAx5mMNrBi5uVboLkiR+uBrFPYzzeay+0v/E4D66r0Oa8bTxMMKG3JcJFohrRgOEJFjgZ5eVtqLA5aGXeKwo0VKW/lXEVV8gVf3Wmn1kGJQgMLNmCCV1JQoBYzJoe1gCY1nLQjXo4VQJSyotxIGYsMeItGM/PgtV5CV/kC7m8p3fvcLMPprZ0lPxnyBZkSborypuY+tr6XKZN73f8qSiDjoBSQ/a0bEeIf711wXi1I0u5kLY4G43fkKs8uTaoaTM54ZfyoGjfZvMbVJ4GkkyAoM8mGJpy6m/F6DkVSfWCjShMydrnyiPfqjO0pG/95o+OFXnTWvQeppAxAvdP9m/HJNy5a485T1rAdlLl3jPCKVH6WG9PsGUjGY1DwXS4KncNkScqAgUO6f3K8/PNy1y7oyWFSo8RYSsnA9pFVwajOc2S332ITMSWM9CI69NlE+5VP8mLKTkds/dDVPm5iaSvYDeqXZtWom/yRemxyhDbUZw8MhZ6sAAjm3Y3Sd7Jd2yt9o6Q5kyFFZoWSu+GXHtptnvMeNAm7o/fG3bFih9wb6Oz4MV/vWAiXP6lD3gQpZfM+TT+jz0WGFuEDs8Qy5sbDgZ8yBfYNGWuNogKEz+bJ3ks/TsYfV9N3ZnI1WbxVt7STdAKG18y/EnE9ei/jeBOAxvOv2R2jL/bbYjC3uMELkqJpMlr1yGQwnFF+HUh4CmNU37r/ymAadeLIT8P2xxrnQXSGW3yFCQ8fzPKPtBXRVoqJJV5SpeFhyw7/4c2wdeU7GdJwG0Xa1kZ/k0hwUwzdr5psAyTBrzOxJjtGn2mGSy7obwJ4CkQfJuYfX9gXypY93fkfFhwWMnpC/k1ABMciW+BlbsUgnhguUl4gIEFkbf0AMjah5ceO4OwQKFpHqg+tBDbtbG4q3XW4n5gLEvsxgBvv1QjcdPcWQhL7M0o7Ufo25KScSDokWtlZuuZktTCk8kYJ19ut2gMuMwwIkJFPWRnvsTILJ1k6s9zaTN/9odLldj6XFD9kRcWKCwKCYRGqRLh1vsYscJgK3yqw/A/roLSrNmOqy1AAJ1J7qBdZDF/Q3GTO3gHD/WduGRV+4r0Tug0uPcB025zvZhE7e+Bdg2hogNQU/H5Nz3/aUTxGs/w57gW4/d1syUeR1mwvy1CIqCi1hqBdxfkmY1zwNNLnPHVQ71jGCcIO/o24YqQ/Qbw6+WhuV83++9ZEtNc= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb37ee54-4735-41c9-04ce-08daa95e3617 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:12.7250 (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: POAsih8R0JdjLru4JnSQ2NUyADEqmRNMkFqzmGB4LOyGXinWfdbBCSPmcW90dNbjYfkUXMP4NEW1ONMC0l8y6Gk+fT8PcF5gJAKKPHqkPzU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6506 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Utilize the existing ocelot MFD interface to add switch functionality to the Microsemi VSC7512 chip. Signed-off-by: Colin Foster --- v4 * Integrate a different patch, so now this one - Adds the resources during this patch. Previouisly this was done in a separate patch - Utilize the standard {,num_}resources initializer v3 * No change v2 * New patch, broken out from a previous one --- drivers/mfd/ocelot-core.c | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/drivers/mfd/ocelot-core.c b/drivers/mfd/ocelot-core.c index 013e83173062..f35b4b2d4eec 100644 --- a/drivers/mfd/ocelot-core.c +++ b/drivers/mfd/ocelot-core.c @@ -45,6 +45,39 @@ #define VSC7512_SIO_CTRL_RES_START 0x710700f8 #define VSC7512_SIO_CTRL_RES_SIZE 0x00000100 +#define VSC7512_ANA_RES_START 0x71880000 +#define VSC7512_ANA_RES_SIZE 0x00010000 + +#define VSC7512_QS_RES_START 0x71080000 +#define VSC7512_QS_RES_SIZE 0x00000100 + +#define VSC7512_QSYS_RES_START 0x71800000 +#define VSC7512_QSYS_RES_SIZE 0x00200000 + +#define VSC7512_REW_RES_START 0x71030000 +#define VSC7512_REW_RES_SIZE 0x00010000 + +#define VSC7512_SYS_RES_START 0x71010000 +#define VSC7512_SYS_RES_SIZE 0x00010000 + +#define VSC7512_S0_RES_START 0x71040000 +#define VSC7512_S1_RES_START 0x71050000 +#define VSC7512_S2_RES_START 0x71060000 +#define VCAP_RES_SIZE 0x00000400 + +#define VSC7512_PORT_0_RES_START 0x711e0000 +#define VSC7512_PORT_1_RES_START 0x711f0000 +#define VSC7512_PORT_2_RES_START 0x71200000 +#define VSC7512_PORT_3_RES_START 0x71210000 +#define VSC7512_PORT_4_RES_START 0x71220000 +#define VSC7512_PORT_5_RES_START 0x71230000 +#define VSC7512_PORT_6_RES_START 0x71240000 +#define VSC7512_PORT_7_RES_START 0x71250000 +#define VSC7512_PORT_8_RES_START 0x71260000 +#define VSC7512_PORT_9_RES_START 0x71270000 +#define VSC7512_PORT_10_RES_START 0x71280000 +#define VSC7512_PORT_RES_SIZE 0x00010000 + #define VSC7512_GCB_RST_SLEEP_US 100 #define VSC7512_GCB_RST_TIMEOUT_US 100000 @@ -96,6 +129,28 @@ static const struct resource vsc7512_sgpio_resources[] = { DEFINE_RES_REG_NAMED(VSC7512_SIO_CTRL_RES_START, VSC7512_SIO_CTRL_RES_SIZE, "gcb_sio"), }; +static const struct resource vsc7512_switch_resources[] = { + DEFINE_RES_REG_NAMED(VSC7512_ANA_RES_START, VSC7512_ANA_RES_SIZE, OCELOT_RES_NAME_ANA), + DEFINE_RES_REG_NAMED(VSC7512_QS_RES_START, VSC7512_QS_RES_SIZE, OCELOT_RES_NAME_QS), + DEFINE_RES_REG_NAMED(VSC7512_QSYS_RES_START, VSC7512_QSYS_RES_SIZE, OCELOT_RES_NAME_QSYS), + DEFINE_RES_REG_NAMED(VSC7512_REW_RES_START, VSC7512_REW_RES_SIZE, OCELOT_RES_NAME_REW), + DEFINE_RES_REG_NAMED(VSC7512_SYS_RES_START, VSC7512_SYS_RES_SIZE, OCELOT_RES_NAME_SYS), + DEFINE_RES_REG_NAMED(VSC7512_S0_RES_START, VCAP_RES_SIZE, OCELOT_RES_NAME_S0), + DEFINE_RES_REG_NAMED(VSC7512_S1_RES_START, VCAP_RES_SIZE, OCELOT_RES_NAME_S1), + DEFINE_RES_REG_NAMED(VSC7512_S2_RES_START, VCAP_RES_SIZE, OCELOT_RES_NAME_S2), + DEFINE_RES_REG_NAMED(VSC7512_PORT_0_RES_START, VSC7512_PORT_RES_SIZE, "port0"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_1_RES_START, VSC7512_PORT_RES_SIZE, "port1"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_2_RES_START, VSC7512_PORT_RES_SIZE, "port2"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_3_RES_START, VSC7512_PORT_RES_SIZE, "port3"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_4_RES_START, VSC7512_PORT_RES_SIZE, "port4"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_5_RES_START, VSC7512_PORT_RES_SIZE, "port5"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_6_RES_START, VSC7512_PORT_RES_SIZE, "port6"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_7_RES_START, VSC7512_PORT_RES_SIZE, "port7"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_8_RES_START, VSC7512_PORT_RES_SIZE, "port8"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_9_RES_START, VSC7512_PORT_RES_SIZE, "port9"), + DEFINE_RES_REG_NAMED(VSC7512_PORT_10_RES_START, VSC7512_PORT_RES_SIZE, "port10") +}; + static const struct mfd_cell vsc7512_devs[] = { { .name = "ocelot-pinctrl", @@ -121,6 +176,11 @@ static const struct mfd_cell vsc7512_devs[] = { .use_of_reg = true, .num_resources = ARRAY_SIZE(vsc7512_miim1_resources), .resources = vsc7512_miim1_resources, + }, { + .name = "ocelot-switch", + .of_compatible = "mscc,vsc7512-switch", + .num_resources = ARRAY_SIZE(vsc7512_switch_resources), + .resources = vsc7512_switch_resources, }, };