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: 910811 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SphYIr8O"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40gw3V4jP1z9s0W for ; Wed, 9 May 2018 22:03:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934447AbeEIMCe (ORCPT ); Wed, 9 May 2018 08:02:34 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43116 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934713AbeEIMCc (ORCPT ); Wed, 9 May 2018 08:02:32 -0400 Received: by mail-lf0-f66.google.com with SMTP id g12-v6so50562577lfb.10 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=X82YqHKHY78boNVTRdG3htXOcl9D8+xbCDqKmVstc+rrgxAM5A2gdL8S1vyXrM3r39 eXmAr5IRISxn2aZlIx7uZpN8i4hqZoO5zhgzwFUUZqavbrO2hOJQX7nCdW3Iwy9KUOMP VEbGVAx2QZux/g323NQx958cG9xKRAIX0RNXZDdWrXZodw5c/zRAvTVf44j38YqrY9nR FLZwJW7UoBkWTQknDxmjEPNSl9lWZ3nyOjFsWeCuZq7NZBK6aI6P2gbSnIDqJdPscegV RmKPUkkn+TQ69oAMUXTOn1aUadYgWzruIrcUOo9UMKj03Bpc1uEK9P0laWCnU1gwpD3x PT/w== X-Gm-Message-State: ALQs6tBvy4tZ/yejvQOQfNY/2NhyCjlqjhgKaa1kGV9HVgGoqyOkF2bA 7h+f+ovcH7+mHiSWYxJYdL55kA== X-Google-Smtp-Source: AB8JxZqdi4sRFXPoEZ5BLnM5JfSiUq/xPc6TQI2q3OVlCpKCgrCWV5+hjX0Zb6J0c2yWdRBtwVy4mQ== 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: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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(-) 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>;