Received: by 10.192.165.148 with SMTP id m20csp5428613imm; Wed, 9 May 2018 05:03:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrC+CVUQNGiyTPQKgJAnAldtDctaf0KqZ1eGWoThykz1yAAljSx8DKHez+IXy0Rrq0SceJ+ X-Received: by 2002:a17:902:d909:: with SMTP id c9-v6mr18750010plz.293.1525867432183; Wed, 09 May 2018 05:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525867432; cv=none; d=google.com; s=arc-20160816; b=jWWIxqFNK7UebgjpN4YvytwrwPnQ2yF8y3jts78GYZ7fDEzZy8S0L9a0zLQI9oJW10 rTIxTYKDb7xVtDRqIGewt9GisiRAoBt79/rw1tL6DCanDmK/PNOjQCVceor9uP+EhHKl VkbcVuQlzO5QWtac43Z9r/C2Fnfydh7iJRKyUp2ulbHG9N214N9pvhdnUCHG6Qk3voAM teLbjtEt3UwoeO/vhIV4EJunBWMTPSUgqaQL4eoIJ2HbIfY0685wBBmsXSTMtp4r+QKn spY9APekSWsEOGOJZd3YcGlQZJOY95dE5nCVVb+qL5mU0ihovxNinJJzbVqz93DfTOP7 1DJg== 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=A5NrrJAiik2jbxTG+vPKgaVsL/iQCb04WcFpSJ84AiQ=; b=bNxQ2Chos0oWRttlntNF2sTB9VSGhBZppavgTotkuNSPHAtVOyPNpN664SwOrMQfvc xec1et/xHY0Q9JiqERupSnEgvJqpLyXtauAuvIqVG1H7KUQYc/64KCpDm+v/V73HfJzg bE+dVtarxS1++PF3+8bucACKGo/M0Opgq7J1fOZVSPx51QftemVSTIBuad2j3ar0ifCI NXiYhCf89SxsHrz3I849BD6cbt/SZDvEI/SyQ+RwzmUsCJUR4t/5ptEY1+TlAN9uj7TC IVdqMHN5nbE8Nmgs05m1jYpG5fswYktUJpArlLg96j1anSd2yT6Z4D4gak4RdtVlGECt E9tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SphYIr8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 o10-v6si21190731pgv.636.2018.05.09.05.03.37; Wed, 09 May 2018 05:03:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SphYIr8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934856AbeEIMCf (ORCPT + 99 others); Wed, 9 May 2018 08:02:35 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:46824 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934721AbeEIMCc (ORCPT ); Wed, 9 May 2018 08:02:32 -0400 Received: by mail-lf0-f65.google.com with SMTP id x7-v6so15564280lff.13 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=CqZtnWpEViYkpVmsq0YBmvViO9beHVf19L6i82KB01Ei2725JDOezoUZe85YE/UsEM treyQLZDNrnxRBCBrCvJVZe3whKdxAQxk3Ur42RJlRqOgJxZ5jRvZLDYZr7a9fUnMtwP qnCg6hzhxw2Jz5RFjhxYgx5tClifxtC90erhSlNDrtU/JkJd0luK1OL5q/ss8KGV9gJk 6v0dbHG0wREMB6ekPRy16fICfzzY5nNi/r5WBrKgwekbGHrZj4xBXlnby5kuzdBoXHkN 9CV+V8lBQxL0u0y5YTWp5gakBJ2OSd3cAAfvc6JI0zipIczToaTkegqm+qQxalykcz64 zZuQ== X-Gm-Message-State: ALQs6tCoaiiaMX1ijx+5sRoqQkYfFEALSEk8V78T+E8Efk6CuP7XyX6z ugiJNyqDqj8CC3gfbH4yuhOE5w== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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>; -- 2.17.0