From patchwork Tue Dec 8 20:44:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 57906 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp265690lbb; Tue, 8 Dec 2015 12:46:37 -0800 (PST) X-Received: by 10.66.150.37 with SMTP id uf5mr2883030pab.30.1449607596593; Tue, 08 Dec 2015 12:46:36 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 4si7295537pfq.125.2015.12.08.12.46.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 12:46:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6P88-0008TQ-MT; Tue, 08 Dec 2015 20:45:00 +0000 Received: from mail-ob0-f178.google.com ([209.85.214.178]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6P7u-0008OF-7C for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2015 20:44:47 +0000 Received: by obciw8 with SMTP id iw8so21211476obc.1 for ; Tue, 08 Dec 2015 12:44:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vJYs7arFWk9q1W0Ut6dGGZAb4K5JAPXC64Kzm0kLd/U=; b=eNtmDBzLvPUDh9Pc1oUtCd3mz1gNBdJ3+WDS2yksqdA+DnM3T31u9cqPo7w0bRWWr3 toD26CLjA1GCl67axAP5D6erwEBJ5TsW4mqheKAVS6CidNQPIv74+wOUKblV0YIACWzB any6pLkBn25X4Bu2ZCtsYD0gRKJ49U58MNrC6NLFlnVxZi3gRc1S+lTQSBZXcEgtiKdm qj5csLCp9DpqWh7V/f+R0jRkncArXprpTaWc5O/aAk8RpCwP3bkU6U9FKsBIMF2gGcNx 9Z6IUQr7OBaKKvMkyVpz4jvHZbIC0vLBhwgxaAd3SX0XFPhVD0zlL/lDPll+7QTeCH2J 7k6g== X-Received: by 10.60.150.237 with SMTP id ul13mr1399832oeb.49.1449607465396; Tue, 08 Dec 2015 12:44:25 -0800 (PST) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id ct9sm2033801oec.15.2015.12.08.12.44.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Dec 2015 12:44:25 -0800 (PST) From: Rob Herring To: Arnd Bergmann , Linus Walleij Subject: [PATCH 1/4] ARM: versatile: add DT based PCI detection Date: Tue, 8 Dec 2015 14:44:15 -0600 Message-Id: <1449607458-16850-2-git-send-email-robh@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1449607458-16850-1-git-send-email-robh@kernel.org> References: <1449607458-16850-1-git-send-email-robh@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151208_124446_370481_2124EE15 X-CRM114-Status: GOOD ( 13.93 ) X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.178 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.214.178 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Russell King , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Disable the Versatile PCI DT node when no PCI backplane is detected. This will prevent the Versatile PCI driver from probing when PCI is not populated. Signed-off-by: Rob Herring Cc: Russell King Cc: Linus Walleij --- arch/arm/mach-versatile/versatile_dt.c | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index 7de3e92..a585758 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c @@ -22,15 +22,65 @@ */ #include +#include +#include +#include #include #include +#include #include #include #include "core.h" +#define VERSATILE_SYS_PCICTL_OFFSET 0x44 +static void __iomem *versatile_sys_base; + +static void __init versatile_dt_pci_init(void) +{ + u32 val; + struct device_node *np; + struct property *newprop; + + np = of_find_compatible_node(NULL, NULL, "arm,versatile-pci"); + if (!np) + return; + + /* Check if PCI backplane is detected */ + val = readl(versatile_sys_base + VERSATILE_SYS_PCICTL_OFFSET); + if (val & 1) { + /* + * Enable PCI accesses. Note that the documentaton is + * inconsistent whether or not this is needed, but the old + * driver had it so we will keep it. + */ + writel(1, versatile_sys_base + VERSATILE_SYS_PCICTL_OFFSET); + return; + } + + newprop = kzalloc(sizeof(*newprop), GFP_KERNEL); + if (!newprop) + return; + + newprop->name = kstrdup("status", GFP_KERNEL); + newprop->value = kstrdup("disabled", GFP_KERNEL); + newprop->length = sizeof("disabled"); + of_update_property(np, newprop); + + pr_info("Not plugged into PCI backplane!\n"); +} + static void __init versatile_dt_init(void) { + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "arm,core-module-versatile"); + if (np) + versatile_sys_base = of_iomap(np, 0); + WARN_ON(!versatile_sys_base); + + versatile_dt_pci_init(); + of_platform_populate(NULL, of_default_bus_match_table, versatile_auxdata_lookup, NULL); }