From patchwork Sun Dec 24 18:32:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 183104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp74856dyb; Sun, 24 Dec 2023 10:36:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWvGVnBUK9+4BQIl3Ag/7VQ4G32ThgQVRZ2JyqJ6M+5ITEf1rUmG//taZdMMZt1HXDjUYj X-Received: by 2002:ad4:58b0:0:b0:67f:9b64:2eff with SMTP id ea16-20020ad458b0000000b0067f9b642effmr4366194qvb.78.1703443018080; Sun, 24 Dec 2023 10:36:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703443018; cv=pass; d=google.com; s=arc-20160816; b=XB+uTn8JtD7V57gOdNlm7U1tNU1q9I52wJKirSKWz6M4Edf+SfdbJVjDM2Hq/lL7OT Kv+adNPFIPBh/xo0vOK4vIBkfiPrAi/CsT89wkqGGUJzoIRGOXrLEruujrUAbQj1Mvw3 uN8AksxAMKK5CxiUxRA436a/TdrESV7cWCpD7FS1DMrg/nM+oSxxaJn73o7d5fuft5oF j3rbALuop/QhKF/bXoEMtK5Z9A4sKtQ7n/nJ9ehvIEnAmmAcdS/52tkdLQyKdcjmoSIq IgpQci6dcQquL+z5x6lQR12YOkLO4pz0cCo7AUGZgrnIm6cRW+s/nVCxauBlJn6D9Sac 2npw== 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=pouqXGwboygEHGEyEH0UcBGMdn3xWvJFgCWv7qfcMzg=; fh=492Ek0Vpabbqz4y1lk9p/Id6JH5wlBXcD/z8VK8wbWM=; b=zYZLLRgXl8x2IAzk1I82zfRh2zI7Aejf0+ENDL64v2vAZw+vPfifmvi54gKIAotNih nH74ixZrxBOCTXCpDKQ+luNKWUPEtudzmAI64c+JKLbchChe1AtkA/qudNRv3LwkObAK KPBrLQJG9GvBzGXIP7WAtSp81h60LbfMRjR7WGdVcLuwhO6tdS2Fjc6SuGOK3HeO8nar Y2NIUI5DoXLVLfi8MK2mDfwVu9MZdyK6I3fmy6fTBEJHn70ZQv8PzysmoD15oh1037dR I469gQq4AmkG2dRVvdPuN6XKfVCA7Av9FPorRprQiek8AZ5Twzz9c0eVThTnUCQfzD9Y K9nA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=EHmxOYAh; 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-10797-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10797-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 y20-20020a0cf154000000b0067f692cf830si6072644qvl.128.2023.12.24.10.36.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 10:36:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10797-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=EHmxOYAh; 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-10797-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10797-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 CB6DA1C20D8C for ; Sun, 24 Dec 2023 18:36:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F2A718B1C; Sun, 24 Dec 2023 18:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="EHmxOYAh" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2050.outbound.protection.outlook.com [40.107.22.50]) (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 4F7DE182A7; Sun, 24 Dec 2023 18:34:13 +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=kujnsLJzML297aIYC9J/7ol75kkEJtNEfgSqblcJaKfodqNY65FuU9poQ2rEVtPYRJpvbPL/jra0OOyHFQLhgVDnDzImhrlaHSgN8SpLinBRy8OrKZ+Zx7QHtcNig/8KR8BJOGPR/xHHIyAAI/tPnChmBknjLsYMw4y7rJAwSrFsvrPjq9obddGwMr8owAj+U2k2/Ti1dPSXvpdvTt/ZwUpQdUm+6wtDWX53nf0q4a4hXjO/Luvy2hVHfeoA3xVlmbJkafa00QUWimTwJkhTm+Xswfc3SP/B++yIC/0auyCStJ1SaNJwim9PzhRXsbrOCpmNN8LDV8fAfuHPrP2pdQ== 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=pouqXGwboygEHGEyEH0UcBGMdn3xWvJFgCWv7qfcMzg=; b=lG3j29C7KXzS8tmW36+2yV6SOx7ud49kv+WcOA2qDpxtsQBuKULud7ancxsJyuulYDRvMp5i5eK1m6LbHG5m6IdyFhNu6M8Ej9JdAU25mLeWpEgZ99rCjiRV4Fh1sNT5n/TqevOqDhM6g1rwY0J1P7Uv+Cn8qKJeScgjXVXTT/t6k8wAVLnOMMf5e/H0LBuepG3thlwFQW/1yowqRtTfwjh7y8F3heH4xbpMPekme2uyNgLz+6T5+2owa4dP1ZA7zgpwdKcnMJEFZiYQPMBXSjJTpqUkhzVmXrUo59BzZq7wEgj0vXSXUTQfSSz0fOQJOtu6m+94LlTObQmcqXsAhA== 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=pouqXGwboygEHGEyEH0UcBGMdn3xWvJFgCWv7qfcMzg=; b=EHmxOYAhybhkAEcNPNWkuQGiQU2eywU0vzwQfQB4uvyqnu4QckA+8ef155bSLbVI01NoP6yHd/rcPeLE2mv5KrbiGT5+s1IP8/RkX/HzIG86nZkbRW1aKM8+zG4otk1UVqbdGCqgtOuiLan3lsKH0BrocaW7Ec/z2jtKezyYhAc= 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:34:10 +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:34:10 +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 v6 13/16] PCI: imx6: Clean up get addr_space code Date: Sun, 24 Dec 2023 13:32:39 -0500 Message-Id: <20231224183242.1675372-14-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> 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS5PR04MB10020:EE_ X-MS-Office365-Filtering-Correlation-Id: 269a5393-62bc-4ee8-ed00-08dc04aeebc2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 90DU2PkWJx3kv/VfXXnbrEAgPrcvMYV1eE9Fw6WVP1O0gP9kF2eN4Kl6Q2L+RolGsqJhJo8x9URiYBCO0spLjdUvJo5A7D2EezgFev6VUZkhafYpa235Db9B/TFeZ2knHNC/LeGMrBvnxQ3Ty++suQUQ6YQ4JAw1xOPBQQpdxBt551js4pPwVXKAURCHK5d7YNVWn5F11sdZHZF4gsImi3JeHrSnnsKKsyQx2ztn8uRHfaza4KE1C9y/Gd4hmhrk7OEQZaVExNVWCzH6LYoHfDsKGcuVDCHOeoknbD/HT1VASg/ZhN2FiFSIsIsFz0hHkblc0PnhPGEhT6bQDH1WeOuA+Ee9kqFgM3SLPboi98BG/AosjubKSMHZCEZBB3SUHfus0UsP5i4PtvHfsB0pENFHV2aFrsV8VykKio3PkulDlbEF817IChY342LROu0vVq0mays7a5QWfthqEF55nJi4ZgUXZT1to7rtJ/iDQ+fBbgKFDMOGc3twA9N33d7LQGUN9bOfN5abIsrUJDLO4qaBBKgOKiqg950hxyBhKA+Wf6VZ/uR0oxbl3ur5s0ljARFlLnNIMKI+q/7F3JCcNp6G3lxDufXzditzjwzBvsxXZQctA8ouZjAX+DXjUfEG 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: xNGadCEpXySaa1Mfx5yRD02Bx+J4gwixPeZfxb79yYBn5zCtWMksG5LA+ULuVYmqarC7H58AkMK9eiiv+Kx2ju105I9YCG+UZ7AFrEjNGvRAIl53A0S7K6lRLSi4mFrm9Vg653AIIIGQ9obJ3UMmXeSwXwGAMR9086dDRzOLTlEubQXDw6SeSg6KRBjrFyHvZm2FBKES5NU6TrkpUEPIOWtyWXn3LJydlsacrV4/xhqz2+SluJa4V8akUb6Qq9qGHSx74gm4aEkCJhokwGve87pTuQCYlK2VtBPzVxvFABvl5IBrCzP2fApyrbzfnMM29XZacgl5RQJgAuql2HqS7YyBnUhcm2Q8RVXXpOLJN9VoCe8UFNyEfL2MABiMK1fcw6fWafXiKJvyLimjWtlg2d4RaSp/Jz8HJJXVmjMZ2h8quANz1ZNjYc7YC9PQmuoiHpwGsBgc5ihc88kKKiASRanYJAWcxAIoNHD05d+nLWHFBBhMMINIfFHBvbmpURkyjINU1CL+LywefP2ORddXu2ccuwndlzBossvB8XNR9fEKsLytE7GG9mX4FQX1LBpDcF4ADiwP0OGse+3L6OEfZvlRtpqCZ34ZpI3jnTV0t1S/Jqyt6391pq0PQUNjmJ6IdsbVE39YrkPTx9T9K55AYHbGXg+wY4bnAQCnnJLx0ZxuwdzziaWg6zAl/Jyef6KKz9ovQwg4bHa8vgy9brtjbCmhllfu7N2Egk2RMRP8Yy5NYxuAt1CEeH4L8hnbbgtlyVBJilLTTO4A510Uu1ICznaVgRuD515Xz+ABfpKTEuV0bQB2RVbTlb9dqLMgGNSBdQoEScWwUpLUdWGcDrRBjU3/OaxcoQhIezsDm3nxsvhLMu4atwyeg0EIpaDmWQCkgZ38lxAKZXjN3R7FjTTJ+fZoNF31pk0eyEhX7mXjr3JNFyydkQRCSLvHagBuJLbvuuQO6jzlO03NNTdGpNU8tT5p7qkzJPDirsvzUK0cr8M06HuOHMz7GVgpPmHf6biuCuFp+tqG/OwBhOBO/dDl5FVq7TnivwJF18H0oXitPxlEuD2tdMdqpvvxvVNZhSMAcM+OrkK+dCgl2fKOTs6VIel2HyoMspM1UPjkh2ZE9L4z9D0mpLVj+O1xxIV7FezzLLlvbKXGzuRSxTs8mQxWvKqLq21Cc4R4vzoiad0v2xutQlaHBhH1zFcwj3+0sKwZ1SInMCZFMpKToTZCUvB5RetuJuRog5X62Y3Gj/ry6W7q3Y4Te8C71kOM1SA8HigqgHo7JD2gpFa3X2y+VLc2/S2PLVyj8VBj2UalI9M5CNokZVYQQDGPrAkavXXNXnVS/L099h6S0Jlhjuv41DUBB6Tkq4aiIl3WOx17R/zhzSOgI4gJgFPwaZz7w0c3nSTnSNDtkII0hlZUqpQeow5vGwwwQIcIatXn21D2eIqmODQMUgYmdJIufxC1AeApQzuEkXUYkxYvkdsiv79uOaU03VwXpoi0omsZtvh6SfKTReYcCEq3o7FmysskosH0fLF9GMIttohQ446CL4L5oNfa5W/aQXD+5Gl9uzXMfTC/Ti4= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 269a5393-62bc-4ee8-ed00-08dc04aeebc2 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:34:10.9200 (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: D22rRk2JWjoqhVKOmQN4guxKt36/oP1G/gqOMm6UzY0VDQgDK6kerZ2xqdVFxkZyqiZMLK+SrOAiqscJUywquQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10020 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786189465907775542 X-GMAIL-MSGID: 1786189465907775542 The common dw_pcie_ep_init() already do the same thing. Needn't platform driver do it again. Signed-off-by: Frank Li --- Notes: Change from v1 to v3 - new patches drivers/pci/controller/dwc/pci-imx6.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 9e60ab6f1885a..4b2b9aafad1b4 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1080,7 +1080,6 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, int ret; unsigned int pcie_dbi2_offset; struct dw_pcie_ep *ep; - struct resource *res; struct dw_pcie *pci = imx6_pcie->pci; struct dw_pcie_rp *pp = &pci->pp; struct device *dev = pci->dev; @@ -1099,14 +1098,8 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, pcie_dbi2_offset = SZ_4K; break; } - pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space"); - if (!res) - return -EINVAL; - ep->phys_base = res->start; - ep->addr_size = resource_size(res); - ep->page_size = SZ_64K; + pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset; ret = dw_pcie_ep_init(ep); if (ret) {