From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754164AbdCWDAU (ORCPT ); Wed, 22 Mar 2017 23:00:20 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34364 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbdCWDAM (ORCPT ); Wed, 22 Mar 2017 23:00:12 -0400 Subject: Re: Purpose of PCI address in ranges property To: Arnd Bergmann References: <26e69b06-dde2-2ed5-0288-ee5d58676d7e@gmail.com> Cc: Linux Kernel Mailing List , linux-pci , Bjorn Helgaas , Marc Zyngier From: valmiki Message-ID: Date: Thu, 23 Mar 2017 08:29:25 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/20/2017 3:15 AM, Arnd Bergmann wrote: > On Sun, Mar 19, 2017 at 3:14 PM, valmiki wrote: >> Hi, >> >> When ranges property is being parsed using of_pci_get_host_bridge_resources, >> the pci address is being used for >> calculating the offset for pci_add_resource_offset. >> >> What is this offset for ? >> >> So the cpu address is being used for programming memory base and limit >> registers ? > > Linux IORESOURCE_MEM resources are defined in terms of CPU addresses, > while PCI config space BAR registers are programmed with bus addresses. > These are often the same, but on some machines they are not, which results > in an offset that has to be used when accessing the BARs. > Thanks Arnd. So mem base and limit registers of RP are programmed with CPU addresses, and EP BARs are programmed with PCI bus addresses ? So when will this offset be used, only when RP assigns BAR's to RP ? Regards, Valmiki