From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Subject: Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr Date: Wed, 10 Sep 2014 09:55:48 +0800 Message-ID: <540FAFA4.1080008@huawei.com> References: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> <1410184472-17630-8-git-send-email-Liviu.Dudau@arm.com> <20140908145459.GO27864@e106497-lin.cambridge.arm.com> <20140908155931.GP27864@e106497-lin.cambridge.arm.com> <540E960D.7080408@huawei.com> <20140909084621.GS27864@e106497-lin.cambridge.arm.com> <540EC8CB.7010106@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Bjorn Helgaas Cc: Catalin Marinas , linux-pci , Linus Walleij , Liviu Dudau , Grant Likely , Tanmay Inamdar , linux-arch , Kukjin Kim , Russell King , Jingoo Han , Jason Gunthorpe , Benjamin Herrenschmidt , "grant.likely@linaro.org" , Device Tree ML , Arnd Bergmann , Will Deacon , Rob Herring , LAKML , Sinan Kaya , LKML , Suravee Suthikulanit List-Id: linux-arch.vger.kernel.org >> OK. Sorry, I have one last question, because domain will be used to calculate the address used to >> access PCI hardware config registers. So if DTS file doesn't report the domain, how do we know >> we would access the right registers when we use the auto increment domain vaule ? >> Has there a mechanism to make sure system can access the correct registers by the domain ? > > I think you're referring to config access via ECAM (PCIe r3.0, sec > 7.2.2). In that case, I don't think the domain should be used to > compute the memory-mapped configuration address. Each host bridge is > in exactly one domain, and each host bridge has an associated ECAM > area base. The address calculation uses the bus number, device > number, function number, and register number to compute an offset into > the ECAM area. > > So as long as the DT tells you the ECAM information for each host > bridge, that should be sufficient. The domain number is then just a > Linux convenience and is not tied to the platform as it is on ia64. Hi Bjorn, you are right, thanks for your detailed explanation! :) Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga03-in.huawei.com ([119.145.14.66]:10079 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbaIJCBe (ORCPT ); Tue, 9 Sep 2014 22:01:34 -0400 Message-ID: <540FAFA4.1080008@huawei.com> Date: Wed, 10 Sep 2014 09:55:48 +0800 From: Yijing Wang MIME-Version: 1.0 Subject: Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr References: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> <1410184472-17630-8-git-send-email-Liviu.Dudau@arm.com> <20140908145459.GO27864@e106497-lin.cambridge.arm.com> <20140908155931.GP27864@e106497-lin.cambridge.arm.com> <540E960D.7080408@huawei.com> <20140909084621.GS27864@e106497-lin.cambridge.arm.com> <540EC8CB.7010106@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Bjorn Helgaas Cc: Liviu Dudau , Rob Herring , Arnd Bergmann , Rob Herring , Jason Gunthorpe , Benjamin Herrenschmidt , Catalin Marinas , Will Deacon , Russell King , linux-pci , Linus Walleij , Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit , linux-arch , LKML , Device Tree ML , LAKML , "grant.likely@linaro.org" Message-ID: <20140910015548.rCI276ujETb_n8qion9b-_ifTWEz5eGcstSH6VrVYP4@z> >> OK. Sorry, I have one last question, because domain will be used to calculate the address used to >> access PCI hardware config registers. So if DTS file doesn't report the domain, how do we know >> we would access the right registers when we use the auto increment domain vaule ? >> Has there a mechanism to make sure system can access the correct registers by the domain ? > > I think you're referring to config access via ECAM (PCIe r3.0, sec > 7.2.2). In that case, I don't think the domain should be used to > compute the memory-mapped configuration address. Each host bridge is > in exactly one domain, and each host bridge has an associated ECAM > area base. The address calculation uses the bus number, device > number, function number, and register number to compute an offset into > the ECAM area. > > So as long as the DT tells you the ECAM information for each host > bridge, that should be sufficient. The domain number is then just a > Linux convenience and is not tied to the platform as it is on ia64. Hi Bjorn, you are right, thanks for your detailed explanation! :) Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing From mboxrd@z Thu Jan 1 00:00:00 1970 From: wangyijing@huawei.com (Yijing Wang) Date: Wed, 10 Sep 2014 09:55:48 +0800 Subject: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr In-Reply-To: References: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> <1410184472-17630-8-git-send-email-Liviu.Dudau@arm.com> <20140908145459.GO27864@e106497-lin.cambridge.arm.com> <20140908155931.GP27864@e106497-lin.cambridge.arm.com> <540E960D.7080408@huawei.com> <20140909084621.GS27864@e106497-lin.cambridge.arm.com> <540EC8CB.7010106@huawei.com> Message-ID: <540FAFA4.1080008@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org >> OK. Sorry, I have one last question, because domain will be used to calculate the address used to >> access PCI hardware config registers. So if DTS file doesn't report the domain, how do we know >> we would access the right registers when we use the auto increment domain vaule ? >> Has there a mechanism to make sure system can access the correct registers by the domain ? > > I think you're referring to config access via ECAM (PCIe r3.0, sec > 7.2.2). In that case, I don't think the domain should be used to > compute the memory-mapped configuration address. Each host bridge is > in exactly one domain, and each host bridge has an associated ECAM > area base. The address calculation uses the bus number, device > number, function number, and register number to compute an offset into > the ECAM area. > > So as long as the DT tells you the ECAM information for each host > bridge, that should be sufficient. The domain number is then just a > Linux convenience and is not tied to the platform as it is on ia64. Hi Bjorn, you are right, thanks for your detailed explanation! :) Thanks! Yijing. > > Bjorn > > . > -- Thanks! Yijing