From patchwork Thu Nov 24 13:58:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 13055020 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 200CFC433FE for ; Thu, 24 Nov 2022 14:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=EZ2aU8n7/RdRTg5X2T5KNNRBSWvAn+HTXB8r/z13RDg=; b=ezVbEZAYF+/t/d 1iCF9apF4DGa7urK2eS38iBIxeUz/lRBgdU2531ik/LUSLww4xpUziPxWrrx7t+GdtnHuQpbd+4Dq Cw9/GaL/m7iblUdqz59AySDYCyRbAPth/UD8w2znVVsX/v+psZGilNBP3ycMFoOzK7eJpIcjv1vX4 sEQyqcSPOU5UTXoguqcKKYC1mMVIZKhqK1DE+YEBOz2f1643wcKpwvwI1VRizB2zczv1Yd5k/kNNf rQtkKpkB3cjCiNJCwCzvKrnYrpsZohFZYIW2Ifuw8Q3JqEmbvDq/lAkA9Xf0vse8meDLgp6182JUC hZpZktrXF9t1wiNtxXIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyCl2-0093EQ-QV; Thu, 24 Nov 2022 13:59:17 +0000 Received: from mail-db8eur05on20721.outbound.protection.outlook.com ([2a01:111:f400:7e1a::721] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyCkl-00935e-Tp for linux-arm-kernel@lists.infradead.org; Thu, 24 Nov 2022 13:59:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=anXj82PDgZayXz6GJg/3adoGxE0RCUvgfL9agNTc5OErAXYsBRMxEdw82fJfHCDAV/qVcJdlaoh/db4Sr+HNhVO5uOg9MIFM6Pa8kT5dXmp/vaAdWT21vy6103q2CFJG7LQsXHe9lvPjik82Zqtcy60xL0UXO9yT9JcQsrYk/ogH2JZrUENYImSHoUR2ZoDXi53gLfqfOziNFMJqHCAfwSJPizPqe+0fVk2F4w32YtU5c+oQvY04QSjkYkmSxNAhhQw2Pg4F18wkGZvb+j7fs7PzLEU0+0UFtrN9TolL6F+w337QVY3RYoIDiYMQznbhyS+X0wqqK7fCdVgnhku9jA== 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=yOFx6ykw4Yty05usC03e13PABLmMILjwHo0n3YtWomA=; b=JZAiMNr3XEXHE/FLvueFxLFf/1KhjkUz6FmGJtLWhU1mDtDXw1+F+qIaP7H/Ua0SYaRGSOdZzu7A+4i2AvGrEuJREj9zH8EJh8Z8/ytUzZvx4UfBWbgc0RUNvT2e+8oS90lsRAY/NBFw84VhWEeFJOi4njTUDlvhHCw0cVx29+dIG/Mrj008ykfBVwkEAqRt+MMLpHJ2nGe+FAkWNp7UGSAEwc3IKDj2C4W13WurL9UlOLQWObrL+xsazGb+XaaLr2rd2Jl+0uz1YK4G8WkE2Xe/utiwb24OxBDozABuwo2MDux3nGcoPwTVYsHGj3BCarMQWagObw90YJjwKK4siw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yOFx6ykw4Yty05usC03e13PABLmMILjwHo0n3YtWomA=; b=vgqGJJ3YBjMEMT7sZo0Ixllj9U7togNlAlUoE8ZLxj4ItOb7vNeMVgCAsZPuemrWXnjhFjSQwESr3YQL8gysMJOq6z2ZP8nXsTBSPi2QN+ca4WJ5HuD85sQBFBKXgEI1VRZpE8b7MJs8YLljDojvWaLKZq8YU4nItY0xvdXj7Bg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=plvision.eu; Received: from VI1P190MB0317.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:38::26) by AM7P190MB0758.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:117::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.20; Thu, 24 Nov 2022 13:58:53 +0000 Received: from VI1P190MB0317.EURP190.PROD.OUTLOOK.COM ([fe80::5912:e2b4:985e:265a]) by VI1P190MB0317.EURP190.PROD.OUTLOOK.COM ([fe80::5912:e2b4:985e:265a%3]) with mapi id 15.20.5834.016; Thu, 24 Nov 2022 13:58:53 +0000 From: Vadym Kochan To: Thomas Petazzoni , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Krzysztof Kozlowski , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Elad Nachman , Vadym Kochan Subject: [PATCH v2 1/3] dt-bindings: PCI: armada8k: Add compatible string for AC5 SoC Date: Thu, 24 Nov 2022 15:58:26 +0200 Message-Id: <20221124135829.2551873-2-vadym.kochan@plvision.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221124135829.2551873-1-vadym.kochan@plvision.eu> References: <20221124135829.2551873-1-vadym.kochan@plvision.eu> X-ClientProxiedBy: FR3P281CA0120.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::18) To VI1P190MB0317.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:38::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P190MB0317:EE_|AM7P190MB0758:EE_ X-MS-Office365-Filtering-Correlation-Id: fc024538-8a7f-434d-655c-08dace240584 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4hqvBV8gKRt+8VayVMYW/cmCUnqkRk0SI5gqEZd1vUPt7nIgtEoeyRq6MBF9pa2AnGACaATD4qTo83yVXhqHBp03dV1poK3roFPD3kbHd/SM0Ywk9tGed4QGFOICgKCcAvFWIOGtRKMnLg8hYW8pm//mnvzmHpV5XxGZop12VimiyQ4SspPi1Be7hBjU5223OOpwqv+a6VxFGb+piorch0AxMbQuuP7+YBlBKlAZZQtkw+7TG8AqeVJvHM1TvjvR8gAs0Fis8YnDNaICOrtJkBsODMekYmBMhmtHgWbJllqXMDMu2YaQ0zqo1axAz7LplHqIa8QWRK4nTDQDIE5slIRrkdtVbHR+vQd3wmvum0mWlA3+qyS8Rjvs8OnA6bvUZQgn0U0zMi5yXORvOyR05eq7Hj2v4Z68jGHibLganCo/ul2zZe8hhz12bUlhhBoXJBbCh9KoF2PVZ0nKBBMy55aKNUoZU5VUCb1N7vvN1AsW8GP3Irdgu9ZnIjIr4U+6cg/P+IO2GPWrWcZQ8tuJuFvmXqxox86juBcquZeQWhwmY8nogzCSbUVL14Kfoaw3Ep+VwVMqBulT2vo2D/vpteMyI/FkLqC5ZsJYv3ZsDA9pUEI0usL1wnNAkISIvHschDp0Np6/OJC68sMAb39g5mJhDJelvSMfeiXVdKcCgNU/49x6mWCLG94KDu6NUU1/sqBe6GEZqrCGbdUKdai6ASc5nHT7ty9VG/caxAiiiAE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P190MB0317.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39830400003)(34036004)(366004)(346002)(396003)(451199015)(1076003)(8936002)(36756003)(83380400001)(2906002)(2616005)(41300700001)(44832011)(5660300002)(41320700001)(86362001)(921005)(38350700002)(38100700002)(6506007)(110136005)(107886003)(54906003)(186003)(316002)(6666004)(52116002)(26005)(6512007)(7416002)(508600001)(6486002)(66946007)(8676002)(4326008)(66476007)(66556008)(32563001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h6f6WzZ3blzSNCW3BcaJZFkGwG3XBJ4WiXi8V13fjBPG87RLhy/eRVnb/XJ4QOzgor0p55EcTnIhr705zi2Sdooww7cYQ1kbKV9bCjZwh4FVRGIMuRgME7BKDVWBTYv/E3SQdhoDU8JapeZnZijlwY9dL1iRibrc60qGrY3TmCin3FZ3dxIagAd98IB8vTZD7vaUj/NZXAMbvcmVprWBvKcxC2Kwe3kR2+HBn4CHCuI6+Pd/fzngK9odRNZSBMSrpRg7oTb7wD5Vrv4ZtkE+yq85qhO0g79u/L25zeJR4GJU/DfxIetsaUt22hFhLElXTjTWOkUerKLLTHCVOJER+5I/eKBPB0r+cUtDLh8itz7f98w/R7QT3IJ5f66ECoSeqwUm2MnDgqzSv9v8ZJBB0tqD9qIuJD0hKuq1mGgyxcpscU90GFfXntt9qszmtoB8u4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NGV6CVBBUIuXWh/XMR11JaGJWIfa72sYWC7axUmG7DUQM3j3pG7CFXBt2ebBTbYR0czzZDcdJkEJh0A== X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: fc024538-8a7f-434d-655c-08dace240584 X-MS-Exchange-CrossTenant-AuthSource: VI1P190MB0317.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2022 13:58:53.4459 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tRSd+6S7H93q8Ah0a+VfB8skijbjNAr/fniqEfv+ocxZRjiRX5R6/tcm26CtUHFyGBDZPNFcn1Z0s8EsP96HU52V9dsTv/f3DiV12JUtyGs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7P190MB0758 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_055859_984294_3F21D87F X-CRM114-Status: GOOD ( 11.83 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org AC5 SoC has armada8k PCIe IP so add compatible string for it. Signed-off-by: Vadym Kochan Acked-by: Krzysztof Kozlowski --- v2: no changes Documentation/devicetree/bindings/pci/pci-armada8k.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pci/pci-armada8k.txt b/Documentation/devicetree/bindings/pci/pci-armada8k.txt index ff25a134befa..b272fa4f08b5 100644 --- a/Documentation/devicetree/bindings/pci/pci-armada8k.txt +++ b/Documentation/devicetree/bindings/pci/pci-armada8k.txt @@ -4,7 +4,9 @@ This PCIe host controller is based on the Synopsys DesignWare PCIe IP and thus inherits all the common properties defined in snps,dw-pcie.yaml. Required properties: -- compatible: "marvell,armada8k-pcie" +- compatible: Should be set to one of the following: + - "marvell,armada8k-pcie" : For A7K/8K family of SoCs + - "marvell,ac5-pcie" : For AC5 family of SoCs - reg: must contain two register regions - the control register region - the config space region From patchwork Thu Nov 24 13:58:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 13055021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 857DBC433FE for ; Thu, 24 Nov 2022 14:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=NglG8OaPcAEQDSGiwmBAqxUqjaZeKlJkttUUa7JtanM=; b=ffJ1VoCWYis97a 1QjsUm/0JEnQOqtV5vSVCicjgHM1H3HV6W/BP4+sMy7XJ8ZW/Mu8jShvdEZIiLp78XuqZ65MfAQTl LncBtw1T0qzByDgekLcNdKwXi3O3NzmHIw0hEA7iTtd/R233b7rCwsACu+uQN+iCI4+MiRUfz/QpS KwGAvyHI0V1To2iMCJDKOAVp5RSqbZfQv8OpID8QZ81N5FYnnYoooAspvwrVE/+Jw30uI55AY/CFS zmf4As7a2BxWzbC2eMcbBn8U+EQ3WgTDTVGPgh+aMhl3/9jQ1VHrxOHeQ7jnF1di+seJIh+cIM1ll AWj71RgQPbulXJB3/T7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyClV-0093Nh-Vo; Thu, 24 Nov 2022 13:59:46 +0000 Received: from mail-db8eur05on20721.outbound.protection.outlook.com ([2a01:111:f400:7e1a::721] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyCkn-00935e-Hi for linux-arm-kernel@lists.infradead.org; Thu, 24 Nov 2022 13:59:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nucxy/mz8eXz5W8+EinPzQFOfK86gO6oAnsQMaWC9dX+25NvCLzcj16riX+RNmyRM29irrAH7mhrVKQq/gF2QfKC6ao4OCcZRpSDz6BtRv7wtM8S+OOH/qneFnxac/8IK9fL5t6O3DZDiwLz8cacthSrdZF+UXG2PPG0jzY6SVULHbzvlpkkvEYvMXqAHB+ZS5U9UihtryC5fGr/mEBHuLLQ9ARryeLa99GO/BeyZn1ggOgaJiyJUCnyTKY6FjoGA9eR/+sASk9xI192KTvjUv8/jQI0MS3fhiRMoRHOfycOYcO3EM7GOZRQ5gPXMsTNyCDx2CH8HfQnfyOyTqBzpg== 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=Q7cylRnsRpLgxyddXHbnBWfHlJkqnior12AOdMfj4i4=; b=SZBEZBE+CSGxbq/lIPg9blTof0yKvpMVDWRRE2A1/rohCDmlVrgLkqzNGMZwGD2oITKOLqaiOwV05ArTmgPKSubyBGpFPyxwBflCKbI93tH0kHHebpcGWp0L53nZROtO29ULgYfI3kw60AkuOOGSlGGIowtaK0n04RZGKH+3XW8foxCA+RguiSEW1GaJOn7NgCfYqtQRja/X+oiKrY5spl9xeRRFyYuhG5vDlToGv6VB3wifNoryIlFXfDxUeCXGK1Os1KF4Lyd0UZvrHuvJfaNNtpUJcq51Bh52KEPy20Zk4opzLBdyyqWQABUH8wf5cjTpvTbE3wa6QNlssFcD9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q7cylRnsRpLgxyddXHbnBWfHlJkqnior12AOdMfj4i4=; b=ZjKA5tvaqt/Psx/UKBmejQ8AB9WeqR3ie4i64C6wA9fqTai4HB7afFgkJNrv5KYq1WxD6463oYMbkJiNLzIuP4UOGIE6Kk3vEK0evQeTKDeCSrMl2AyYYloRcEZPY4QzdcTNkmVuF0Rr16fOUaP/2RWtJde2ilGpLQ+to1+gknM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=plvision.eu; Received: from VI1P190MB0317.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:38::26) by AM7P190MB0758.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:117::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.20; Thu, 24 Nov 2022 13:58:54 +0000 Received: from VI1P190MB0317.EURP190.PROD.OUTLOOK.COM ([fe80::5912:e2b4:985e:265a]) by VI1P190MB0317.EURP190.PROD.OUTLOOK.COM ([fe80::5912:e2b4:985e:265a%3]) with mapi id 15.20.5834.016; Thu, 24 Nov 2022 13:58:54 +0000 From: Vadym Kochan To: Thomas Petazzoni , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Krzysztof Kozlowski , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Elad Nachman , Vadym Kochan , Raz Adashi , Yuval Shaia Subject: [PATCH v2 2/3] PCI: armada8k: Add AC5 SoC support Date: Thu, 24 Nov 2022 15:58:27 +0200 Message-Id: <20221124135829.2551873-3-vadym.kochan@plvision.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221124135829.2551873-1-vadym.kochan@plvision.eu> References: <20221124135829.2551873-1-vadym.kochan@plvision.eu> X-ClientProxiedBy: FR3P281CA0120.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::18) To VI1P190MB0317.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:38::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P190MB0317:EE_|AM7P190MB0758:EE_ X-MS-Office365-Filtering-Correlation-Id: 29010f78-bcd3-432c-ce1c-08dace240653 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Gbq0uQ0GBzA+anYKIYfMH63IaO4JKOFzVkJVm33PuxTX6FwwpGBlnlxXhHFIbqkW6mOjFZqxhBt58oovKoCU0XgcyvP5cG4TNDiUfyfVfMWQU+tJtHhv2ucNgK43ZUKiX+Zoq98IBD/DKwnznoh4ji4FgvQxWEb49V8Fsjz3ySwi6KC6MS2v0jg0al1r4vpeafE89GKzX6kW8hDK/Lvg4mx6RR8j02rlfQ4y86UVHgKXDiRzrzSpOiPxUSKrSHfW5hZsri0RBnwFCoiiNXaOOktJ6kCCa8GVrobJFj23HfveEECggU41CIRsFDqD2JhtRycZuspR3Nf62hEJvcwO8BS/ffq2B7l70dS9uZW1nF+c/bE2m43xfezEkq750uNIWj9NzbDnYjkvUFASZR9mEtruBWniu+u/Z6N2BXmCJ96jh0sg7TsrHPfeCuM6gzeJ+0gBB6fOx8Y5oijyUp7jdNRuQqZjCP5+ate26Md06dG4qH3RMf3gz/XpeqweqACW3cB67CrXKFcDNNZJzn3K/IBcQL18Bq2POsAqqqJij1F22l0eLIwjqJ/6BFX586NJa3bkdUfd7DpZpccxAinKX32DNVTirkrL67aoGOgoKM2VjBqHIRwKeD3uERKsuV09hR1i4WmfPg5fNXLQ1+Y27oissfh4WOTcaxutH18Y9tqAV4E3w+paEBQeZubjcKsUUuJHGVkFxh6cPVRATeAayJoXoruFl94b+QS4VH4beI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P190MB0317.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39830400003)(34036004)(366004)(346002)(396003)(451199015)(1076003)(8936002)(36756003)(83380400001)(2906002)(2616005)(41300700001)(44832011)(5660300002)(41320700001)(86362001)(921005)(38350700002)(38100700002)(6506007)(110136005)(54906003)(186003)(316002)(6666004)(52116002)(26005)(6512007)(7416002)(508600001)(6486002)(66946007)(8676002)(4326008)(66476007)(66556008)(32563001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XjU8RDiPQHCdi3l9hhfHqN3xS8n6YzRkV6hQE/tSShwOLMNW+nirPv5rOQBaW7epBTXRYq9pKH+FqXKmI14qHO6TrNC/X49W+JoS2hlH3ceO2xqzAecsV4k2ykM8tOxFD1J6rpf996mJz3FK60qSDeleSlR0lzcSTQRfpC9BSyQa67+2y803jGqt527ZrVat3pIJAjcyu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iOj4rAmq/coc6Xx0louW+bxXBvBmu8KJtnV04cLeUs4WNinZIzjY4C1fLbQvK00L2mnhleMF13jCLIXW0mHTRC7AmhFyzQAFlG0CoFx9QYUzx+kFCO66YTZfODkAFvq0vbQTP4nvMc1o03bjSt6CibdL87wC9AbCHziqobmu2QnI09Yp2N+Om5fNF1ORlyiOduqrYhlEd0DQrWA39pGD1zfU0QBkciUuCq3bNM87BGNdWLsuKjARFpTuQ3Y2XakNaY9l8MP/sfH/m6dCqExR3g7NnB8Rr51Ld7BvNwjZQ9SqE/yp6mMcDwmNbITvxqdQebBhpRYnpoLkrohYf9VidpoYw== X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: 29010f78-bcd3-432c-ce1c-08dace240653 X-MS-Exchange-CrossTenant-AuthSource: VI1P190MB0317.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2022 13:58:54.7740 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OtuIh/UkBizsyZ97i68/aAtIPdurpoYDHjawOBcF0NBpXuQSDGBlh0sfRqqocxbUnAPdx1OCAk183ZbdFagjGq4Q/QZ+MRnEyeql4cWlPTc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7P190MB0758 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_055901_771111_59F377B4 X-CRM114-Status: GOOD ( 20.97 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Raz Adashi pcie-armada8k driver is utilized to serve also AC5. Driver assumes interrupt mask registers are located in the same address inboth CPUs. This assumption is incorrect - fix it for AC5. Co-developed-by: Yuval Shaia Signed-off-by: Yuval Shaia Signed-off-by: Raz Adashi Signed-off-by: Vadym Kochan --- v2: 1) fix W1 warnings which caused by unused leftover code 2) Use one xlate function to translate ac5 dbi access. Also add mode description in comments about this translation. 3) Use correct name of Raz 4) Use matching data to pass the SoC specific params (type & ops) drivers/pci/controller/dwc/pcie-armada8k.c | 157 ++++++++++++++++----- 1 file changed, 119 insertions(+), 38 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-armada8k.c b/drivers/pci/controller/dwc/pcie-armada8k.c index 5c999e15c357..bbe9a1750d0d 100644 --- a/drivers/pci/controller/dwc/pcie-armada8k.c +++ b/drivers/pci/controller/dwc/pcie-armada8k.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -26,15 +27,26 @@ #define ARMADA8K_PCIE_MAX_LANES PCIE_LNK_X4 +enum armada8k_pcie_type { + ARMADA8K_PCIE_TYPE_A8K, + ARMADA8K_PCIE_TYPE_AC5 +}; + struct armada8k_pcie { struct dw_pcie *pci; struct clk *clk; struct clk *clk_reg; struct phy *phy[ARMADA8K_PCIE_MAX_LANES]; unsigned int phy_count; + enum armada8k_pcie_type pcie_type; }; -#define PCIE_VENDOR_REGS_OFFSET 0x8000 +struct armada8k_pcie_of_data { + enum armada8k_pcie_type pcie_type; + const struct dw_pcie_ops *pcie_ops; +}; + +#define PCIE_VENDOR_REGS_OFFSET 0x8000 /* in ac5 is 0x10000 */ #define PCIE_GLOBAL_CONTROL_REG (PCIE_VENDOR_REGS_OFFSET + 0x0) #define PCIE_APP_LTSSM_EN BIT(2) @@ -48,10 +60,17 @@ struct armada8k_pcie { #define PCIE_GLOBAL_INT_CAUSE1_REG (PCIE_VENDOR_REGS_OFFSET + 0x1C) #define PCIE_GLOBAL_INT_MASK1_REG (PCIE_VENDOR_REGS_OFFSET + 0x20) +#define PCIE_GLOBAL_INT_MASK2_REG (PCIE_VENDOR_REGS_OFFSET + 0x28) #define PCIE_INT_A_ASSERT_MASK BIT(9) #define PCIE_INT_B_ASSERT_MASK BIT(10) #define PCIE_INT_C_ASSERT_MASK BIT(11) #define PCIE_INT_D_ASSERT_MASK BIT(12) +#define PCIE_INT_A_ASSERT_MASK_AC5 BIT(12) +#define PCIE_INT_B_ASSERT_MASK_AC5 BIT(13) +#define PCIE_INT_C_ASSERT_MASK_AC5 BIT(14) +#define PCIE_INT_D_ASSERT_MASK_AC5 BIT(15) + +#define PCIE_ATU_ACCESS_MASK_AC5 GENMASK(21, 20) #define PCIE_ARCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x50) #define PCIE_AWCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x54) @@ -153,22 +172,11 @@ static int armada8k_pcie_link_up(struct dw_pcie *pci) return 0; } -static int armada8k_pcie_start_link(struct dw_pcie *pci) -{ - u32 reg; - - /* Start LTSSM */ - reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG); - reg |= PCIE_APP_LTSSM_EN; - dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); - - return 0; -} - static int armada8k_pcie_host_init(struct dw_pcie_rp *pp) { u32 reg; struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct armada8k_pcie *pcie = to_armada8k_pcie(pci); if (!dw_pcie_link_up(pci)) { /* Disable LTSSM state machine to enable configuration */ @@ -177,32 +185,41 @@ static int armada8k_pcie_host_init(struct dw_pcie_rp *pp) dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); } - /* Set the device to root complex mode */ - reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG); - reg &= ~(PCIE_DEVICE_TYPE_MASK << PCIE_DEVICE_TYPE_SHIFT); - reg |= PCIE_DEVICE_TYPE_RC << PCIE_DEVICE_TYPE_SHIFT; - dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); + if (pcie->pcie_type == ARMADA8K_PCIE_TYPE_A8K) { + /* Set the device to root complex mode */ + reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG); + reg &= ~(PCIE_DEVICE_TYPE_MASK << PCIE_DEVICE_TYPE_SHIFT); + reg |= PCIE_DEVICE_TYPE_RC << PCIE_DEVICE_TYPE_SHIFT; + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); - /* Set the PCIe master AxCache attributes */ - dw_pcie_writel_dbi(pci, PCIE_ARCACHE_TRC_REG, ARCACHE_DEFAULT_VALUE); - dw_pcie_writel_dbi(pci, PCIE_AWCACHE_TRC_REG, AWCACHE_DEFAULT_VALUE); + /* Set the PCIe master AxCache attributes */ + dw_pcie_writel_dbi(pci, PCIE_ARCACHE_TRC_REG, ARCACHE_DEFAULT_VALUE); + dw_pcie_writel_dbi(pci, PCIE_AWCACHE_TRC_REG, AWCACHE_DEFAULT_VALUE); - /* Set the PCIe master AxDomain attributes */ - reg = dw_pcie_readl_dbi(pci, PCIE_ARUSER_REG); - reg &= ~(AX_USER_DOMAIN_MASK << AX_USER_DOMAIN_SHIFT); - reg |= DOMAIN_OUTER_SHAREABLE << AX_USER_DOMAIN_SHIFT; - dw_pcie_writel_dbi(pci, PCIE_ARUSER_REG, reg); + /* Set the PCIe master AxDomain attributes */ + reg = dw_pcie_readl_dbi(pci, PCIE_ARUSER_REG); + reg &= ~(AX_USER_DOMAIN_MASK << AX_USER_DOMAIN_SHIFT); + reg |= DOMAIN_OUTER_SHAREABLE << AX_USER_DOMAIN_SHIFT; + dw_pcie_writel_dbi(pci, PCIE_ARUSER_REG, reg); - reg = dw_pcie_readl_dbi(pci, PCIE_AWUSER_REG); - reg &= ~(AX_USER_DOMAIN_MASK << AX_USER_DOMAIN_SHIFT); - reg |= DOMAIN_OUTER_SHAREABLE << AX_USER_DOMAIN_SHIFT; - dw_pcie_writel_dbi(pci, PCIE_AWUSER_REG, reg); + reg = dw_pcie_readl_dbi(pci, PCIE_AWUSER_REG); + reg &= ~(AX_USER_DOMAIN_MASK << AX_USER_DOMAIN_SHIFT); + reg |= DOMAIN_OUTER_SHAREABLE << AX_USER_DOMAIN_SHIFT; + dw_pcie_writel_dbi(pci, PCIE_AWUSER_REG, reg); + } /* Enable INT A-D interrupts */ - reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG); - reg |= PCIE_INT_A_ASSERT_MASK | PCIE_INT_B_ASSERT_MASK | - PCIE_INT_C_ASSERT_MASK | PCIE_INT_D_ASSERT_MASK; - dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG, reg); + if (pcie->pcie_type == ARMADA8K_PCIE_TYPE_AC5) { + reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_MASK2_REG); + reg |= PCIE_INT_A_ASSERT_MASK_AC5 | PCIE_INT_B_ASSERT_MASK_AC5 | + PCIE_INT_C_ASSERT_MASK_AC5 | PCIE_INT_D_ASSERT_MASK_AC5; + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK2_REG, reg); + } else { + reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG); + reg |= PCIE_INT_A_ASSERT_MASK | PCIE_INT_B_ASSERT_MASK | + PCIE_INT_C_ASSERT_MASK | PCIE_INT_D_ASSERT_MASK; + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG, reg); + } return 0; } @@ -258,9 +275,59 @@ static int armada8k_add_pcie_port(struct armada8k_pcie *pcie, return 0; } -static const struct dw_pcie_ops dw_pcie_ops = { +static u32 ac5_xlate_dbi_reg(u32 reg) +{ + /* Handle AC5 ATU access */ + if ((reg & ~0xfffff) == PCIE_ATU_ACCESS_MASK_AC5) { + reg &= 0xfffff; + /* ATU registers offset is 0xC00 + 0x200 * n, + * from RFU registers. + */ + reg = 0xc000 | (0x200 * (reg >> 9)) | (reg & 0xff); + } else if ((reg & 0xfffff000) == PCIE_VENDOR_REGS_OFFSET) { + /* PCIe RFU registers in A8K are at offset 0x8000 from base + * (0xf2600000) while in AC5 offset is 0x10000 from base + * (0x800a0000) therefore need the addition of 0x8000. + */ + reg += PCIE_VENDOR_REGS_OFFSET; + } + + return reg; +} + +static u32 ac5_pcie_read_dbi(struct dw_pcie *pci, void __iomem *base, + u32 reg, size_t size) +{ + u32 val; + + dw_pcie_read(base + ac5_xlate_dbi_reg(reg), size, &val); + return val; +} + +static void ac5_pcie_write_dbi(struct dw_pcie *pci, void __iomem *base, + u32 reg, size_t size, u32 val) +{ + dw_pcie_write(base + ac5_xlate_dbi_reg(reg), size, val); +} + +static const struct dw_pcie_ops armada8k_dw_pcie_ops = { + .link_up = armada8k_pcie_link_up, +}; + +static const struct dw_pcie_ops ac5_dw_pcie_ops = { .link_up = armada8k_pcie_link_up, - .start_link = armada8k_pcie_start_link, + .read_dbi = ac5_pcie_read_dbi, + .write_dbi = ac5_pcie_write_dbi, +}; + +static const struct armada8k_pcie_of_data a8k_pcie_of_data = { + .pcie_type = ARMADA8K_PCIE_TYPE_A8K, + .pcie_ops = &armada8k_dw_pcie_ops, +}; + +static const struct armada8k_pcie_of_data ac5_pcie_of_data = { + .pcie_type = ARMADA8K_PCIE_TYPE_AC5, + .pcie_ops = &ac5_dw_pcie_ops, }; static int armada8k_pcie_probe(struct platform_device *pdev) @@ -268,9 +335,15 @@ static int armada8k_pcie_probe(struct platform_device *pdev) struct dw_pcie *pci; struct armada8k_pcie *pcie; struct device *dev = &pdev->dev; + const struct armada8k_pcie_of_data *data; struct resource *base; int ret; + data = of_device_get_match_data(dev); + if (!data) + return -EINVAL; + + pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); if (!pcie) return -ENOMEM; @@ -279,9 +352,10 @@ static int armada8k_pcie_probe(struct platform_device *pdev) if (!pci) return -ENOMEM; + pci->ops = data->pcie_ops; pci->dev = dev; - pci->ops = &dw_pcie_ops; + pcie->pcie_type = data->pcie_type; pcie->pci = pci; pcie->clk = devm_clk_get(dev, NULL); @@ -334,7 +408,14 @@ static int armada8k_pcie_probe(struct platform_device *pdev) } static const struct of_device_id armada8k_pcie_of_match[] = { - { .compatible = "marvell,armada8k-pcie", }, + { + .compatible = "marvell,armada8k-pcie", + .data = &a8k_pcie_of_data, + }, + { + .compatible = "marvell,ac5-pcie", + .data = &ac5_pcie_of_data, + }, {}, }; From patchwork Thu Nov 24 13:58:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 13055022 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7374CC433FE for ; Thu, 24 Nov 2022 14:01:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=k/5XaEUfsj8Yn/atcYlWBHLblt+eOpWcdYTMcnQX1EM=; b=kagIv0CO55r6In 6BSXu4Ab1FT4LLr5FMvCUUkn5iJ1gGZkTwS7EStQGZXnO5jza6OnpvigpTVIxpC7w/V80hCc+U9Uu WzofvL8vxT7C1Pv6iDNybI0iqAIgp2BB9kXPhDssNyTgtwp0mr+xE3jyDa0lC4pTPUs2MSfD1e5Hb ggV3iOCEsTp/g5BynfrLCI4BJH2CR0E0t9TkSvi3T9nGl0V5FmTYb0XNSUasghAh/cmP97/EuCLxv kYCIqsdfw7imByyfxrPyX5pE6btQRLMMO7Laz0QW2eblM0kOxtJHxJZWTIs2rOW5xAySLfgH8k8V+ oezU7o113hc4Tww/Yv3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyClz-0093YU-1p; Thu, 24 Nov 2022 14:00:15 +0000 Received: from mail-db8eur05on20721.outbound.protection.outlook.com ([2a01:111:f400:7e1a::721] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyCkq-00935e-2H for linux-arm-kernel@lists.infradead.org; Thu, 24 Nov 2022 13:59:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNNrGGPzPZr+1uAH0Qa1C4L7iFUhukH+jpIzRakLl2/P9FYL7SQeOb7xiLwHfd4Ji+M8jTnGLcU3t80061BiXAQXyEOYUL4swA601BtRDlAcyVVMpgv2Z4Yaf3YJBoO+rtpf38GGDFbTVUifrdT3tBH+AVdzcUSiQkcy/068ESSL9ACfR2FiTaMEEq4zU25f5ntjSc19xZccyuXvfvjzZ8ifhg4hrtmDSsHllztTdqMwEzeYcNJ0NQT9GIuZICgmFVmYpF5s7bFdYW/HSKRX5vj2sRXR2/Y4iWLUx3DZbTS0kS5XagUk/2VKMzME8Hin6zGUwCcG4lMh6FOORGi73A== 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=7396+6ZiFBQD4iMFbUA/ppiHVWn/Lc/v6+EqomZUYow=; b=AXSQmEG8q5uhJ+iE6NJrIrwhekWZKDxzgvW8xXKZpJScTlrotkTnL6iJz/ZkKmPtzrZtx9Y1UPQ86Qv+13R5xVvhVComXlg4mc/YBw9ZKp4chfn6yDOqsgpR7EB09tzmq4L33Pf/9qxSfoAAmgky0ApoAFCuMJxsV+HhUcto0bqc/RGOSsb8MTGQPL72qE9Z7jIrtxdFt80CttgwlUzACMBHvvy0DfcQeZBLZ+txPjeJtiA3FuiynX27+A/QBcMoZOKywFzbmZBGt4JGdSbSoVRP68Q25fNCtQ4HGMHeugwPN89L66U/tG2G8Ll/98HcANP/ahtmm65Jim+C7lOxeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7396+6ZiFBQD4iMFbUA/ppiHVWn/Lc/v6+EqomZUYow=; b=VGyC/Q2DyYUItCCQZwrJJyto3K1zLxzjdVUv6Q6HWscFT2MpswbE+9NLUTWmW0bebxka3XbYsdjKQQ0CQPuASVYVYxfr9Gq2WVe7I9pCL0EAblz1cakWatJD0cT/bu2TcnWWsd8z93/GqF0echc8ltPxDj4VcLlaLc09x4uiA8U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=plvision.eu; Received: from VI1P190MB0317.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:38::26) by AM7P190MB0758.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:117::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.20; Thu, 24 Nov 2022 13:58:56 +0000 Received: from VI1P190MB0317.EURP190.PROD.OUTLOOK.COM ([fe80::5912:e2b4:985e:265a]) by VI1P190MB0317.EURP190.PROD.OUTLOOK.COM ([fe80::5912:e2b4:985e:265a%3]) with mapi id 15.20.5834.016; Thu, 24 Nov 2022 13:58:56 +0000 From: Vadym Kochan To: Thomas Petazzoni , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Krzysztof Kozlowski , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Elad Nachman , Vadym Kochan , Yuval Shaia Subject: [PATCH v2 3/3] PCI: armada8k: Add MSI support for AC5 SoC Date: Thu, 24 Nov 2022 15:58:28 +0200 Message-Id: <20221124135829.2551873-4-vadym.kochan@plvision.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221124135829.2551873-1-vadym.kochan@plvision.eu> References: <20221124135829.2551873-1-vadym.kochan@plvision.eu> X-ClientProxiedBy: FR3P281CA0120.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::18) To VI1P190MB0317.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:38::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P190MB0317:EE_|AM7P190MB0758:EE_ X-MS-Office365-Filtering-Correlation-Id: 779bcf49-8303-42fe-c21b-08dace24070d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ubqmJQpNQP3QDbkOs+bYzvBRIw60pqOMTVjj0J/GcvKHNl570gLs+vINCScH8k+i/nR2mXE0nqTS6qp58vRr3dKx8RwXXyiNFz2Zd5il//YX/humGcfobYR7ARXDr6bgobTb3JBeTpXnVhjJCLFTMbP8ClGE18ULV9+xgIznSjdwaNwgH6SBEG2DsC/2JkvhuIIR53Cf1t3WjJCHZ7xtSegzQO5N1+1HzPl4fPz3GsJghmov6Joi8VzR2AoPbkUXVc+jFi9VMiA+lcGgiLfDBHTkMGWKY2IFVvT0BXuVBszi9AeloV9+awJkrSt9Wdrrtyu7HRW4rxAV0Cr2gF9v+Z+5BPr630wxEz5oQVGNMwD0DTHS4nuxbUdXH3qZu8e3j/LgxiDzOAHqzcZRFbOQIGdsvwpEqg5ouUJbnTN+Fnqo4dXsWgK+v9tvzn6SwbsF+FYzgM6FfFu+EGTGh4ECLosrrXtawQMhLjt7HVxYzaodmnM23tS1VMyd7A7D8IecAFSOg8MCyHAeXztngPXyBma/92xgoVQEiu5nDn8+iwJ4D363npT+Uei2Lv1NUIffsXktOk/k5W4fIB7Mo9FmCC5Leupi6Veo0j7cYIX7l3nNIyUWLmrFOobwb4TryC82sbtgyjuBqiR1hTFrJQ10tdfa9kybsoeFAPD1guQAK0yFgvP7IPVhnua97N5mwWMiZWp8BNg1YhndkA6xLba1Kt7p29OmUc6ySQXt7/ZDU8M= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P190MB0317.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39830400003)(34036004)(366004)(346002)(396003)(451199015)(1076003)(8936002)(36756003)(83380400001)(2906002)(2616005)(41300700001)(44832011)(5660300002)(41320700001)(86362001)(921005)(38350700002)(38100700002)(6506007)(110136005)(54906003)(186003)(316002)(6666004)(52116002)(26005)(6512007)(7416002)(508600001)(6486002)(66946007)(8676002)(4326008)(66476007)(66556008)(32563001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jT9o6Icc5JjNxVYmz9Wu0qTWQxpiTKb4onx2/brrnWbMh74wWw7MTeOvCyohT2bFlQgngx5uHZi3YcRDifCe//WpMLniKC9aV4fWR4jrMU5tqnStN+Qv7HgKXEdAbj7MpzCsqI5Bw9ywdFsSFWQ16QmkXB68smy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QEoRUa3UxtgtKSMmh0qkTRR8jApd9wwv+8ExJhTiiz/zmioyPPM2MC8PgSlSS3zAF/B9gHynDTR0lGPOs036J4GCw/jlCyYS9x0XbOZFhyMCterUu4bxUo/gAa2WprFhsh37vi5Nl4a+eMtL/9vrFMkGRfvbTSTdWCetHz8dRgHgOof5uR5l//kA42/f3e/DA+JlFCSEqxKDK+y0X1tLFbVwMEZrEjiZt4vDyi29og1W7ToQh4+JcHOsRWV68cw4onwop2hIBnU3u0xGc8maYTsP8FQfYOIpe5iy00vat24C0ku/7pehGFifQb1hoJWXMnHlRgpCI3lxSBRhq19ytWDycQvnb9XMYzfZU2IEXGHbcuPZLwyCbDvGw== X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: 779bcf49-8303-42fe-c21b-08dace24070d X-MS-Exchange-CrossTenant-AuthSource: VI1P190MB0317.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2022 13:58:56.6488 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xKOD06exHN/wcvrRXOotE+/jRWNYF7LzYZtcYDrWoSfvz6iTaO5JT3wNQtu+Tbm82/YBAnV7sXxRW/eVII1Cxj+C2cfXrnBdUoRcjQ9tfGs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7P190MB0758 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_055904_181583_E61AA33E X-CRM114-Status: GOOD ( 15.20 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yuval Shaia AC5 requires different handling for MSI as with armada8k. Fix it by: 1. Enabling the relevant bits in init phase 2. Dispatch virtual IRQ handlers when MSI interrupts are received Also enable/disable PCIE_APP_LTSSM for AC5. Signed-off-by: Yuval Shaia Signed-off-by: Vadym Kochan --- v2: 1) fix W1 warnings which caused by unused leftover code 2) fix type in "requieres" word in the description drivers/pci/controller/dwc/pcie-armada8k.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-armada8k.c b/drivers/pci/controller/dwc/pcie-armada8k.c index bbe9a1750d0d..7e02eddaeac0 100644 --- a/drivers/pci/controller/dwc/pcie-armada8k.c +++ b/drivers/pci/controller/dwc/pcie-armada8k.c @@ -50,6 +50,7 @@ struct armada8k_pcie_of_data { #define PCIE_GLOBAL_CONTROL_REG (PCIE_VENDOR_REGS_OFFSET + 0x0) #define PCIE_APP_LTSSM_EN BIT(2) +#define PCIE_APP_LTSSM_EN_AC5 BIT(24) #define PCIE_DEVICE_TYPE_SHIFT 4 #define PCIE_DEVICE_TYPE_MASK 0xF #define PCIE_DEVICE_TYPE_RC 0x4 /* Root complex */ @@ -69,6 +70,7 @@ struct armada8k_pcie_of_data { #define PCIE_INT_B_ASSERT_MASK_AC5 BIT(13) #define PCIE_INT_C_ASSERT_MASK_AC5 BIT(14) #define PCIE_INT_D_ASSERT_MASK_AC5 BIT(15) +#define PCIE_MSI_MASK_AC5 BIT(11) #define PCIE_ATU_ACCESS_MASK_AC5 GENMASK(21, 20) @@ -172,6 +174,16 @@ static int armada8k_pcie_link_up(struct dw_pcie *pci) return 0; } +static void ac5_pcie_msi_init(struct dw_pcie *pci) +{ + u32 val; + + /* Set MSI bit in interrupt mask */ + val = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG); + val |= PCIE_MSI_MASK_AC5; + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG, val); +} + static int armada8k_pcie_host_init(struct dw_pcie_rp *pp) { u32 reg; @@ -181,7 +193,10 @@ static int armada8k_pcie_host_init(struct dw_pcie_rp *pp) if (!dw_pcie_link_up(pci)) { /* Disable LTSSM state machine to enable configuration */ reg = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_CONTROL_REG); - reg &= ~(PCIE_APP_LTSSM_EN); + if (pcie->pcie_type == ARMADA8K_PCIE_TYPE_AC5) + reg &= ~(PCIE_APP_LTSSM_EN_AC5); + else + reg &= ~(PCIE_APP_LTSSM_EN); dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG, reg); } @@ -221,6 +236,9 @@ static int armada8k_pcie_host_init(struct dw_pcie_rp *pp) dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK1_REG, reg); } + if (IS_ENABLED(CONFIG_PCI_MSI) && (pcie->pcie_type == ARMADA8K_PCIE_TYPE_AC5)) + ac5_pcie_msi_init(pci); + return 0; } @@ -237,6 +255,8 @@ static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) */ val = dw_pcie_readl_dbi(pci, PCIE_GLOBAL_INT_CAUSE1_REG); dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_CAUSE1_REG, val); + if ((PCIE_MSI_MASK_AC5 & val) && (pcie->pcie_type == ARMADA8K_PCIE_TYPE_AC5)) + dw_handle_msi_irq(&pci->pp); return IRQ_HANDLED; }