Message ID | 20231224183242.1675372-6-Frank.Li@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-10789-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp74152dyb; Sun, 24 Dec 2023 10:34:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEulQCY4J1XEH3RFMWjytpTS3pRoDG5D25UMnLfy+RYlVEqoo4ywNl6XlXVxJIQiYRaEJF5 X-Received: by 2002:a0c:fbce:0:b0:67f:b9c3:d94 with SMTP id n14-20020a0cfbce000000b0067fb9c30d94mr2683586qvp.116.1703442887385; Sun, 24 Dec 2023 10:34:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703442887; cv=pass; d=google.com; s=arc-20160816; b=ja8dptAMf+DUtTGNOsxnkHUaTSg09mrGVx+II3cca2cpCJEGop6WnxsFcisRPiA/jI Vvk94IggR/18GTUkubYQK5IkVXd8sqogK3ttfN8+wuKEymY+cfXQogZsqH9PhUgIje03 ARxTSlFQTZmp8F52PKM9gYWWhBEfdlUBhambysqvYg5iYX6mT2wFArsdIaSDoA5iZ2T2 EslMc4K9gVi2ntTuQTWL10EkoFmCWphYYxCV69LPb04du1Dn1nWhZE98x9EBo6qGijg1 6IkBCHQjw+6xkSewKJXe0fpu91u5MQztI445Jf1/gjvzMwIe+CirNDufyOMm5k65gQaQ IdXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=9RVrid8a+eD+TtnotxTbO7QIeCjkzOMmpoWCT3IQ2Ho=; fh=492Ek0Vpabbqz4y1lk9p/Id6JH5wlBXcD/z8VK8wbWM=; b=TebyZZl+5eV+gntsKy70dXk06WUczS2JEIaIHHXflJU8/V62WWn318lIdrt5Mf53q/ TZdHyPSymS5SHYjn8a9w3ehc8EQ+rP1p1UuzeQ1AxrvIxGCClQT866NiMyTGMFKZr4Ww H29kHXlh33GrKtPUSetLePR0V1qZasW6eEOLV7uRWblQkgDS/qwrf0g0VNgv76liJgIc YcY+9u+UcvpzIzum0ENLJtuynawxYpznJ5xZkoEdC19Xq07jqU+mmTwSqaZ1mcdGyaVr OmFfEaEGpQ2gtoVmqPPWST4L5m5I2vr32y1/qVTTEAl3t5bvjU3771tSEm796tg5dbGo qltw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=hqd3pqoE; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-10789-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10789-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k20-20020a0cb254000000b0067f63d12e9esi8973800qve.205.2023.12.24.10.34.47 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 10:34:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10789-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=hqd3pqoE; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-10789-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10789-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 306351C210F3 for <ouuuleilei@gmail.com>; Sun, 24 Dec 2023 18:34:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8649A10A25; Sun, 24 Dec 2023 18:33:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="hqd3pqoE" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2073.outbound.protection.outlook.com [40.107.22.73]) (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 393891094A; Sun, 24 Dec 2023 18:33:30 +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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FpURgq19hQgqAgS7jzvjrGp1+oKvtjrHjZM8r/uAlYm61/cSkQhyYC2tAxT1naIO5I8RWjyrQEBUcZaHMyMsHu/AUAyoXUp/slPtH+n/WqmewFKxiW39yAHMQaQSknmWhx/7gierY3jZuZH93MSm1d/x52OkJ6cSAVTqglxu1KTxHjRik9xaToT0nZg7+tQXhfDSV8xfC1WY4+iKsNzZ16c0CZKpD72eDxef/6RTiEBf/OQKuXY6AzZ4Vm3KlXaN7UyvZtc7+hEursZIQsb8oimkK3d05dz7ysolqCGRkoFzWK5ZtfUU9JfWy8EDG03UXuULUwZFnOr/Pf2t+y+D9w== 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=9RVrid8a+eD+TtnotxTbO7QIeCjkzOMmpoWCT3IQ2Ho=; b=jwNh4nDtyerMzA9aEacxs3I9EfY3VDmIfBfTKUbuQPF3/hvuz4no2CUfR7ntN4zEJQLz/dpttZX/ctp+eTBNHICNqu15sA9dZTZwPgyXXqoeQm6WUblza2bwnU/olUVkAhUQJ+g3j0dm/BWlyWltmKj5tDe2SvWJ6aShuqgLZapFYpbca00h0Y3VZmDPrD+T6YzrvBuirbe4YmtqBBiFF1POlcTzL31OEdJf06ybazuLFPc3rK9mXljaH+LiBUGGr7hJyUwubPCwjCKRTGFJzu86RsoR+SL/+AjXKQEfLDDcDU48VHZCdCutcEceTAoIUSmShwv6TM/26ZtbBJXWpQ== 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=9RVrid8a+eD+TtnotxTbO7QIeCjkzOMmpoWCT3IQ2Ho=; b=hqd3pqoEdqSardA4H3uIKgCmjomn42DuZJHSM5QLAldl105/n4q6MTrtkey1XFVJkNF0tThZSJeomU96Js6pBZSsvWDDpa6nGDhBamiYzad6nOQh3RMNI/20pV/6DjG0ys4397AU6pSQPziXQFtn7wFiZwcv6cR9t4YGYEDT71A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AS5PR04MB10020.eurprd04.prod.outlook.com (2603:10a6:20b:682::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Sun, 24 Dec 2023 18:33:28 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.026; Sun, 24 Dec 2023 18:33:27 +0000 From: Frank Li <Frank.Li@nxp.com> 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 v6 05/16] PCI: imx6: Using "linux,pci-domain" as slot ID Date: Sun, 24 Dec 2023 13:32:31 -0500 Message-Id: <20231224183242.1675372-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231224183242.1675372-1-Frank.Li@nxp.com> References: <20231224183242.1675372-1-Frank.Li@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0169.namprd03.prod.outlook.com (2603:10b6:a03:338::24) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS5PR04MB10020:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ef71839-8de6-4cd7-6f7a-08dc04aed226 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8vXvSQ0hulp/YkZptRmZdfZmVriO8C+qGNFeLXn+6d3h5oe9NXqZOhM1VqQE1FAtdNHK1lI+ekRxFkFvhRV69BubIbnH2x0GB+papu7OmB93vmZCEJ//dLQZesyZj43HpAiTWt5GtzbFF5fJ9yT5IoMJo2nPiW14SGsJIJkhoOB4QkV7/obC9PoZRVz76ru4iBr6AYOT57JiiQaduT/TDPSIBdheGRWJAoTm2uZKYfHo5hzGZmAsMW343o/H2EhfYFEIlumMbbttUkx1GfWd0nX3zCSXfbVHD4urT1VmEQjZJf5rlS4wQ3SDyFzqWlRvnSVnSmvuQ3eBcKidhpz+oWn5oUf0Ke2bOZ9a1MQUUufG5hkk5xCqkcI7jpvctdbq4ib2t9jMWayTfJQOIXTwhjFa3s840KsX9Tl4atFtopUk+HSVtYK4RGt/r/6WDrBvltJhcWXfjXBb7zsYk9O3gDJK4Wb7kwcF4pcXhCan02JFVrgqJlbH0VsAIhUB6+3PJQrdIWBH7hQHSXZGLA08sFOjbnMSdVGOAUbv2FtsxHVN8Wze83QyHr8ThgzltxqGV/+lr5YJT1qC+EFcc9nQ6m0wiP8fHbuiVoIJFEW95qtBkYItAk/aCUESj5vFoaWe X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(366004)(346002)(376002)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(38350700005)(41300700001)(86362001)(26005)(36756003)(2616005)(1076003)(83380400001)(38100700002)(52116002)(478600001)(6916009)(316002)(66476007)(6666004)(66946007)(66556008)(6512007)(6506007)(8676002)(8936002)(7416002)(5660300002)(2906002)(4326008)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: umMUl1+SASAVuc+TMXzrdvpq1WpPWbEU6cWqTW8b8sqVPfYdrFs2iNroI34ohXyFYA2pGQ3NOzWQ6CEyL6P85zDvkKfDA3Gwx2m9YjHBXLcxps9IFVlolZNZZQxAI/XT3SpX+RDAxbFI7CHU+CNbrHuL4FB6+T2UCY7zfL9pQEAd850LvaDCSEUd/GdgrPRFqU70mS1Vp4rXxEo7/1ps1TfJHpNjL6Hk+qhVaGo8kJ7K+GMNcTwyVZIe6/Q7GtH2XqdkzJ5TVfUWD/vTl1W23n2sBylKjs8WczQkz59HCkmrrzSNocF2ALnqtfey7KF1YQy4q2D6L6YSbGxeapedigLpmE+XOE3i97mjq2nVlROFaNBPHHhKq9FpsQpkN4GJMo+tasiC3XodaRhLMTFmXiqVA94uH9J3fLH09d8SgAOgIQtCFHfnFULDBC625J5FdKbd3Pk3EnsbXypXT42CrGYfNeJgjT7DO5qZNNZwBI0jyQ7k4OGI7VopDHV5yjblFDpVeQDol8NHx9+XmB0LzaoTIJfmCsifjBdcVkilGCvqzEqIsFJ7Ns/6ReDcnU2QwvJE7xqp/GqeZOtX94HtI4iR/Yvh5e8Egg1x1q0Qt4psl19hlcBMa7A3LZwNNMft2uCummRZ/sPjgp5cve51pWE8EIjhvGSUx+kyUqECoN5psHK+T9mvqNd44bqSumrWNT4bfvcyrvcXa24DwtRFMvqwjzf58Sxca+ol8xXPhIIAt2Ece8w+6hcCg2IEe3liE4U4aIYyetdDhQQ1VcXWVv7wVtS2vhjqd0xv8QjXLWcLyu/1NSCiQN3KT9nzuRUo9rdF9RAySuip15x9hpTYeRxXMuNQ8cbU8p7XxcBmfuF7UaFqP5zhl58cV0svil+DuJqf7NjyCfXpYPrhrPwnoVW1EGXPczqJfAj2NFTUdXYCrb/Bbq3psCUPTetrieYPCXpPNTQkU5Xi11Wb7O9wAS+qxdSUbCOMZ1rgihoAxLS2EddVtVN6SfksrpeFNbVhWXWm10C5PiAl9KQdlFhdzX5hHwYYehDVoYNMiYW6p6Y4Ply3cmNygAKPh6M3xFNoSyC5G6NJBERC3P9AsQwzBuvbhf9BeuZNr/ZGWmEHeqCbJdL4jcl57lo7Jl2SkAuQ/+eYS1zZDDCJwhP18bHG868pPSYcC9wvm/a1qUyfed+sYd5d2+TvZXpRczB0aTEEf1nusfx109T2N0uDb3+rHmMZ/a/yFYVHgdFOVv4X6pMrNdZXvV7AyJHBgezlGRIE0Jp0Xu5rFnfzgJVNbkwQUv1j3ZkKCSm+CKpQ33ingHuey5t7xeStfPZ07hD8aOL+wsjpShZhz69kJY6wSb/KDl58aq8JSlz0HBw2n+W1qCU6FtlIghseWq6cdIeIlAxKVS0UUi/fn65rMFpMVBPD0WgHIg+Gc6mBhfeJ6tozpCYLd1Gu0IF6R+Ntxqnfbgz2HHXk36dTElcMr/JVZi1o802LAgWrqftYUrfBoAIYN1yFBbPjcYgmPl0gps/72IsNPtmTTYn4EC3dJ2zFOVWu08Be6rLyHgDr7L3Omhbz78M= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ef71839-8de6-4cd7-6f7a-08dc04aed226 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Dec 2023 18:33:27.8696 (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: PQ135vNmgpMXRQ4c+3g+xbz4Ss7EJgNBnJlAGvqWXeyvBR6K9Jj2stKk4J9obxwTs3q4VVYjy5+EkcKIq/dUdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10020 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786189328943398792 X-GMAIL-MSGID: 1786189328943398792 |
Series |
PCI: imx6: Clean up and add imx95 pci support
|
|
Commit Message
Frank Li
Dec. 24, 2023, 6:32 p.m. UTC
Avoid use get slot id by compared with register physical address. If there
are more than 2 slots, compared logic will become complex.
"linux,pci-domain" already exist at dts since commit:
commit (c0b70f05c87f3b arm64: dts: imx8mq: use_dt_domains for pci node).
So it is safe to remove compare basic address code:
...
if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR)
imx6_pcie->controller_id = 1;
...
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Notes:
Change from v3 to v4
- remove compare basic address logic
Change from v2 to v3
- none
Change from v1 to v2
- fix of_get_pci_domain_nr return value check logic
drivers/pci/controller/dwc/pci-imx6.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 294f61a9c6fd9..332c392f8e5bc 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -33,6 +33,7 @@ #include <linux/pm_domain.h> #include <linux/pm_runtime.h> +#include "../../pci.h" #include "pcie-designware.h" #define IMX8MQ_GPR_PCIE_REF_USE_PAD BIT(9) @@ -40,7 +41,6 @@ #define IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE BIT(11) #define IMX8MQ_GPR_PCIE_VREG_BYPASS BIT(12) #define IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE GENMASK(11, 8) -#define IMX8MQ_PCIE2_BASE_ADDR 0x33c00000 #define to_imx6_pcie(x) dev_get_drvdata((x)->dev) @@ -1279,13 +1279,14 @@ static int imx6_pcie_probe(struct platform_device *pdev) "Failed to get PCIEPHY reset control\n"); } - switch (imx6_pcie->drvdata->variant) { - case IMX7D: - if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) - imx6_pcie->controller_id = 1; - default: - break; - } + /* Using linux,pci-domain as PCI slot id */ + imx6_pcie->controller_id = of_get_pci_domain_nr(node); + /* If there are not "linux,pci-domain" in dts file, means only 1 controller */ + if (imx6_pcie->controller_id == -EINVAL) + imx6_pcie->controller_id = 0; + else if (imx6_pcie->controller_id < 0) + return dev_err_probe(dev, imx6_pcie->controller_id, + "linux,pci-domain have wrong value\n"); /* Grab turnoff reset */ imx6_pcie->turnoff_reset = devm_reset_control_get_optional_exclusive(dev, "turnoff");