From patchwork Tue Nov 6 13:19:03 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: 10670303 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 19C2F13AD for ; Tue, 6 Nov 2018 13:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0896A298E0 for ; Tue, 6 Nov 2018 13:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F094F2A34A; Tue, 6 Nov 2018 13:19:11 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59778298E0 for ; Tue, 6 Nov 2018 13:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730444AbeKFWoU (ORCPT ); Tue, 6 Nov 2018 17:44:20 -0500 Received: from mail-ve1eur01on0085.outbound.protection.outlook.com ([104.47.1.85]:26496 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729728AbeKFWoU (ORCPT ); Tue, 6 Nov 2018 17:44:20 -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=Xhke7sgr8C1YyqIOUhT1gCbedwmSstsFwRr+DDhukrQ=; b=CR1jwQM6I6KPmggOgtprC8reGQMUUJpWVqsDRnKM5GDNiBpBYO+8i+Qlb9r1hfFJVhNRDHnlnFKJpTw1Sbvs6iNJZ6jRCwKQL3Maik4JP/JCiSiWBeb1OUX0JFkFJBRQSL7TV0sJpk8qSTbSZXpnHwcZrHmwOvoEmnXkBjkgnvI= Received: from DB5PR04MB1221.eurprd04.prod.outlook.com (10.162.155.27) by DB5PR04MB0984.eurprd04.prod.outlook.com (10.161.196.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Tue, 6 Nov 2018 13:19:03 +0000 Received: from DB5PR04MB1221.eurprd04.prod.outlook.com ([fe80::6c36:f4cb:26c2:e8cb]) by DB5PR04MB1221.eurprd04.prod.outlook.com ([fe80::6c36:f4cb:26c2:e8cb%2]) with mapi id 15.20.1273.035; Tue, 6 Nov 2018 13:19:03 +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" CC: Mingkai Hu , "M.h. Lian" , Xiaowei Bao , "Z.q. Hou" Subject: [PATCH 00/23] PCI: refactor the Mobiveil driver and add PCIe support for NXP LX SoCs Thread-Topic: [PATCH 00/23] PCI: refactor the Mobiveil driver and add PCIe support for NXP LX SoCs Thread-Index: AQHUddNJ+rvIvxvt8E65Px/kcnc2Yw== Date: Tue, 6 Nov 2018 13:19:03 +0000 Message-ID: <20181106131807.29951-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: HK0PR03CA0008.apcprd03.prod.outlook.com (2603:1096:203:2e::20) To DB5PR04MB1221.eurprd04.prod.outlook.com (2a01:111:e400:51c2::27) 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;DB5PR04MB0984;6:XoE1WKw/G2dd8Oo7Ls7E/NwqRq3eq8TaMe1MLD70KSzbRqOr48BGUD1bQKIb3bwoZctRHeCMRaAUIZoRAPkGvGW+dc3756IY8Hy5228uTYeoi8kgJWjpivn1vrnwj3vXtRiLBV5wZSXo5ARfvYIfbkSiNRTVZHia4RH2ITu/hRfOBmcitT4SFZj79UeehK9beSsJ/cCXxsIwplmuZuqeQONabcGnjzLZdcNm3Q76phAWfdnsb9cuhCEMpLyZaF22OHaeThV+E6CYxc7ocksWH55oUwqvhWRYqem0JnAYxEJsG+efFNQSN2FHsZCyF1XmCIpMb286cuhhrIyFZcuiGoylcbTYTaKTkXhRljDAIpyGaqsdRaWG0ijKlLuGWTmaokMsoc7I/mXEK8EX9gqUZT4jiUXvmNPDWV7FwWbdJ/KrItpjuwkMqwrvOihufuM3sJTHt6w0y9HQMVoQLmt3nw==;5:hvrCD/sX2xoliD+cZS5MUc/1mQavQUZ3YidFu67HxsuNaZSPe60cSakxihACl6XzyGp16yhd7f9l1WRYQHTtsx7KqVnv+Rvu20UnvhOhQadVrD5AB7hY38KM7dGISKB+14SAcK/mnsBRuUsa1lVX8uf3vBFlaa3CAkQKQnb//Ts=;7:GRnFlLn9f5BvNy3+hdk/2aezjnxVd7eN2akAkksuVWqbuO4C3Rs4zftbBFXlW2LJ7Og6tnKDlYEtLHyIse/QRK0qN3cz4+LeL5ZaM2UzBvbPeiee9dhemRpzgQThoXqu5sXt30Fx9qUBoHeCcQ0WZA== x-ms-office365-filtering-correlation-id: 492a5134-c58a-4a46-b1ec-08d643ea6bc1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB5PR04MB0984; x-ms-traffictypediagnostic: DB5PR04MB0984: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089)(185117386973197); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:DB5PR04MB0984;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB0984; x-forefront-prvs: 0848C1A6AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6029001)(376002)(346002)(39860400002)(366004)(136003)(396003)(199004)(189003)(68736007)(486006)(386003)(8936002)(3846002)(99286004)(71190400001)(81156014)(71200400001)(81166006)(53936002)(8676002)(105586002)(110136005)(54906003)(5660300001)(2616005)(66066001)(97736004)(305945005)(7416002)(476003)(2900100001)(7736002)(106356001)(14444005)(2201001)(4326008)(2501003)(25786009)(1076002)(186003)(6486002)(26005)(2906002)(256004)(6512007)(36756003)(6116002)(6436002)(316002)(102836004)(52116002)(6506007)(86362001)(14454004)(478600001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR04MB0984;H:DB5PR04MB1221.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-microsoft-antispam-message-info: 07x0hmaCEty1di3jQCBkn/9YBakQ5QB+lDJtxW1PIcwg3ONpgbyxG1t3MP3E+C2F9ui+U89qEXHM+ybTFf1jrYo9u6OIcSFXWQeNfClMjte4m3Pcif6d/SXFjQ0zftQYeyOoxfKYpUMudM3VOuyXI665HCqnGFEP/yzzjVHY5L1A/5re91PhOkneDG2d02V4BWphLQs8QIF4wvzjkEahehPO3XWyvf/M7Rwg7H9fTV8EcPF6oBUtxi1V+C8LDr0GJWNmpfmeJLGuuAcfgH2aasG+u1MBinew5zsNVAVHQPY9R+mC9+22Juy0dYJPf0mB30uFyj0xBGh5mY0WXSy4YSTbqOfRAyjkXfwEdksWCbU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <49EC5FCA622C5144B1E825412F41A7AD@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 492a5134-c58a-4a46-b1ec-08d643ea6bc1 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2018 13:19:03.5904 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB0984 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.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 LX series SoCs. Hou Zhiqiang (23): 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 the inbound/outbound window setup routine PCI: mobiveil: fix the INTx process error PCI: mobiveil: only fixup 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 the Mobiveil driver 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: change prototype of function mobiveil_host_init dt-bindings: pci: Add NXP LX SoCs PCIe controller PCI: mobiveil: add PCIe RC driver for NXP LX series SoCs arm64: dts: freescale: lx2160a: add pcie DT nodes .../devicetree/bindings/pci/lx-pci.txt | 52 ++ .../devicetree/bindings/pci/mobiveil-pcie.txt | 2 + MAINTAINERS | 10 +- .../arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 157 ++++ drivers/pci/controller/Kconfig | 11 +- drivers/pci/controller/Makefile | 2 +- drivers/pci/controller/mobiveil/Kconfig | 34 + drivers/pci/controller/mobiveil/Makefile | 5 + drivers/pci/controller/mobiveil/pci-lx.c | 222 +++++ .../controller/mobiveil/pcie-mobiveil-host.c | 622 +++++++++++++ .../controller/mobiveil/pcie-mobiveil-plat.c | 54 ++ .../pci/controller/mobiveil/pcie-mobiveil.c | 245 +++++ .../pci/controller/mobiveil/pcie-mobiveil.h | 221 +++++ drivers/pci/controller/pcie-mobiveil.c | 861 ------------------ 14 files changed, 1625 insertions(+), 873 deletions(-) create mode 100644 Documentation/devicetree/bindings/pci/lx-pci.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-lx.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