Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp1288716pxb; Fri, 13 Aug 2021 19:52:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLI9xdvM9sML3tHP0BQROXez4n+9dIyFYWNZ6x/6549utCRrE91OeVJs00fQtbE7eg8w+7 X-Received: by 2002:a92:cb48:: with SMTP id f8mr4041452ilq.197.1628909539513; Fri, 13 Aug 2021 19:52:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628909539; cv=pass; d=google.com; s=arc-20160816; b=XlL9Cwgq+GxmOQWXAs3uvpl0wgiZEpaJPydM1nm1QIPnWvJnQn7gVVPduDtrSIoA// 4W1GoJH6BL5Zt0nY4jx1jvio2xSwNcvLX23uTFfFSynDR8Nk1oyUyfnNrsFmwmdUgdoY 5f6fYHyDgUZbyfhmvsbLx4APh6UvS007BoEqYPA/Xkxem7CWEL/VR1YuDrpmBjLFR4cN DlTMHdjCOi4yWSjhAN3K+/2oXp4jp3pZM5pCU+8xrb+fFqtr87rQkLZjW6lziKKC0s2F E5UTmhhaC7mFBoIesKd2SadmkuKjHPjENeGi+Y8g8ARjaMKXAAzzPlwmOsMz6bt5Hf2y LjVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VADINUX6ZcrePYzMyBY0BWpzDza+w3f5gI9s8clFrRI=; b=xXEOdaA/WAL6jrv02OTEEN0c0mDBSs7Q4uiw8TOQFcHyMriCwTIXu05+oygwxnpVlA nAgOyQEUkdITiGprrCKIPFyq+PmCz3sky3f+rsWg91SeX7+mh03GxkdiWRbMgAu3KNxa fbtPisyufcHVcnDdQS8ZYIjzm2Ko3hpzBMMG1mbYJ98YgbatdUPxWd5NQAqCH6O9PWH6 6KU/wjmnBOjsRO+lLWtszgvxi7BDgkF4z7dmt+9wC7YOBUDVNpDz3AcaCK/jowKhd1Iz UBSbjL/Jci8NjgvJ6Xnn9+6ZUqMowd5C5+kkyH9Widc1uw9dc+WOImF/ui+KOjDr8Hxp cF/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=EAFzeo3Q; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si3898771ilo.37.2021.08.13.19.52.08; Fri, 13 Aug 2021 19:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=EAFzeo3Q; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237241AbhHNCvc (ORCPT + 99 others); Fri, 13 Aug 2021 22:51:32 -0400 Received: from mail-bn1nam07on2106.outbound.protection.outlook.com ([40.107.212.106]:10517 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236876AbhHNCu4 (ORCPT ); Fri, 13 Aug 2021 22:50:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hkf0QGzIfYJvgWSBYE7gV4SbHaOkCZn4g8wqPrEOVCMPiz6ikmXnEVcQZFDy+CfKhvfuACKz2sJI4hKCqAFsAoAB2Z78/bV+jgWGt3hMn7aI98Q2HG1UH4XyaR0jroTMqBVOwDlYLS8VcdA40wOOPay0IGBa9yR1ecd2tAkMZMrjFV6fTw1B/HRkLx67J8Vo5xaFD3je/dM+Jq0knDqFX/YHaMAtBxwXBh7AvvtOfPuNaEI5TaXWa7X3rbmbhPbQE5fiZne83bEZUVEGqJzhxRbGrrQVeOaXRUa+BV1MNmdw/lHS+8rAzYDR+7DL21l01t5CmVuTEZ7clDBL3rtggg== 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-SenderADCheck; bh=VADINUX6ZcrePYzMyBY0BWpzDza+w3f5gI9s8clFrRI=; b=nv70X3IyW4Lmj/q1ps2p1XENh0fsq6ByMYsJuwzgdmFigyGbxuSCsed/hJsbDuHFuuLpuvL7DvbzQ5uSwNFZDUzzQHvQ/cIj1gAHgD3pQ+DRd5K8T4tIMRnNEyWE6G2NiRTDrOfa2Dnlh+Hw2SnKXJbzliy00tRjO5u2QDpgqp4bzXzvh+ytdGwUpHcOZnFCrhsM/8hc48ZAmdqSlPvDZiH/vfaX4gfG84rpoJ1bTbaqpBugJCRy2V15/7AZ8pKy07FVIFHJlNq70UfEabWvrWuKF9pKrt8Cwq1RDstYLQS2ZIdSjOVN9+5ZMifw/7qjN89WjGgnTDH+jMpNv4DkQg== 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=VADINUX6ZcrePYzMyBY0BWpzDza+w3f5gI9s8clFrRI=; b=EAFzeo3QbTOaUju4f6eoXGgTroEiSKETi06Nm9HYwW3oU6d0tFWWmCmSkKrJjKXshgGEmvICX372GFmvyEZ8SZ5bJb/bBeDsiFtc18OWSzaGXPoDVGwZYhQJK5uOYKfgyFV9s5eCJZRB8ITwo/putfMOoSsW1BG6Cz40pYhItWw= Authentication-Results: in-advantage.com; dkim=none (message not signed) header.d=none;in-advantage.com; dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by MWHPR10MB2030.namprd10.prod.outlook.com (2603:10b6:300:10d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Sat, 14 Aug 2021 02:50:22 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::e81f:cf8e:6ad6:d24d]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::e81f:cf8e:6ad6:d24d%3]) with mapi id 15.20.4415.019; Sat, 14 Aug 2021 02:50:22 +0000 From: Colin Foster To: colin.foster@in-advantage.com, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, claudiu.manoil@nxp.com, alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com, hkallweit1@gmail.com, linux@armlinux.org.uk Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v3 net-next 08/10] net: mscc: ocelot: felix: add ability to enable a CPU / NPI port Date: Fri, 13 Aug 2021 19:50:01 -0700 Message-Id: <20210814025003.2449143-9-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210814025003.2449143-1-colin.foster@in-advantage.com> References: <20210814025003.2449143-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::12) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.185.175.147) by MW4P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Sat, 14 Aug 2021 02:50:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bea80c9-4558-4106-68a0-08d95ece41ad X-MS-TrafficTypeDiagnostic: MWHPR10MB2030: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sl7BbLMls2EMBrnzYjIS1eMD4Mx1pmR2A+Y/Ay23fma4QtJB4n7krhjULnLQLGIA0oXy7hKM3aRYAMi03YeDQVcke8R7v21kZO80EEHjWJ1b+BWehav9Nf9aSqko3W7SYfWXu48kkhqcQfEFBi3FEPnQT/Gc36GTcr5+JkKJiWmD0VKhBmefJISgdop8900Dv9f+QvQ0muhueXC5Aq5SH+5x2WJzfU2sTkBuTCXn+w9VaAlta+C3MnSQD4NR1YuwhkGK+DEjZUVusd83M5TQOJQ/QMWQjsrrPPA43YMe00e6yuJEX3ljtYwpTjpSIAmvg6AW2a1slEIYxDVWj7oQfAucrxuyxC3CC6iwBXJnqkZt+BfA2NYBDbaswPvG/77gUKwgpFkWg8vNrmAuz7Vb9JPasadAsDHXYenLgtP6cYEVK87tcc2yHK5KYBQa3cTIy6tNKhINJVhCm4rh5ywTK7vtBR6CjLyWLSu52VxA8zVpevQ8ocCGERf4N9g236S1IhSf5B0m0SRUAWyJ7vgNKjCibOhgXDrQ5YQQPbccJBkrSCLQuh6r7w2aSJOhZDWDT61tBCkvq2ye3mf0/0u1GD2ySsp38d3IEquz9fjOt8XWgHCOb6pGirDOMGvwvRFRazT4HZthmi8X/DJrBcmq2LMZ8WeZ4xJoW0DQnZi3UVdnrt4uyHIEjfrmWAcxtT1jeNhy7dBCx+eBQdo7jgDQm3g2CH88GhUKmWuqVdWGHUk= 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:(366004)(396003)(346002)(39830400003)(136003)(376002)(186003)(5660300002)(316002)(4326008)(8936002)(6486002)(2906002)(52116002)(66476007)(66556008)(44832011)(956004)(2616005)(66946007)(1076003)(921005)(36756003)(38100700002)(38350700002)(6512007)(6506007)(26005)(478600001)(8676002)(86362001)(6666004)(7416002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ax5jLpbugq+Uv61y2Tlr9T2akw/JwPwBCJz2k2VbQO7tpxxHOr6z8XiXHc0A?= =?us-ascii?Q?+pUnmKv2AKHBubEjEWcFz0n51hnrSjr3gNEs+nwhQTZ3/6WoiebfaPPHsTJ1?= =?us-ascii?Q?Wj1TpI3TFdJUcQ8IeRDHWHZ/P89omjNhA2sXb2UPRenuGG2zdvf9+LP+N9MB?= =?us-ascii?Q?TV1kxTchjcP8KDk0MBDaxRPh8qS0tFHJq5I+niRaGzW2vWL88ogEkoLnGzkF?= =?us-ascii?Q?7avrKbkF4pLMbzSBwRkpH2WHzsHxR+xVrxQmZ7m8V0pPeW3mqVL1+yGmqHZF?= =?us-ascii?Q?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W9UPE5dwPddFySuiY1seK9//VO5wl5x?= =?us-ascii?Q?URGklAshtavKTM7v7ZztBxpOgtplVGQYMIrfk/WN3s9vkxTGxBYLV8UnkcRq?= =?us-ascii?Q?51vhrujqjiUXGkCWfA43SoHXHPijrJdIsnpfK/IY2UTqfrR5CNQBOgJ8wHK1?= =?us-ascii?Q?oK5sT4rI8W/ewy9RrpyCEVyV?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bea80c9-4558-4106-68a0-08d95ece41ad X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2021 02:50:20.9222 (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: fXSVr38tNRFc/82UK55KHlaoZrC8YZ8Gbb4Dot1TbQ0OsEbCp6l/JDzNTrt2SAVxurV/zw7Vsjdl7MeH2tQJKnYhAec4YifioGIrPKoCwXI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB2030 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the vsc7512 ocelot SPI driver, the CPU interface port needs to be enabled, but can't be enabled via ocelot_adjust_link since it doesn't have a phylink. This adds a hook so the port can be manually enabled. Signed-off-by: Colin Foster --- drivers/net/dsa/ocelot/felix.c | 5 +++++ drivers/net/dsa/ocelot/felix.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 77644deb4a35..33c0c7bc3e58 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -492,8 +492,13 @@ static void felix_teardown_tag_8021q(struct dsa_switch *ds, int cpu) */ static void felix_npi_port_init(struct ocelot *ocelot, int port) { + struct felix *felix = ocelot_to_felix(ocelot); + ocelot->npi = port; + if (felix->info->enable_npi_port) + felix->info->enable_npi_port(ocelot); + ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M | QSYS_EXT_CPU_CFG_EXT_CPU_PORT(port), QSYS_EXT_CPU_CFG); diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index 25f664ef4947..c872705115bc 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -47,6 +47,7 @@ struct felix_info { u32 speed); struct regmap *(*init_regmap)(struct ocelot *ocelot, struct resource *res); + void (*enable_npi_port)(struct ocelot *ocelot); }; extern const struct dsa_switch_ops felix_switch_ops; -- 2.25.1