From patchwork Mon Jan 8 23:21:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13514168 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2059.outbound.protection.outlook.com [40.107.8.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27CB058AAF; Mon, 8 Jan 2024 23:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Y2CGO/oI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mOUpjtHOUJcs/nOh2QDhIRhkKRjOkIfmA3l45PdhryT16kDci9flWeISB3+lfGycM3GMPvaVjfoh15nNeieb7MrcA6FMi2zKEFOz2txfUymCQJaqPQpwzfMJzYEOeyU+gSmOALVijKqCY8YYo5KnaTuX7fdCS5Lr5caU5uC+Dp1wT/sNeIYL45rXNsOgOeXiSc7t/Kk/P6/Y2Pm5QxqE5JHNRmOaZNlZ48uWDHXJk8CRLlkVPqAiX1oQI6bVLp1HPKTixuN52i87qtHyE/Qpu4hkFKDzPl6dwrWtv7FlT3s+OSuYGX3pyLLFuzTo7p/vvA+Utyb9QeuLroL0B+fY8Q== 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=kNhX4RRQTn5X8Wm4GXmBWpdCt/K2/H1fcxxALLTJjwY=; b=LYYEhBQqOJ/YvtbE4iMXoIO8YQ8/+Eg1+K8QX3QXdoSRi1Ky9ckck//OAuD2CdSAkQCCHnbhHFN5599arEBBUlHU8BP1MpH6c6tU2AKDT1emNMp0zs0KtqiLNfMzxV/gVpU/YysLztlkWkEAGepIfZtHlyjmEbF9czVmeQKunCNLA3M32N84IZQmq7CgxNEpeQmIxShiIOxQlOPNPDgrjcMxp/uf1H6Qfp1EhXET+cHoB5RDDzZpDb1OULYDCAHWznTV3o4MsiAF22lOlrN/+Kk20jjCRchi1GpjKicTMIzzb8CgkJfQ6ZFXn2pBr5PU6TOiQ4X/WwUfbgtD5eh/lQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kNhX4RRQTn5X8Wm4GXmBWpdCt/K2/H1fcxxALLTJjwY=; b=Y2CGO/oIgloMG6QnUC97qHusm1GTOtRrR3AV/wnLdTAeL2Eb6dcacguqrdV66HqMp0ytmzTUkha+Q9B5d+ev1B6eKUfzPqJjF8sOv5zKjikpEgwrC5Og1+XOnJYOXZFUkp3Toa8nz6a7NKBGtoDs4fBTIm0FkP43W/FEHU/DZ3s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB7511.eurprd04.prod.outlook.com (2603:10a6:20b:23f::5) by AS4PR04MB9338.eurprd04.prod.outlook.com (2603:10a6:20b:4e6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 23:23:20 +0000 Received: from AS8PR04MB7511.eurprd04.prod.outlook.com ([fe80::8ee3:bac5:a2da:d469]) by AS8PR04MB7511.eurprd04.prod.outlook.com ([fe80::8ee3:bac5:a2da:d469%4]) with mapi id 15.20.7159.020; Mon, 8 Jan 2024 23:23:20 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v8 14/16] PCI: imx6: Add epc_features in imx6_pcie_drvdata Date: Mon, 8 Jan 2024 18:21:43 -0500 Message-Id: <20240108232145.2116455-15-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240108232145.2116455-1-Frank.Li@nxp.com> References: <20240108232145.2116455-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR02CA0063.namprd02.prod.outlook.com (2603:10b6:a03:54::40) To AS8PR04MB7511.eurprd04.prod.outlook.com (2603:10a6:20b:23f::5) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB7511:EE_|AS4PR04MB9338:EE_ X-MS-Office365-Filtering-Correlation-Id: 48f2818b-75d4-45f4-dc0f-08dc10a0cd09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rt6pq07D38XiBgLtse7Dn3RaSgvGLkEZPEQ6IihpEUgkc6t/8zKEr8IWIdulmDQbXF2pX3bWNYyzavg7y1VcYif7bcOh7SVFJOG2Gu+jA9u/Mk94Jm9L57wqFyuZjS23rok0w8uydPoiJY3rs0xl7U3Tw90KTqElaJuz+H7n40CqAegWBVsQhwnp6u36I/6B/vWRCBZx51k4k7iVo85EfsfCX31mPp+iutq/VIgdz3P4+mqqfkLlYGevoSwcqhIVJoHofCuw6+LoGCfIv3g9ji5B8c2q/iT0KJ33+Qu9JecBiw5JDrzR00FEoWZtjhPXlZyCI+KfNeJazFSBP2kG6fW2HpEXoPBJd9AsdIwTFOxMMGILM2c8mUsaYq5JAJ17uINbCLFOpt9OdOSuAkEbNVtJertpwtVazSqWIuJNJKhsA3h31pAb/zdC/F2ZmWGqB6+S6pgsH18q8IFld4cxDk4hongJDwHQvzC2N/SytFWKs30o7XITREAuACplOzg+0PWnh/9F1lBdt1mHiJAAXeTouNj1jLZd2R0XvuIhycHiN6x91CNH9lKuN1UkuGDnMukkrA9ZDleW/ATZ18MWwCJ4yvxDfChTdElzzVYG5RiDtzpsjAfCc+rv35SALdth X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB7511.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(52116002)(6506007)(2616005)(1076003)(6666004)(6512007)(478600001)(26005)(6486002)(38100700002)(86362001)(38350700005)(36756003)(41300700001)(83380400001)(7416002)(66556008)(2906002)(316002)(66476007)(6916009)(4326008)(5660300002)(8676002)(8936002)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cx+BYG/CuVgqc7fLXMPFdBjDXKYGdbuKcxtMIZettM/exC6ae6yJiTuUw3m7VVeonXf5DX6K2XKgzMyUUbDKKBWVQG9eB/ETAyAtpog8cS0atoG0jbOA32A6HCG3vr04AKM7Cq7dl+S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DA8oCW5LdJpUxqR9m4I67Agb9wpwvOokI+zGtPgqJa+amRH7Yvy1MxcsuMU63KXni5sybLDkaJOMM5XzYMAZqm5ZZ5uJPUDUD7lBUkGflWYm6zjodNUMZwJxg4uMWreiFLQ5eBzHWk7VK9rhmJ1jCD0jN8RGUxIKfXWTtjadTOipeqhWDcrnwpdUT+HHVjNydOVyM9Digkw5SAxUm37CMZXFItI47lrQdwhK70m+MlShodGhc8t99hi2gad7P9/an/tde51MITWFN3SGjDkBNNV9XRiV36aVxisuJg4k1PdDZD9cYT1FI/3zNyBHcZCW0Z1JrDPh9x1RxCrCOuEfl1hr1BOW/AeFWa92yu7fAYnRmDB6XTqio4ryY9w49wt/OjUZVFfsk+HWsmiAZJu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48f2818b-75d4-45f4-dc0f-08dc10a0cd09 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB7511.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 23:23:20.2099 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jop1WxcGZUtASie/Yk+lCXXC2Gw7tbwBHfVK+Ood4CXPvuQ3mLh7iclxmnppmCcQeiH+5i5jCz55H0UApeBFxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9338 The i.MX EP exhibits variations in epc_features among different EP configurations. This introduces the addition of epc_features in imx6_pcie_drvdata to accommodate these differences. It's important to note that there are no functional changes in this commit; instead, it lays the groundwork for supporting i.MX95 EP functions. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Notes: Change from v7 to v8 - Added Manivannan Sadhasivam's review tag Change from v6 to v7 - none Change from v5 to v6 - add missed maxitems. - add comments about reuse linux,pci-domain as controller id. linux,pci-domain have not defined at PCI endpoint side. Change from v1 to v3 - new patch at v3 drivers/pci/controller/dwc/pci-imx6.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 1741af88040be..3f474d4749dce 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -105,6 +105,7 @@ struct imx6_pcie_drvdata { const u32 ltssm_mask; const u32 mode_off[IMX6_PCIE_MAX_INSTANCES]; const u32 mode_mask[IMX6_PCIE_MAX_INSTANCES]; + const struct pci_epc_features *epc_features; int (*init_phy)(struct imx6_pcie *pcie); }; @@ -1052,7 +1053,10 @@ static const struct pci_epc_features imx8m_pcie_epc_features = { static const struct pci_epc_features* imx6_pcie_ep_get_features(struct dw_pcie_ep *ep) { - return &imx8m_pcie_epc_features; + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); + struct imx6_pcie *imx6_pcie = to_imx6_pcie(pci); + + return imx6_pcie->drvdata->epc_features; } static const struct dw_pcie_ep_ops pcie_ep_ops = { @@ -1538,6 +1542,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, .mode_off[1] = IOMUXC_GPR12, .mode_mask[1] = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, + .epc_features = &imx8m_pcie_epc_features, .init_phy = imx8mq_pcie_init_phy, }, [IMX8MM_EP] = { @@ -1549,6 +1554,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_aux), .mode_off[0] = IOMUXC_GPR12, .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, + .epc_features = &imx8m_pcie_epc_features, }, [IMX8MP_EP] = { .variant = IMX8MP_EP, @@ -1559,6 +1565,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_aux), .mode_off[0] = IOMUXC_GPR12, .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, + .epc_features = &imx8m_pcie_epc_features, }, };