From patchwork Tue Nov 20 09:25:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10690879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D14A013AD for ; Tue, 20 Nov 2018 17:03:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7829283E7 for ; Tue, 20 Nov 2018 17:03:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6BBE2841F; Tue, 20 Nov 2018 17:03:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 35DAE283E7 for ; Tue, 20 Nov 2018 17:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:Message-ID:Date :Subject:To:From:Reply-To:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4/2yV7GxGT4VbGq+3yYWkz87uZWW3fNEU02f7UFXF3w=; b=nGyOvRaE/KSLSE DkSzqSpwNs9WToIm2uU8yecyjFO7bqiHRZPVO0cue5LHh3FkpGQRAUHJ6J9XF9p/jj86M38S9dPpi +vwcY5jfNW0NueMN+36LAlfjSGui2jVAvbyZf4Ov6s0QurOcn5ZDk+jEcei8lIcc5gXN16fvy4I0O Pev43pzVYgTM/lRG8UO8SC5ASmr7g1xszmLG9nyIVlbeajJItA1KvkiiFCNSZ7uFwgNHNb+1ZGAzQ MRj1Hzz3W3Cfbwqf/ezPkbkDhaiG+DnIWCy+lmNJFVklmOiXF/jdmbPoDpPj7E7o0xwGVEw3zzrLj H4cETPIxgMoDY/BI7FHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP9Qv-0006pU-IY; Tue, 20 Nov 2018 17:03:29 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP8om-0006Yk-Gl for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Nov 2018 16:24:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-ID:Content-Type:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0x/a/C1xrqSPW8jXEM0kO85Dfq2DE5CHesRGrOy+TRs=; b=bh96Ij2yxqb9zhFvnURRAu+7Y4 2WSD/wlWOqZ8IUZOSSsit67d12Qm2WFhgvpx6HgISzz31rIm1bMOugXUKGSm9WdodWXTi43V1TC1a t8wQmqlUKSCq7mX1GprxFvQ4XZN0bzbXYje5EaZSpIpUYICXHQg08x9PhcN1IwMqlALeAcp/QOiqs aEKre4QoirN013GmePOJqS6uznP2b5kXFgTnDOV/FYbp30a8QNHYCqTXshuGM9WOSV92BqC45FcI3 NTCD5/kr+Xid3mZ+ZctXaXp/5SU83/HjXdIkSzv1bBPTRDRylIpMyVII95IETzh7gtDZ/fAHtkR81 5UZoj7jA==; Received: from mail-eopbgr20050.outbound.protection.outlook.com ([40.107.2.50] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP2If-00078F-J5 for linux-arm-kernel@lists.infradead.org; Tue, 20 Nov 2018 09:26:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0x/a/C1xrqSPW8jXEM0kO85Dfq2DE5CHesRGrOy+TRs=; b=nf/edX+tUu0mXT8QGudFwRpWlkV4Y7Mk2cSNfaVIcwhqqDfH41joxsqHSDNdKKRqJvZjltDOIhDHSqj0WJGBN17pqqAxD8rDfUSDVWmVRVpOkLGQf7a6Vk9QtJ98clmndlYrHhRDcSc62N5UvOUJfhRG8l2DpyEPm/IaWvktrQ4= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.2.80) by AM6PR04MB4951.eurprd04.prod.outlook.com (20.177.33.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.24; Tue, 20 Nov 2018 09:25:35 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::29b5:b3ed:3854:cf1c]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::29b5:b3ed:3854:cf1c%4]) with mapi id 15.20.1339.026; Tue, 20 Nov 2018 09:25:35 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv2 00/25] PCI: refactor Mobiveil driver and add PCIe Gen4 driver for NXP Layerscape SoCs Thread-Topic: [PATCHv2 00/25] PCI: refactor Mobiveil driver and add PCIe Gen4 driver for NXP Layerscape SoCs Thread-Index: AQHUgLL+3haSNWHwCUuT1m1UFMihrw== Date: Tue, 20 Nov 2018 09:25:35 +0000 Message-ID: <20181120092615.11680-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK2PR03CA0050.apcprd03.prod.outlook.com (2603:1096:202:17::20) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:aa::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR04MB4951; 6:YSkODMLjaXWqbylcqdNtQMIEiwwggXcFEMfUDXfo9Legqb4Yq4xDwtuQNmMC03gOAFp086DIhblvbx8N8/8C9wfOpes/tV33ciV4JEeUBdwCxAIbI7ZHPebC8vmEWrBtvo2C43+M3ksN/azZoVT5rnpg2Ioh6PcznLJ5lfc1Bh2AdrpCrrO2M5fq/+YQHYzpKtPnpgK4vtdX95tBxv0j/Q2pLfUU1Xj/1dfvebOBAyzaOJZPzOy0U90Dq7pFsSNJxByU9+RSybpkHaA2PyTqwZHcZcidVN70HVnhviLJAF0b/bQGYeZCHNjiMBS5bRP+tpKAYBEG7JEXqdLSUeWmRtGlZGjOVX89UNwXzOnKUnHPnAT4KdOaPLHny513acu1naKc0XTqmpk10ZlItuimQmSPWhA+lO+GCfeqlM3xubt5cfxNo3JFE+KLU423V7P3ATUvaI6BcH/3/Y+vUXFMQw==; 5:qe/I9oVh4X+aN6AdmQx9LaXkVrQjqO9zfO8D08gVNVTyCm+Af0/7V8TjpzcAGwtB5dJBZm2nDciHHaesy7N/bskJyhe4NXPWQTLHkE774DITySOta5TtlJIvZrbqsh0/qq9TvHg5ear4mj0xKFTd7lCf8UjfRRkMWwKXRTtMV/s=; 7:odIaNqVvewTCcb/Z8qf6J7qQ50q6XQfPJxlexYFfGHrd+HgdwPZeFLEsELsKShrRpKN6M0TzqH/HMvkpmAiHwKSFAUgkRVIU4Kp7LzsTg9JnYivqQESsA4J8oHwM/ZAHqNHL3LT5qv76rBzN2m7pMw== x-ms-office365-filtering-correlation-id: 8ba2b1c5-d655-4cbb-75a5-08d64eca204c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4951; x-ms-traffictypediagnostic: AM6PR04MB4951: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231442)(944501410)(52105112)(10201501046)(93006095)(93001095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR04MB4951; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4951; x-forefront-prvs: 08626BE3A5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6029001)(366004)(136003)(376002)(346002)(39860400002)(396003)(189003)(199004)(6486002)(2501003)(25786009)(1076002)(6116002)(97736004)(3846002)(71200400001)(14444005)(71190400001)(2201001)(386003)(26005)(86362001)(478600001)(4326008)(52116002)(256004)(6506007)(99286004)(186003)(14454004)(106356001)(7736002)(6512007)(105586002)(81166006)(102836004)(6436002)(7416002)(5660300001)(8676002)(2906002)(8936002)(81156014)(36756003)(2900100001)(68736007)(486006)(316002)(305945005)(54906003)(476003)(2616005)(110136005)(53936002)(66066001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4951; H:AM6PR04MB5781.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: akVm7cxR5v4Vwe9jts/s/AkPYo0NxvpXC5T0DBhQwN/705IshsaFsk0sOl1skFiVadpxDW00iAgvr+9FpAgz7YgtoVFfiIrW1wcmofEwACUJpKA1c/vrewVEI2iIpHd1uTD+mO/T3WBnyOQXXfbRQpeRlr7yuujyc8IqX5t/O+aYzxzxOCtIaGSmvDVVFEPv9p4G0ElyUcJo070xYeotSPncPE9qnWic7yUrQBANRvZ8fvAegO1x8OgxKXkF/zn6ck+QqaqJHjyhSKxpj2iffwxSGkBOwk8Nopnj3ORNDf7SDNFj93fac7jE0B14BdAY2t2jNZaE5T9VXVbEhSxnkPgvU8UovBUKCRSYxjpeTWs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <271BC4ECABA03944A8CB21D6BE095D7C@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ba2b1c5-d655-4cbb-75a5-08d64eca204c X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2018 09:25:35.5652 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4951 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181120_092629_621481_2B855E83 X-CRM114-Status: GOOD ( 18.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang This patch set is aim to refactor the Mobiveil driver and add PCIe support for NXP Layerscape series SoCs integrated Mobiveil's PCIe Gen4 controller. Hou Zhiqiang (25): PCI: mobiveil: uniform the register accessors PCI: mobiveil: format the code without function change PCI: mobiveil: correct the returned error number PCI: mobiveil: remove flag MSI_FLAG_MULTI_PCI_MSI PCI: mobiveil: correct PCI base address in MEM/IO outbound windows PCI: mobiveil: replace the resource list iteration function PCI: mobiveil: use WIN_NUM_0 explicitly for CFG outbound window PCI: mobiveil: use the 1st inbound window for MEM inbound transactions PCI: mobiveil: correct inbound/outbound window setup routines PCI: mobiveil: fix the INTx process error PCI: mobiveil: only fix up the Class Code field PCI: mobiveil: move out the link up waiting from mobiveil_host_init PCI: mobiveil: move irq chained handler setup out of DT parse PCI: mobiveil: initialize Primary/Secondary/Subordinate bus number dt-bindings: pci: mobiveil: change gpio_slave and apb_csr to optional PCI: mobiveil: refactor Mobiveil PCIe Host Bridge IP driver PCI: mobiveil: fix the checking of valid device PCI: mobiveil: continue to initialize the host upon no PCIe link PCI: mobiveil: disabled IB and OB windows set by bootloader PCI: mobiveil: add Byte and Half-Word width register accessors PCI: mobiveil: make mobiveil_host_init can be used to re-init host dt-bindings: pci: Add NXP Layerscape SoCs PCIe Gen4 controller PCI: mobiveil: add PCIe Gen4 RC driver for NXP Layerscape SoCs arm64: dts: freescale: lx2160a: add pcie DT nodes arm64: defconfig: Enable CONFIG_PCI_LAYERSCAPE_GEN4 .../bindings/pci/layerscape-pci.txt | 57 ++ .../devicetree/bindings/pci/mobiveil-pcie.txt | 2 + MAINTAINERS | 10 +- .../arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 163 ++++ arch/arm64/configs/defconfig | 1 + drivers/pci/controller/Kconfig | 11 +- drivers/pci/controller/Makefile | 2 +- drivers/pci/controller/mobiveil/Kconfig | 34 + drivers/pci/controller/mobiveil/Makefile | 5 + .../controller/mobiveil/pci-layerscape-gen4.c | 254 ++++++ .../controller/mobiveil/pcie-mobiveil-host.c | 628 +++++++++++++ .../controller/mobiveil/pcie-mobiveil-plat.c | 54 ++ .../pci/controller/mobiveil/pcie-mobiveil.c | 246 +++++ .../pci/controller/mobiveil/pcie-mobiveil.h | 222 +++++ drivers/pci/controller/pcie-mobiveil.c | 861 ------------------ 15 files changed, 1677 insertions(+), 873 deletions(-) create mode 100644 drivers/pci/controller/mobiveil/Kconfig create mode 100644 drivers/pci/controller/mobiveil/Makefile create mode 100644 drivers/pci/controller/mobiveil/pci-layerscape-gen4.c create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil-plat.c create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil.c create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil.h delete mode 100644 drivers/pci/controller/pcie-mobiveil.c