From patchwork Wed May 9 12:01:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 135254 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5548546lji; Wed, 9 May 2018 05:02:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqB8cfz1QREa1FK3I08HnO5Lt4vM5pNsCSFoODcU9/bsf1CIxb+ZHf21jHqAEys0ZLOTkrA X-Received: by 2002:a63:6441:: with SMTP id y62-v6mr36384341pgb.362.1525867355838; Wed, 09 May 2018 05:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525867355; cv=none; d=google.com; s=arc-20160816; b=vKq1hSkb0WHvcTrJm3qwxUEXUO/xAqaGI5Kyhw6VLscZ7z61+60FN4QT/+b+KWh3zg oFQ3ee0cCMnaa33qL19NLAa+YtokfW+19j3nxg8P9IBsUH1+APdwBiHMl9EArQq4owyf pzyV6aoxJQ3kpkCUZ4n67RoojqSITcbT8NKLJV1eU7Dn9RZ9vXqk964f4IZtmgDBaoCv NjYsxC9hIasEOB9P7k8bOH3smP2aesHgWoyco7+46sFprBjKk4+qbKX29b9vyAzh1xYC WKzjh1pqNlyuXWBzG8JeVWlK0bpGHqIfzo9+pespBnAPCCp970XwKsgMNFbg1Up0seW1 cxjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=E5FWmTnbeLHuz/gnu0XAtT7VthrS3fSYLdc4Fbt5ytc=; b=EKdN94p+QWyC80u/MAu37xgdsMLJ0Oe8D2v4SqudDgWMqbhin7UdL15ELL0yoU02cZ l1DEiJOukLn82XDfz6xYqxTGwzZISCG2BokRd3oSpSXLyzXNKc5SBUHHATk6tMYRWY1l mqayCd5L994/wKeweE5fK8BYKa7NmnI6vCu5QKAKJZuX15PU5Axm3vHuJ9lkCLsvtOHu 8SoqeJtZEpFWqgxTfQgyM91tqKsEzOUVCB48o7Vqn+mV1JUID9yO5S7Q7UQz8Fiq8PrV Kpkk1zCGIQlZSrsEqWaoju2vCsfezRiyobRQbteoN9lHj6RjmkzbxB307/sZoXbY6X7e fnmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SphYIr8O; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15-v6si21329877pgq.442.2018.05.09.05.02.35; Wed, 09 May 2018 05:02:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SphYIr8O; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934722AbeEIMCd (ORCPT + 6 others); Wed, 9 May 2018 08:02:33 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:45975 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934447AbeEIMCc (ORCPT ); Wed, 9 May 2018 08:02:32 -0400 Received: by mail-lf0-f65.google.com with SMTP id q2-v6so5381577lfc.12 for ; Wed, 09 May 2018 05:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=A5NrrJAiik2jbxTG+vPKgaVsL/iQCb04WcFpSJ84AiQ=; b=SphYIr8O86t0ObvnpjWqF0lgEiN5z/5zXYiMm3VNAHJ7IzBYmcRwyXeYoURApAke11 cdIukIqHXGQbCiVyTTrOCzb+DkJfIEl2QfSEYMOJ+GzC8FJ/BkRhj25awrtgrl/IZ2/H aKL8Lq1CW5oxwdpkBGLf/bzVUuN7tgRtsh3CI= 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; bh=A5NrrJAiik2jbxTG+vPKgaVsL/iQCb04WcFpSJ84AiQ=; b=DwFCpsjMqHpq1+YBRNSbkxdAyfAh0RduDpyJXXyfkEnHSIl8Fg1aEG2nT1n/TTUa4D jfT6ZeCah6APCodnMkgQyS6HR62n8fwfufpjJUNFWVWyXN97ZND0tL64Gy2kTNCYOIW0 30ObAIRf//S4CS9iK9S+R2d+Tn+RB8zfQjAMR1uaeU0hQIICGs3S/2oNKC9gO7iIWaof pQuDN9fDJZeqBzO7X8e2BsNiJUIpVs4cRQuhWsJVKBwOhl4C4zE9A8EdJlGnX9O7rBz7 F3h8YXePxYVFKhzdTjNHXDnLFL1pzJhHxz+dtLvVI5dc9ea/AzelTijkv10ws6QcxHOq X6tw== X-Gm-Message-State: ALQs6tDpsSsqxiCWnFgqbL0G7uhlPnX8YhT9BOvtBwXmcgweatxhUFFg y0/qmrBgYpC4SRM5wuMZF181Hg== X-Received: by 2002:a2e:9656:: with SMTP id z22-v6mr29864192ljh.127.1525867351189; Wed, 09 May 2018 05:02:31 -0700 (PDT) Received: from localhost.lan (h-229-118.A785.priv.bahnhof.se. [5.150.229.118]) by smtp.gmail.com with ESMTPSA id 25-v6sm1772667ljc.35.2018.05.09.05.02.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 05:02:30 -0700 (PDT) From: Niklas Cassel To: Andy Gross , David Brown , Rob Herring , Mark Rutland Cc: linux-pci@vger.kernel.org, Niklas Cassel , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: dts: qcom-apq8064: use correct pci address for address translation Date: Wed, 9 May 2018 14:01:34 +0200 Message-Id: <20180509120135.25940-1-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.17.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org For PCI, the second and third cell in ranges specifies the upper and lower target address for address translation. This target address will be used to program the internal address translation unit (iATU). The current device tree configuration will program the iATU to translate CPU accesses to 0x08000000 to PCI address 0x0 (with TLP type MEM). The device tree configuration also specifies that CPU acesses to 0x0fe00000 will be translated to PCI address 0x0 (with TLP type I/O). We cannot have both I/O space and memory space at PCI address 0x0. The PCI code already uses the CPU address when assigning addresses to memory BARs, so for memory space the PCI address should be the same as the CPU address. This also matches how all other device trees using snps,dw-pcie are configured. The existing configuration appears to work, even if it is incorrect. For some reason the iATU doesn't obey the existing configuration, and doesn't translate CPU accesses from 0x08000000 to PCI address 0x0. The reason why the existing configuration works at all is probably because the default behavior, when there is no match, is to use the untranslated address. This happens to work for memory space, since it's a 1:1 mapping. However, instead of relying on this behavior, let's configure the iATU correctly. Signed-off-by: Niklas Cassel --- arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi index 5341a39c0392..148cf7e565f6 100644 --- a/arch/arm/boot/dts/qcom-apq8064.dtsi +++ b/arch/arm/boot/dts/qcom-apq8064.dtsi @@ -1417,7 +1417,7 @@ #address-cells = <3>; #size-cells = <2>; ranges = <0x81000000 0 0 0x0fe00000 0 0x00100000 /* I/O */ - 0x82000000 0 0 0x08000000 0 0x07e00000>; /* memory */ + 0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* memory */ interrupts = ; interrupt-names = "msi"; #interrupt-cells = <1>;