From patchwork Tue Apr 20 06:17:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Smlhbmp1biBXYW5nICjnjovlu7rlhpsp?= X-Patchwork-Id: 12213385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 474F0C433B4 for ; Tue, 20 Apr 2021 06:18:17 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB66C613B2 for ; Tue, 20 Apr 2021 06:18:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB66C613B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=trkzQudtO+4NYsecxu7kcgYGxEnc+PiiRdnv+Mkgu4Q=; b=eemnKdC6AA5VRcT4AE6swCEmQu itc51w0w38kLuBI4uwX8rJ766JGB63KCvTWBaJajIFLvobzvwrAm4CJBoEt0sThM3v+fHi5tgsCal Us9Sbz850rk0DXSvKlO8vaieXv20HgHrqOONYd+9QglQbyWu8PrIh/ezHZn5VYUVMezXXRauqhBEY UmZpyYy6XLObq+BjyWBKeq76PuDMW4NE2W079JpS0wADqCK3mKzp76j0P0Zk0/FFudRMOZdeXr/zl 0B0DHJL3Bq9YWbGr8tCj9rrFv8IfAGZPjx5FyVxL+uVQ22z2R1fOk0E/aqJqFggPgmo1ElU24/c6H xh0L08XA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYjhv-00BJ4F-VQ; Tue, 20 Apr 2021 06:18:00 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYjhs-00BJ2z-88; Tue, 20 Apr 2021 06:17:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=r36BGif7LWzzFXYgg7Iio9ttxDEIqdn1hXwqlKoe+KU=; b=Z+EuJcKMMrPIAtIgKtFLvh93kG Lnpj67xqw8q+mVfZIhgE8AFDBXCHCDtILDSdPyYcPglep7j2F0EnBSHt30gaQmJ5C4eRakr6py1Nr u2KCdLaUjxuLcayjGvwGnvjtpXOsE1g/uFcR/f/ytn6KWC2vAzTtOQwjOSv46A8sBNEGKMVo/kfth lpnwDcvSZlTbllSm1wLt2FN9vb841Q4EsPha2pWW0oIhcAbEuqXbNBUNoAqKXydMelp/aLOVt06Mn 0VZ+c4ARmIfng9iTiBQCEl3eT9g7sY2cmn7JODYzB8SXUMQVbme/htp/8r0J6NXo5Zq4gUBZfljrq uGZulTkw==; Received: from [216.200.240.184] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYjhm-00Bq23-8e; Tue, 20 Apr 2021 06:17:54 +0000 X-UUID: dafba5ea21b64bf48ed1a97b09557803-20210419 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=r36BGif7LWzzFXYgg7Iio9ttxDEIqdn1hXwqlKoe+KU=; b=Fgqruh840sIVnuvpwE3+0B4ybbDn0S9BJzxA+p/dC1naxd1Fx6ejS5kBLtbBYfpQiMitRq+lN5viSG5kUvNVgko0pw+7JN5SCfAN4rKB9jiVMiox3shpCV/cW0UbWo++tiC7CPXM11jXY9bSUKNgAMPIa2yywuTUAY2eqq0zsWU=; X-UUID: dafba5ea21b64bf48ed1a97b09557803-20210419 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 966524791; Mon, 19 Apr 2021 23:17:42 -0700 Received: from mtkmbs05n1.mediatek.inc (172.21.101.15) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 19 Apr 2021 23:17:40 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 20 Apr 2021 14:17:39 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 20 Apr 2021 14:17:38 +0800 From: Jianjun Wang To: Bjorn Helgaas , Rob Herring , Marc Zyngier , Lorenzo Pieralisi , Ryder Lee CC: Philipp Zabel , Matthias Brugger , , , , , , Jianjun Wang , , , , , , , , Krzysztof Wilczyski , =?utf-8?q?Pali_Roh=C3=A1r?= Subject: [PATCH v10 0/7] PCI: mediatek: Add new generation controller support Date: Tue, 20 Apr 2021 14:17:16 +0800 Message-ID: <20210420061723.989-1-jianjun.wang@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_231750_347558_7C85CA50 X-CRM114-Status: GOOD ( 14.58 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: mtk15901 These series patches add pcie-mediatek-gen3.c and dt-bindings file to support new generation PCIe controller. Changes in v10: 1. Fix the subject line format in commit message; 2. Use EXPORT_SYMBOL_GPL() to export pci_pio_to_address(). Changes in v9: 1. Use mtk_pcie_parse_port() to get the hw resources; 2. Remove unnecessary logs; 3. Add local IRQ enable status save/restore instead of the enable/disable callbacks; 4. Fix typos. Changes in v8: 1. Add irq_clock to protect IRQ register access; 2. Mask all INTx interrupt when startup port; 3. Remove activate/deactivate callbacks from bottom_domain_ops; 4. Add unmask/mask callbacks in mtk_msi_bottom_irq_chip; 5. Add property information for reg-names. Changes in v7: 1. Split the driver patch to core PCIe, INTx, MSI and PM patches; 2. Reshape MSI init and handle flow, use msi_bottom_domain to cover all sets; 3. Replace readl/writel with their relaxed version; 4. Add MSI description in binding document; 5. Add pl_250m clock in binding document. Changes in v6: 1. Export pci_pio_to_address() to support compiling as kernel module; 2. Replace usleep_range(100 * 1000, 120 * 1000) with msleep(100); 3. Replace dev_notice with dev_err; 4. Fix MSI get hwirq flow; 5. Fix warning for possible recursive locking in mtk_pcie_set_affinity. Changes in v5: 1. Remove unused macros 2. Modify the config read/write callbacks, set the config byte field in TLP header and use pci_generic_config_read32/write32 to access the config space 3. Fix the settings of translation window, both MEM and IO regions works properly 4. Fix typos Changes in v4: 1. Fix PCIe power up/down flow 2. Use "mac" and "phy" for reset names 3. Add clock names 4. Fix the variables type Changes in v3: 1. Remove standard property in binding document 2. Return error number when get_optional* API throws an error 3. Use the bulk clk APIs Changes in v2: 1. Fix the typo of dt-bindings patch 2. Remove the unnecessary properties in binding document 3. dispos the irq mappings of msi top domain when irq teardown Jianjun Wang (7): dt-bindings: PCI: mediatek-gen3: Add YAML schema PCI: Export pci_pio_to_address() for module use PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192 PCI: mediatek-gen3: Add INTx support PCI: mediatek-gen3: Add MSI support PCI: mediatek-gen3: Add system PM support MAINTAINERS: Add Jianjun Wang as MediaTek PCI co-maintainer .../bindings/pci/mediatek-pcie-gen3.yaml | 181 +++ MAINTAINERS | 1 + drivers/pci/controller/Kconfig | 13 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pcie-mediatek-gen3.c | 1025 +++++++++++++++++ drivers/pci/pci.c | 1 + 6 files changed, 1222 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml create mode 100644 drivers/pci/controller/pcie-mediatek-gen3.c