From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRNun-0001WL-RO for qemu-devel@nongnu.org; Tue, 09 Sep 2014 12:05:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRNuh-0006x6-NM for qemu-devel@nongnu.org; Tue, 09 Sep 2014 12:05:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRNuh-0006vH-Ej for qemu-devel@nongnu.org; Tue, 09 Sep 2014 12:05:03 -0400 Message-ID: <540F24D4.9070103@redhat.com> Date: Tue, 09 Sep 2014 18:03:32 +0200 From: Paolo Bonzini 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> In-Reply-To: <540F2325.3070009@linaro.org> 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: Eric Auger , 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 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? 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. >> 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. > 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. Paolo