From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBaeK-0004VA-Cz for qemu-devel@nongnu.org; Tue, 11 Sep 2012 20:17:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBaeJ-0000U0-F7 for qemu-devel@nongnu.org; Tue, 11 Sep 2012 20:17:48 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:57812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBaeJ-0000Tw-9y for qemu-devel@nongnu.org; Tue, 11 Sep 2012 20:17:47 -0400 Received: by obbta14 with SMTP id ta14so1596824obb.4 for ; Tue, 11 Sep 2012 17:17:46 -0700 (PDT) From: Peter Crosthwaite In-Reply-To: References: <1347236407-10465-1-git-send-email-crwulff@gmail.com> <1347236407-10465-9-git-send-email-crwulff@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 12 Sep 2012 10:17:36 +1000 Message-ID: <1347409056.30441.38.camel@PetaLogix-ws2> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 8/9] MicroBlaze: Add a config that is dynamically set up by a device tree file. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: crwulff@gmail.com, qemu-devel@nongnu.org On Tue, 2012-09-11 at 19:27 +0000, Blue Swirl wrote: > On Mon, Sep 10, 2012 at 12:20 AM, wrote: > > From: Chris Wulff > > > > +/* > > + * Xilinx ethernetlite device > > + */ > > +static void xilinx_ethlite_probe(void *fdt, int node) > > +{ > > + uint32_t eth_addr = fdt_get_int_from_array(fdt, node, "reg", 0); > > + uint32_t eth_irq = fdt_get_int_from_array(fdt, node, "interrupts", 0); > > + > > + xilinx_ethlite_create(&nd_table[++eth_dev_index], eth_addr, > > + irq[eth_irq], 0, 0); > > The device should not access nd_table, this should be handled at board level. > This is board level isn't it? This function calls xilinx_ethlite_create() which in turn does the qdev_create so this is pre device creation. Im open to suggestions on how to do this in a non-global hacking way however as I have the same problem in my tree. Regards, Peter > > +} > > + > > +devinfo_t xilinx_ethlite_device = { > > + .probe = &xilinx_ethlite_probe, > > + .pass = 1, > > + .compat = (const char * []) { "xlnx,xps-ethernetlite-2.00.b", NULL } > > +}; > > +