From patchwork Sun Nov 29 23:07:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= X-Patchwork-Id: 11939391 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=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 7B0B5C64E7B for ; Sun, 29 Nov 2020 23:09:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2B22A21973 for ; Sun, 29 Nov 2020 23:09:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2C9Ih2fU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B22A21973 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S47lwYrS5TTDjESIwQRQQyAHHRfj98Tm72e8DNsLdk0=; b=2C9Ih2fUZBTwVuHTyBg8/FPPa i2XuwRiPxfjAnMMhr7g6MAneRpQQXYwb4c9t0jvFJpbFn6e+6lnsEIdOEpSpvMrfuX4iVw8Hs4K64 vGiL/RMtibm9lGhUpNilFaslawWcD4BArHGY/K0HAGKuppTottP9OaB0U2DGmHV7OVqxpkHMYyvEU UYWhey7o/txCGKNNwvvafPEav/FhZ0w/TbVkWMkWcBt9ugjZnIVD5RqIDjrAgLFg5r9Wq3lUPPp/+ oJk8I/PrP48H5yCGhwwoO19kMZYKFKuN5zV36jp97Yo4KyUIOICQEEDbZQ/aLyF7rdpijaP/doWVc SOAcsAHmw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjVnU-000274-MD; Sun, 29 Nov 2020 23:08:00 +0000 Received: from mail-wr1-f67.google.com ([209.85.221.67]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjVnK-00023e-5s; Sun, 29 Nov 2020 23:07:51 +0000 Received: by mail-wr1-f67.google.com with SMTP id l1so13057668wrb.9; Sun, 29 Nov 2020 15:07:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C4ZAbgOviSl5kwTV38A0mgojnuMMJBX6cIDk0sTmaeo=; b=esspPGNu/llG76Fi/eaa8Ceb9v9iJwy01Y8c4Vesp050TNggv/RclTFssZmYNWWsFf IoSNCHBakMZnr46safj7ZgmlZ1AutDPFVf82WDNv/zWMGQ106TgClJZAICld89Ogs0Et tdGf5W9N907rFscjQq8pE5VKcXix5djkYY7hodQgfIh4ku6/+COQKQKPe52wtR7Qx46f aPQNZXHo1FApp+SfJWV67Uag9shNVaDd5W6oyZedLwZ0i6RNuY+xmK/oS+Fp4uX73gDr BRGfKPIuDwOv2u/53rbd3Ev2C+L1W5bRa4mZRXrzTxHfnQlgnlfQMyrvcwgTsc+dCDbI TuBQ== X-Gm-Message-State: AOAM531/qdY1fEYJm52h7pm7E9BECwDYb9C6obNm5o7VHyHr/aGr41Fc WEfWNxRe7m0a2evkSKPTMKs= X-Google-Smtp-Source: ABdhPJyc10rS86sUCkCS7JwDecOpIFDWRywvD2p3TPef9gz9BjYexnZrT+fR1+MqL8LVO9fcgPl/QQ== X-Received: by 2002:adf:fd0e:: with SMTP id e14mr24090769wrr.119.1606691269434; Sun, 29 Nov 2020 15:07:49 -0800 (PST) Received: from workstation.lan ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id d2sm24831005wrn.43.2020.11.29.15.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 15:07:48 -0800 (PST) From: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= To: Bjorn Helgaas Subject: [PATCH v6 2/5] PCI: thunder-pem: Add constant for custom ".bus_shit" initialiser Date: Sun, 29 Nov 2020 23:07:40 +0000 Message-Id: <20201129230743.3006978-3-kw@linux.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201129230743.3006978-1-kw@linux.com> References: <20201129230743.3006978-1-kw@linux.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201129_180750_253993_5DD2A5F0 X-CRM114-Status: GOOD ( 14.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , Benjamin Herrenschmidt , Shawn Lin , Paul Mackerras , Thomas Petazzoni , Jonathan Chocron , Toan Le , Will Deacon , Rob Herring , Lorenzo Pieralisi , Michael Ellerman , Michal Simek , linux-rockchip@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, Jonathan Derrick , linux-pci@vger.kernel.org, Ray Jui , Florian Fainelli , linux-rpi-kernel@lists.infradead.org, Jonathan Cameron , linux-arm-kernel@lists.infradead.org, Scott Branden , Zhou Wang , Robert Richter , linuxppc-dev@lists.ozlabs.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a custom constant for the ".bus_shit" initialiser to capture a non-standard platform-specific ECAM bus shift value. Standard values otherwise defined in the PCI Express Specification are available in the include/linux/pci-ecam.h. Suggested-by: Bjorn Helgaas Signed-off-by: Krzysztof WilczyƄski --- drivers/pci/controller/pci-thunder-pem.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pci-thunder-pem.c b/drivers/pci/controller/pci-thunder-pem.c index 3f847969143e..1a3f70ac61fc 100644 --- a/drivers/pci/controller/pci-thunder-pem.c +++ b/drivers/pci/controller/pci-thunder-pem.c @@ -19,6 +19,15 @@ #define PEM_CFG_WR 0x28 #define PEM_CFG_RD 0x30 +/* + * Enhanced Configuration Access Mechanism (ECAM) + * + * N.B. This is a non-standard platform-specific ECAM bus shift value. For + * standard values defined in the PCI Express Base Specification see + * include/linux/pci-ecam.h. + */ +#define THUNDER_PCIE_ECAM_BUS_SHIFT 24 + struct thunder_pem_pci { u32 ea_entry[3]; void __iomem *pem_reg_base; @@ -404,7 +413,7 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg) } const struct pci_ecam_ops thunder_pem_ecam_ops = { - .bus_shift = 24, + .bus_shift = THUNDER_PCIE_ECAM_BUS_SHIFT, .init = thunder_pem_acpi_init, .pci_ops = { .map_bus = pci_ecam_map_bus, @@ -441,7 +450,7 @@ static int thunder_pem_platform_init(struct pci_config_window *cfg) } static const struct pci_ecam_ops pci_thunder_pem_ops = { - .bus_shift = 24, + .bus_shift = THUNDER_PCIE_ECAM_BUS_SHIFT, .init = thunder_pem_platform_init, .pci_ops = { .map_bus = pci_ecam_map_bus,