From patchwork Tue Jan 29 08:08:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 1032549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="eM2adenx"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43pfJk5XPNz9sDr for ; Tue, 29 Jan 2019 19:08:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726979AbfA2IId (ORCPT ); Tue, 29 Jan 2019 03:08:33 -0500 Received: from mail-eopbgr30055.outbound.protection.outlook.com ([40.107.3.55]:14400 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725468AbfA2IIc (ORCPT ); Tue, 29 Jan 2019 03:08:32 -0500 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=nPPBhB/PEqxZaqY5vkmcIdTM6symstCZ4vRv7rDGd6o=; b=eM2adenxW36oQKGozF8V4JJFYAuBQeZ+TrKFFNNYI5fWRckyGPBbW4/QSwchugexsBO6tvxh7OYXzuu0djpt0UUdu2jWu0Y+wu7lyP4rQTLB2ofSaKuztWkFQEvEqvkw9kYWUWjp2wvKCHfBIvdCt+RYZTUK40nMmKZz4O0xTV4= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5847.eurprd04.prod.outlook.com (20.179.3.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.17; Tue, 29 Jan 2019 08:08:28 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::9c0:e3aa:b41f:9504]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::9c0:e3aa:b41f:9504%3]) with mapi id 15.20.1558.023; Tue, 29 Jan 2019 08:08:28 +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" CC: Mingkai Hu , "M.h. Lian" , Xiaowei Bao , "Z.q. Hou" Subject: [PATCHv3 00/27] PCI: refactor Mobiveil driver and add PCIe Gen4 driver for NXP Layerscape SoCs Thread-Topic: [PATCHv3 00/27] PCI: refactor Mobiveil driver and add PCIe Gen4 driver for NXP Layerscape SoCs Thread-Index: AQHUt6nQIKafKgn6QEuhQ0P6HOWTOw== Date: Tue, 29 Jan 2019 08:08:28 +0000 Message-ID: <20190129080926.36773-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: HK0PR04CA0008.apcprd04.prod.outlook.com (2603:1096:203:36::20) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR04MB5847; 6:U/uzNn17v3Ts8Nw2LkXlfq9FZAZECR/W4g0O3BPebRNYZpr/Ey7dDGSBTYRxJqxrmeINh1wQxNCcn81eF4tAEB/Cj62PLprzKBhTYOrTPuYUKA2tcMvU+bIouIw8O/q2awQDWAoXjo9XvV1xZZ0Q6u1OtEazZGHn9lD39y32hETZOSZN9x6bWATmK+lcDA7ajC2RpKqjsocdEsg9ZETRP0bQrTm4WMJ2WeeXKa+XQYf/C2rWb1VBLsTEEaj/tF2w0gXm09t7d3ZeTxMvfcMalUE8qOj2joAbrD7Vw/r8BQ6yt5CMGfHhhSE233N8kteGuAR2zQAeqbFkls9UDevkadOTDSNYsSJk+g6Ir+4mQCFu4lf2FD74i4e5FFRVdp4WX9m0N6OiUDH0Q4NgUEbQLbGIX75DLecX34QppBZBPpoRYp9Z32BCvu8cwDJzyN09pitqh+T6QTqWmN0u88WfQw==; 5:zkX9dJysNEVq2isolr6NbT6XNlqCNPPgoD+9qrA3kczSxs6owSVzjPZl40BWL3t2RTIRzHWYS1SzDNZsh5HiFw11NjVwuMI6PwgZ4fdsy4JunNMamt6gXcDp4evgmVLOeLaVx5AjqxdSTIob35gGlYEmJhSqrmYfOEQ3VoxrPcsCXnhu99cZ/hIJA9YI6QytMDxVHjS9/L9Ee7zIcc2/rg==; 7:tXAIJaYpcQw2flBfczYrZOW/9OOKbZQVJ5pWsF8OC6i9ittpsjzOfCiPQCKkd66Oeu/jrM/b/JB+4DYl1qztjAiP/mNLEsW9+Uu1W+kZVGod1/v7PuGInA3n+1JVBcx8BryhFbcrakAge33pL6IZyw== x-ms-office365-filtering-correlation-id: 68ff47de-c64d-4b64-8885-08d685c0f33e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5847; x-ms-traffictypediagnostic: AM6PR04MB5847: x-microsoft-antispam-prvs: x-forefront-prvs: 093290AD39 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6029001)(39860400002)(396003)(346002)(366004)(376002)(136003)(199004)(189003)(14444005)(14454004)(66066001)(478600001)(2616005)(6436002)(71200400001)(486006)(54906003)(476003)(99286004)(110136005)(52116002)(256004)(6486002)(36756003)(6506007)(386003)(316002)(97736004)(26005)(102836004)(71190400001)(186003)(81156014)(81166006)(7736002)(8676002)(3846002)(50226002)(305945005)(4326008)(7416002)(25786009)(1076003)(2906002)(53936002)(6116002)(86362001)(2201001)(105586002)(106356001)(8936002)(2501003)(68736007)(6512007)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5847; H:AM6PR04MB5781.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: /FCZdVJJqKkPid9cVjqd/kAhBvfkELSaDBWv8t60wmv3IoNxSsbbAlsmK0J02LJr+ljVojt0s+BAwDGumDpKm1z0wErVJ7eJOzPkszgV2asfm8chi1JwkN3dPr0yLrBwbWBLlHr1Nu60a8e8Pl2RoZ7B4zA+xCSUcNODdMzsBBSECg9WAnWfU9LjbIZfGfvlRE/Dbhw8JjxOQHxW6zDn8JT8D5Vnr4/E+XE877tBEFvrTckKs21Saui9zp46VYa9L2X+6yHLYwOtmSocXLilKDHZdBPyPor0hqHQvRb6dEMMt/XkkAHx1xotPrhUsSxDTQteNHXx7MLuTx9bhYvuxcyPgup3STlsmWubwyrIzHDHSs+EgsCe0tWEO2RruuPq3+pgHFVSwqJOaDRb5lGICqPm4dVC8UVW9zS7UsG2jbg= Content-ID: <5EB28B97FCD6E348AA7971A9D134AA44@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68ff47de-c64d-4b64-8885-08d685c0f33e X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jan 2019 08:08:22.4742 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5847 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 (27): 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 PCI: mobiveil: ls_pcie_g4: add Workaround for A-011577 PCI: mobiveil: ls_pcie_g4: add Workaround for A-011451 arm64: dts: freescale: lx2160a: add pcie DT nodes arm64: defconfig: Enable CONFIG_PCI_LAYERSCAPE_GEN4 .../bindings/pci/layerscape-pci-gen4.txt | 52 ++ .../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 | 306 +++++++ .../controller/mobiveil/pcie-mobiveil-host.c | 640 +++++++++++++ .../controller/mobiveil/pcie-mobiveil-plat.c | 54 ++ .../pci/controller/mobiveil/pcie-mobiveil.c | 246 +++++ .../pci/controller/mobiveil/pcie-mobiveil.h | 229 +++++ drivers/pci/controller/pcie-mobiveil.c | 861 ------------------ 15 files changed, 1743 insertions(+), 873 deletions(-) create mode 100644 Documentation/devicetree/bindings/pci/layerscape-pci-gen4.txt 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