From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRO1A-00053S-4F for qemu-devel@nongnu.org; Tue, 09 Sep 2014 12:11:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRO12-0000aG-JU for qemu-devel@nongnu.org; Tue, 09 Sep 2014 12:11:44 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:39546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRO12-0000a1-Dm for qemu-devel@nongnu.org; Tue, 09 Sep 2014 12:11:36 -0400 Received: by mail-we0-f175.google.com with SMTP id w61so2480589wes.20 for ; Tue, 09 Sep 2014 09:11:35 -0700 (PDT) Message-ID: <540F26A0.2020809@linaro.org> Date: Tue, 09 Sep 2014 18:11:12 +0200 From: Eric Auger MIME-Version: 1.0 References: <1410249273-6063-1-git-send-email-eric.auger@linaro.org> <1410249273-6063-3-git-send-email-eric.auger@linaro.org> <540EDECB.1000801@redhat.com> <540F2325.3070009@linaro.org> <540F24D4.9070103@redhat.com> In-Reply-To: <540F24D4.9070103@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 2/6] hw/arm/dyn_sysbus_devtree: helpers for sysbus device dynamic dt node generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, a.rigo@virtualopensystems.com, kim.phillips@freescale.com, marc.zyngier@arm.com, manish.jaggi@caviumnetworks.com, joel.schopp@amd.com, agraf@suse.de, peter.maydell@linaro.org, afaerber@suse.de Cc: patches@linaro.org, will.deacon@arm.com, stuart.yoder@freescale.com, Bharat.Bhushan@freescale.com, alex.williamson@redhat.com, a.motakis@virtualopensystems.com, kvmarm@lists.cs.columbia.edu On 09/09/2014 06:03 PM, Paolo Bonzini wrote: > Il 09/09/2014 17:56, Eric Auger ha scritto: >>>>>> + if (!sbdev) { >>>>>> + /* Container, traverse it for children */ >>>>>> + return object_child_foreach(obj, >>>>>> + arm_sysbus_device_create_devtree, data); >>>>>> + } >> When we add support for a dynamically instantiable device we add >> something like >> >> if (object_dynamic_cast(obj, TYPE_ETSEC_COMMON)) { >> create_devtree_etsec(ETSEC_COMMON(dev), data); >> matched = true; >> } >>>>>> + >>>>>> + if (!matched) { >>>> >>>> Who is going to set "matched", since it doesn't escape? >> >> > > That's not part of this patch though, right? right So this code for now is > dead. Please remove the dead code if it is not used in this series. > > We really should make that an interface, so that the code can do just > > if (object_dynamic_cast(obj, TYPE_FDT_BUILDER)) { > fdt_builder_create_fdt(FDT_BUILDER(dev), data); > } else { > ... > } > > (and so can the generic virt.c code) but that can come later. OK I will correct > >>> Why does arm_sysbus_device_create_devtree need intc and irq_start? >> >> irq_start: needed because when the "interrupts" property is set for the >> leaf component the irq number is irq_start + >> object_property_get_int(obj, "irq[i]", NULL) >> irq[i] being in [0, params->platform_bus_num_irqs] > > Ah, it's passed to the not-yet-existing create_* functions. yep > >> intc: this was in case the leaf component would use "interrupt-parent" >> prop. I miss experience on device trees and I don't know if it make >> sense the leaf component uses a different interrupt controller than the >> parent platform bus or if such property is mandatory in some cases. >> Maybe not needed indeed. > > No idea, sorry. - Eric > > Paolo >