From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 08/17] xen/arm: ITS: Add APIs to add and assign device Date: Thu, 16 Jul 2015 16:38:54 +0200 Message-ID: <55A7C1FE.7020909@citrix.com> References: <1436514172-3263-1-git-send-email-vijay.kilari@gmail.com> <1436514172-3263-9-git-send-email-vijay.kilari@gmail.com> <1436539933.10074.70.camel@citrix.com> <55A65CA3.6080606@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: Ian Campbell , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org Hi Vijay, On 16/07/2015 15:40, Vijay Kilari wrote: > On Wed, Jul 15, 2015 at 6:44 PM, Julien Grall wrote: >> Hi Ian, >> >> On 10/07/2015 16:52, Ian Campbell wrote: >>>> >>>> +static struct its_device *its_alloc_device(u32 devid) >>>> +{ >>>> + struct its_device *dev; >>>> + paddr_t *itt; >>>> + unsigned long *lpi_map; >>>> + int lpi_base, nr_lpis, sz; >>>> + u32 nr_ites; >>>> + >>>> + dev = xzalloc(struct its_device); >>>> + if ( dev == NULL ) >>>> + return NULL; >>>> + >>>> + dev->its = its_get_phys_node(devid); >>>> + /* TODO: Use pci helper to get nvecs */ >>>> + nr_ites = 64; >>> >>> >>> Please add nr_ites as a parameter to this function and to >>> its_add_device, such that this hardcoding can be pushed all the way down >>> into the final patch which adds the temporary registration code in >>> xen/arch/arm/platforms/thunderx.c. >> >> >> +1, I would also add the physical ITS in parameter as it's not possible to >> get it based on the devID (see its_get_phys_node). > > thunderx.c does not have physical ITS to pass as parameter. That's not true. You are able to get the PCI root controller which should have a phandle to the ITS device tree node. With this dt node in hand you can get the correct physical ITS. Regards, -- Julien Grall